Skip to content

Commit

Permalink
Update to prettier 2 and use eslint to run it
Browse files Browse the repository at this point in the history
  • Loading branch information
Munter committed Apr 5, 2020
1 parent 801fe39 commit 0f560b8
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"extends": ["standard", "prettier", "prettier/standard"],
"plugins": ["mocha"],
"plugins": ["mocha", "prettier"],
"env": {
"mocha": true
},
"rules": {
"prettier/prettier": "error",
"prefer-template": "error",
"mocha/no-exclusive-tests": "error",
"mocha/no-nested-tests": "error",
Expand Down
8 changes: 4 additions & 4 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ const immutableHeaders = `
module.exports = {
onPostBuild: async ({
constants: { BUILD_DIR },
inputs: { entryPoints, ...subfontConfig }
inputs: { entryPoints, ...subfontConfig },
}) => {
console.log(
`Running subfont version ${require('subfont/package.json').version}`
);

const resolvedEntryPoints = globby
.sync(entryPoints, { cwd: BUILD_DIR })
.map(path => resolve(BUILD_DIR, path));
.map((path) => resolve(BUILD_DIR, path));

const headerPromise = appendFile(
resolve(BUILD_DIR, '_headers'),
Expand All @@ -37,13 +37,13 @@ module.exports = {
inputFiles: resolvedEntryPoints,
root: BUILD_DIR,
canonicalRoot,
inPlace: true
inPlace: true,
},
console
);

await headerPromise;

return result;
}
},
};
30 changes: 27 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,22 @@
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-mocha": "^6.3.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.1.2",
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-standard": "^4.0.0",
"magicpen-prism": "^4.0.0",
"mocha": "^7.1.1",
"nyc": "^15.0.1",
"offline-github-changelog": "^1.6.1",
"prettier": "^1.19.1",
"prettier": "^2.0.2",
"rimraf": "^3.0.2",
"unexpected": "^11.14.0"
},
"main": "lib/index.js",
"scripts": {
"prebuild": "rimraf dist",
"build": "cpy site dist",
"lint": "eslint . && prettier --check '**/*.js'",
"lint": "eslint .",
"test": "mocha",
"netlify-build": "netlify-build",
"ci": "npm run lint && npm run coverage && npm run netlify-build",
Expand Down

0 comments on commit 0f560b8

Please sign in to comment.