From 4d5ff56b991112e2ec6d6c2c568ceeded8a1404c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Mon, 28 May 2018 16:26:45 +0200 Subject: [PATCH] Turn off eslint rules inconsistent with prettier settings and run prettier through eslint (#136) --- .eslintrc | 15 +++++++++++++++ lint-staged.config.js | 5 +---- package.json | 15 ++++++++------- 3 files changed, 24 insertions(+), 11 deletions(-) create mode 100644 .eslintrc diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 00000000..85c140a1 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,15 @@ +{ + "extends": [ + "eslint-config-developit", + "prettier", + "plugin:prettier/recommended" + ], + "plugins": [ + "prettier" + ], + "rules": { + "brace-style": "off", + "comma-dangle": ["warn", "always-multiline"], + "indent": "off" + } +} diff --git a/lint-staged.config.js b/lint-staged.config.js index 7dcf9ea4..5567cbfd 100644 --- a/lint-staged.config.js +++ b/lint-staged.config.js @@ -1,9 +1,6 @@ module.exports = { linters: { - '{src,test}/**/*.js': [ - 'prettier --use-tabs --single-quote --trailing-comma=all --write', - 'git add', - ], + '{src,test}/**/*.js': ['eslint --fix', 'git add'], '*.md': ['prettier --write', 'git add'], }, ignore: ['**/dist/**/*.js'], diff --git a/package.json b/package.json index 4ebbbbc1..ed28659f 100644 --- a/package.json +++ b/package.json @@ -17,17 +17,16 @@ "release": "npm run -s prepare && npm test && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish" }, "repository": "developit/microbundle", - "eslintConfig": { - "extends": "eslint-config-developit", - "rules": { - "comma-dangle": ["warn", "always-multiline"] - } - }, "babel": { "presets": [ "env" ] }, + "prettier": { + "singleQuote": true, + "trailingComma": "all", + "useTabs": true + }, "keywords": [ "bundle", "rollup", @@ -76,11 +75,13 @@ "directory-tree": "^2.1.0", "eslint": "^4.19.1", "eslint-config-developit": "^1.1.1", + "eslint-config-prettier": "^2.9.0", + "eslint-plugin-prettier": "^2.6.0", "fs-extra": "^5.0.0", "husky": "^0.14.3", "jest": "^22.4.3", "lint-staged": "^7.1.0", - "prettier": "^1.12.1", + "prettier": "^1.13.0", "rimraf": "^2.6.2", "shell-quote": "^1.6.1", "strip-ansi": "^4.0.0"