Add plugin:prettier/recommended (#3508)
* Add plugin:prettier/recommended * Revert eslint-plugin-prettier docs changesmaster
parent
8be1fbb58a
commit
5e81e75601
14
.eslintrc.js
14
.eslintrc.js
|
@ -5,8 +5,12 @@ module.exports = {
|
|||
es6: true,
|
||||
node: true
|
||||
},
|
||||
extends: ["eslint:recommended", "plugin:react/recommended"],
|
||||
plugins: ["prettier", "react", "import"],
|
||||
extends: [
|
||||
"eslint:recommended",
|
||||
"plugin:react/recommended",
|
||||
"plugin:prettier/recommended"
|
||||
],
|
||||
plugins: ["import"],
|
||||
rules: {
|
||||
curly: "error",
|
||||
"import/no-extraneous-dependencies": [
|
||||
|
@ -22,15 +26,9 @@ module.exports = {
|
|||
"one-var": ["error", "never"],
|
||||
"prefer-arrow-callback": "error",
|
||||
"prefer-const": "error",
|
||||
"prettier/prettier": "error",
|
||||
"react/no-deprecated": "off",
|
||||
strict: "error",
|
||||
"symbol-description": "error",
|
||||
yoda: ["error", "never", { exceptRange: true }]
|
||||
},
|
||||
parserOptions: {
|
||||
ecmaFeatures: {
|
||||
jsx: true
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -47,3 +47,13 @@ yarn add --dev eslint-config-prettier
|
|||
```
|
||||
|
||||
There are a few rules that this disables that you may want to turn back on as long as you don't use them with particular options which conflict with Prettier. See [the docs](https://github.com/prettier/eslint-config-prettier#special-rules) for details.
|
||||
|
||||
## Why not both?
|
||||
|
||||
`eslint-plugin-prettier` exposes a `"recommended"` configuration that turns on both `eslint-plugin-prettier` and `eslint-config-prettier`, all you need in your `.eslintrc.json` is:
|
||||
|
||||
```json
|
||||
{
|
||||
"extends": ["plugin:prettier/recommended"]
|
||||
}
|
||||
```
|
||||
|
|
|
@ -60,9 +60,10 @@
|
|||
"codecov": "2.2.0",
|
||||
"cross-env": "5.0.5",
|
||||
"eslint": "4.1.1",
|
||||
"eslint-config-prettier": "2.9.0",
|
||||
"eslint-friendly-formatter": "3.0.0",
|
||||
"eslint-plugin-import": "2.6.1",
|
||||
"eslint-plugin-prettier": "2.1.2",
|
||||
"eslint-plugin-prettier": "2.4.0",
|
||||
"eslint-plugin-react": "7.1.0",
|
||||
"jest": "21.1.0",
|
||||
"mkdirp": "0.5.1",
|
||||
|
|
22
yarn.lock
22
yarn.lock
|
@ -1465,6 +1465,12 @@ escodegen@^1.6.1:
|
|||
optionalDependencies:
|
||||
source-map "~0.2.0"
|
||||
|
||||
eslint-config-prettier@2.9.0:
|
||||
version "2.9.0"
|
||||
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-2.9.0.tgz#5ecd65174d486c22dff389fe036febf502d468a3"
|
||||
dependencies:
|
||||
get-stdin "^5.0.1"
|
||||
|
||||
eslint-formatter-pretty@^1.3.0:
|
||||
version "1.3.0"
|
||||
resolved "https://registry.yarnpkg.com/eslint-formatter-pretty/-/eslint-formatter-pretty-1.3.0.tgz#985d9e41c1f8475f4a090c5dbd2dfcf2821d607e"
|
||||
|
@ -1514,12 +1520,12 @@ eslint-plugin-import@2.6.1:
|
|||
minimatch "^3.0.3"
|
||||
read-pkg-up "^2.0.0"
|
||||
|
||||
eslint-plugin-prettier@2.1.2:
|
||||
version "2.1.2"
|
||||
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-2.1.2.tgz#4b90f4ee7f92bfbe2e926017e1ca40eb628965ea"
|
||||
eslint-plugin-prettier@2.4.0:
|
||||
version "2.4.0"
|
||||
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-2.4.0.tgz#85cab0775c6d5e3344ef01e78d960f166fb93aae"
|
||||
dependencies:
|
||||
fast-diff "^1.1.1"
|
||||
jest-docblock "^20.0.1"
|
||||
jest-docblock "^21.0.0"
|
||||
|
||||
eslint-plugin-prettier@^2.2.0:
|
||||
version "2.3.1"
|
||||
|
@ -1883,6 +1889,10 @@ get-stdin@^4.0.1:
|
|||
version "4.0.1"
|
||||
resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe"
|
||||
|
||||
get-stdin@^5.0.1:
|
||||
version "5.0.1"
|
||||
resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-5.0.1.tgz#122e161591e21ff4c52530305693f20e6393a398"
|
||||
|
||||
get-stream@3.0.0, get-stream@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14"
|
||||
|
@ -2506,10 +2516,6 @@ jest-docblock@21.3.0-beta.11:
|
|||
dependencies:
|
||||
detect-newline "^2.1.0"
|
||||
|
||||
jest-docblock@^20.0.1:
|
||||
version "20.0.3"
|
||||
resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-20.0.3.tgz#17bea984342cc33d83c50fbe1545ea0efaa44712"
|
||||
|
||||
jest-docblock@^21.0.0, jest-docblock@^21.2.0:
|
||||
version "21.2.0"
|
||||
resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-21.2.0.tgz#51529c3b30d5fd159da60c27ceedc195faf8d414"
|
||||
|
|
Loading…
Reference in New Issue