diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..8388d27 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,7 @@ +node_modules +coverage/ +dist +stats.html +src/generators/*/templates/**/* +test/**/snapshots +CHANGELOG.md diff --git a/package.json b/package.json index 18743a7..2a7a692 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,9 @@ }, "scripts": { "build": "rm -rf dist && babel src --out-dir dist --copy-files --include-dotfiles", - "prepublishOnly": "npm run build && ../../scripts/insert-header.js", + "lint": "npm run lint:eslint && npm run lint:prettier", + "lint:eslint": "eslint --ext .ts,.js,.mjs,.cjs .", + "lint:prettier": "prettier \"**/*.{ts,js,mjs,cjs,md}\" --check --ignore-path .eslintignore", "start": "npm run build && node ./dist/create.js", "test": "npm run test:node", "test:node": "mocha --require @babel/register", @@ -56,6 +58,13 @@ "eslint": "^7.11.0", "eslint-config-prettier": "^6.13.0", "mocha": "^6.2.2", - "onchange": "^5.2.0" + "onchange": "^5.2.0", + "prettier": "^2.1.2" + }, + "prettier": { + "singleQuote": true, + "arrowParens": "avoid", + "printWidth": 100, + "trailingComma": "all" } } diff --git a/yarn.lock b/yarn.lock index 0d3387f..188f082 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3762,6 +3762,11 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== +prettier@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.1.2.tgz#3050700dae2e4c8b67c4c3f666cdb8af405e1ce5" + integrity sha512-16c7K+x4qVlJg9rEbXl7HEGmQyZlG4R9AgP+oHKRMsMsuk8s+ATStlf1NpDqyBI1HpVyfjLOeMhH2LvuNvV5Vg== + pretty-bytes@^5.3.0: version "5.4.1" resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.4.1.tgz#cd89f79bbcef21e3d21eb0da68ffe93f803e884b"