eslint-config-prettier 6.4.0 → 6.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ### Version 6.5.0 (2019-10-26)
2
+
3
+ - Added: Support for [excluding deprecated rules]. Thanks to Alex Ilyaev
4
+ (@alexilyaev)!
5
+
1
6
  ### Version 6.4.0 (2019-10-05)
2
7
 
3
8
  - Added: [unicorn/no-nested-ternary]. Thanks to Yang Mingshan
@@ -329,6 +334,7 @@
329
334
  [eslint-plugin-typescript]: https://github.com/bradzacher/eslint-plugin-typescript
330
335
  [eslint-plugin-unicorn]: https://github.com/sindresorhus/eslint-plugin-unicorn
331
336
  [eslint-plugin-vue]: https://github.com/vuejs/eslint-plugin-vue
337
+ [excluding deprecated rules]: https://github.com/prettier/eslint-config-prettier/tree/9f6b59486ad742dc12ad3be157ddff5f8454ef7a#excluding-deprecated-rules
332
338
  [flowtype/boolean-style]: https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-boolean-style
333
339
  [function-call-argument-newline]: https://eslint.org/docs/rules/function-call-argument-newline
334
340
  [function-paren-newline]: https://eslint.org/docs/rules/function-paren-newline
package/README.md CHANGED
@@ -15,6 +15,7 @@ it together with some other config.
15
15
 
16
16
 
17
17
  - [Installation](#installation)
18
+ - [Excluding deprecated rules](#excluding-deprecated-rules)
18
19
  - [CLI helper tool](#cli-helper-tool)
19
20
  - [Example configuration](#example-configuration)
20
21
  - [Special rules](#special-rules)
@@ -108,6 +109,18 @@ enables [eslint-plugin-react] rules, so `"prettier/react"` is needed:
108
109
  If you’re unsure which plugins are used, you can usually find them in your
109
110
  `package.json`.
110
111
 
112
+ ### Excluding deprecated rules
113
+
114
+ Some of the rules that eslint-config-prettier turns off may be deprecated.
115
+ **This is perfectly fine,** but if you really need to omit the
116
+ deprecated rules, you can do so by setting the
117
+ `ESLINT_CONFIG_PRETTIER_NO_DEPRECATED` environment variable to a non-empty
118
+ value. For example:
119
+
120
+ ```
121
+ env ESLINT_CONFIG_PRETTIER_NO_DEPRECATED=true npx eslint-find-rules --deprecated index.js
122
+ ```
123
+
111
124
  ## CLI helper tool
112
125
 
113
126
  eslint-config-prettier also ships with a little CLI tool to help you check if
@@ -780,17 +793,17 @@ You can also supply a custom message if you want:
780
793
 
781
794
  eslint-config-prettier has been tested with:
782
795
 
783
- - ESLint 6.5.1
796
+ - ESLint 6.6.0
784
797
  - eslint-config-prettier 5.1.0 and older were tested with ESLint 5.x
785
798
  - eslint-config-prettier 2.10.0 and older were tested with ESLint 4.x
786
799
  - eslint-config-prettier 2.1.1 and older were tested with ESLint 3.x
787
800
  - prettier 1.18.2
788
- - @typescript-eslint/eslint-plugin 2.3.2
801
+ - @typescript-eslint/eslint-plugin 2.5.0
789
802
  - eslint-plugin-babel 5.3.0
790
803
  - eslint-plugin-flowtype 4.3.0
791
804
  - eslint-plugin-react 7.16.0
792
805
  - eslint-plugin-standard 4.0.1
793
- - eslint-plugin-unicorn 12.0.2
806
+ - eslint-plugin-unicorn 12.1.0
794
807
  - eslint-plugin-vue 5.2.3
795
808
 
796
809
  Have new rules been added since those versions? Have we missed any rules? Is
package/index.js CHANGED
@@ -1,93 +1,103 @@
1
1
  "use strict";
2
2
 
3
+ const includeDeprecated = !process.env.ESLINT_CONFIG_PRETTIER_NO_DEPRECATED;
4
+
3
5
  module.exports = {
4
- rules: {
5
- // The following rules can be used in some cases. See the README for more
6
- // information. (These are marked with `0` instead of `"off"` so that a
7
- // script can distinguish them.)
8
- "arrow-body-style": 0,
9
- curly: 0,
10
- "lines-around-comment": 0,
11
- "max-len": 0,
12
- "no-confusing-arrow": 0,
13
- "no-mixed-operators": 0,
14
- "no-tabs": 0,
15
- "no-unexpected-multiline": 0,
16
- "prefer-arrow-callback": 0,
17
- quotes: 0,
18
- // The rest are rules that you never need to enable when using Prettier.
19
- "array-bracket-newline": "off",
20
- "array-bracket-spacing": "off",
21
- "array-element-newline": "off",
22
- "arrow-parens": "off",
23
- "arrow-spacing": "off",
24
- "block-spacing": "off",
25
- "brace-style": "off",
26
- "comma-dangle": "off",
27
- "comma-spacing": "off",
28
- "comma-style": "off",
29
- "computed-property-spacing": "off",
30
- "dot-location": "off",
31
- "eol-last": "off",
32
- "func-call-spacing": "off",
33
- "function-call-argument-newline": "off",
34
- "function-paren-newline": "off",
35
- "generator-star": "off",
36
- "generator-star-spacing": "off",
37
- "implicit-arrow-linebreak": "off",
38
- indent: "off",
39
- "indent-legacy": "off",
40
- "jsx-quotes": "off",
41
- "key-spacing": "off",
42
- "keyword-spacing": "off",
43
- "linebreak-style": "off",
44
- "multiline-ternary": "off",
45
- "newline-per-chained-call": "off",
46
- "new-parens": "off",
47
- "no-arrow-condition": "off",
48
- "no-comma-dangle": "off",
49
- "no-extra-parens": "off",
50
- "no-extra-semi": "off",
51
- "no-floating-decimal": "off",
52
- "no-mixed-spaces-and-tabs": "off",
53
- "no-multi-spaces": "off",
54
- "no-multiple-empty-lines": "off",
55
- "no-reserved-keys": "off",
56
- "no-space-before-semi": "off",
57
- "no-spaced-func": "off",
58
- "no-trailing-spaces": "off",
59
- "no-whitespace-before-property": "off",
60
- "no-wrap-func": "off",
61
- "nonblock-statement-body-position": "off",
62
- "object-curly-newline": "off",
63
- "object-curly-spacing": "off",
64
- "object-property-newline": "off",
65
- "one-var-declaration-per-line": "off",
66
- "operator-linebreak": "off",
67
- "padded-blocks": "off",
68
- "quote-props": "off",
69
- "rest-spread-spacing": "off",
70
- semi: "off",
71
- "semi-spacing": "off",
72
- "semi-style": "off",
73
- "space-after-function-name": "off",
74
- "space-after-keywords": "off",
75
- "space-before-blocks": "off",
76
- "space-before-function-paren": "off",
77
- "space-before-function-parentheses": "off",
78
- "space-before-keywords": "off",
79
- "space-in-brackets": "off",
80
- "space-in-parens": "off",
81
- "space-infix-ops": "off",
82
- "space-return-throw-case": "off",
83
- "space-unary-ops": "off",
84
- "space-unary-word-ops": "off",
85
- "switch-colon-spacing": "off",
86
- "template-curly-spacing": "off",
87
- "template-tag-spacing": "off",
88
- "unicode-bom": "off",
89
- "wrap-iife": "off",
90
- "wrap-regex": "off",
91
- "yield-star-spacing": "off"
92
- }
6
+ rules: Object.assign(
7
+ {
8
+ // The following rules can be used in some cases. See the README for more
9
+ // information. (These are marked with `0` instead of `"off"` so that a
10
+ // script can distinguish them.)
11
+ "arrow-body-style": 0,
12
+ curly: 0,
13
+ "lines-around-comment": 0,
14
+ "max-len": 0,
15
+ "no-confusing-arrow": 0,
16
+ "no-mixed-operators": 0,
17
+ "no-tabs": 0,
18
+ "no-unexpected-multiline": 0,
19
+ "prefer-arrow-callback": 0,
20
+ quotes: 0,
21
+ // The rest are rules that you never need to enable when using Prettier.
22
+ "array-bracket-newline": "off",
23
+ "array-bracket-spacing": "off",
24
+ "array-element-newline": "off",
25
+ "arrow-parens": "off",
26
+ "arrow-spacing": "off",
27
+ "block-spacing": "off",
28
+ "brace-style": "off",
29
+ "comma-dangle": "off",
30
+ "comma-spacing": "off",
31
+ "comma-style": "off",
32
+ "computed-property-spacing": "off",
33
+ "dot-location": "off",
34
+ "eol-last": "off",
35
+ "func-call-spacing": "off",
36
+ "function-call-argument-newline": "off",
37
+ "function-paren-newline": "off",
38
+ "generator-star": "off",
39
+ "generator-star-spacing": "off",
40
+ "implicit-arrow-linebreak": "off",
41
+ indent: "off",
42
+ "jsx-quotes": "off",
43
+ "key-spacing": "off",
44
+ "keyword-spacing": "off",
45
+ "linebreak-style": "off",
46
+ "multiline-ternary": "off",
47
+ "newline-per-chained-call": "off",
48
+ "new-parens": "off",
49
+ "no-arrow-condition": "off",
50
+ "no-comma-dangle": "off",
51
+ "no-extra-parens": "off",
52
+ "no-extra-semi": "off",
53
+ "no-floating-decimal": "off",
54
+ "no-mixed-spaces-and-tabs": "off",
55
+ "no-multi-spaces": "off",
56
+ "no-multiple-empty-lines": "off",
57
+ "no-reserved-keys": "off",
58
+ "no-space-before-semi": "off",
59
+ "no-trailing-spaces": "off",
60
+ "no-whitespace-before-property": "off",
61
+ "no-wrap-func": "off",
62
+ "nonblock-statement-body-position": "off",
63
+ "object-curly-newline": "off",
64
+ "object-curly-spacing": "off",
65
+ "object-property-newline": "off",
66
+ "one-var-declaration-per-line": "off",
67
+ "operator-linebreak": "off",
68
+ "padded-blocks": "off",
69
+ "quote-props": "off",
70
+ "rest-spread-spacing": "off",
71
+ semi: "off",
72
+ "semi-spacing": "off",
73
+ "semi-style": "off",
74
+ "space-after-function-name": "off",
75
+ "space-after-keywords": "off",
76
+ "space-before-blocks": "off",
77
+ "space-before-function-paren": "off",
78
+ "space-before-function-parentheses": "off",
79
+ "space-before-keywords": "off",
80
+ "space-in-brackets": "off",
81
+ "space-in-parens": "off",
82
+ "space-infix-ops": "off",
83
+ "space-return-throw-case": "off",
84
+ "space-unary-ops": "off",
85
+ "space-unary-word-ops": "off",
86
+ "switch-colon-spacing": "off",
87
+ "template-curly-spacing": "off",
88
+ "template-tag-spacing": "off",
89
+ "unicode-bom": "off",
90
+ "wrap-iife": "off",
91
+ "wrap-regex": "off",
92
+ "yield-star-spacing": "off"
93
+ },
94
+ includeDeprecated && {
95
+ // Deprecated since version 4.0.0.
96
+ // https://github.com/eslint/eslint/pull/8286
97
+ "indent-legacy": "off",
98
+ // Deprecated since version 3.3.0.
99
+ // https://eslint.org/docs/rules/no-spaced-func
100
+ "no-spaced-func": "off"
101
+ }
102
+ )
93
103
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-config-prettier",
3
- "version": "6.4.0",
3
+ "version": "6.5.0",
4
4
  "license": "MIT",
5
5
  "author": "Simon Lydell",
6
6
  "description": "Turns off all rules that are unnecessary or might conflict with Prettier.",
@@ -29,6 +29,7 @@
29
29
  "test:lint": "eslint .",
30
30
  "test:lint-verify-fail": "eslint \"test-lint/*.{js,ts,vue}\" --config .eslintrc.base.js --format json",
31
31
  "test:lint-rules": "eslint index.js --config test-config/.eslintrc.js --format json",
32
+ "test:deprecated": "eslint-find-rules --deprecated index.js",
32
33
  "test:jest": "jest",
33
34
  "test:cli-sanity": "eslint --print-config index.js | node ./bin/cli.js",
34
35
  "test:cli-sanity-warning": "eslint --print-config ./bin/cli.js | node ./bin/cli.js",
@@ -38,25 +39,26 @@
38
39
  "get-stdin": "^6.0.0"
39
40
  },
40
41
  "devDependencies": {
41
- "@typescript-eslint/eslint-plugin": "2.3.2",
42
- "@typescript-eslint/parser": "2.3.2",
42
+ "@typescript-eslint/eslint-plugin": "2.5.0",
43
+ "@typescript-eslint/parser": "2.5.0",
43
44
  "babel-eslint": "10.0.3",
44
45
  "cross-spawn": "6.0.5",
45
46
  "doctoc": "1.4.0",
46
- "eslint": "6.5.1",
47
+ "eslint": "6.6.0",
47
48
  "eslint-config-google": "0.14.0",
49
+ "eslint-find-rules": "3.4.0",
48
50
  "eslint-plugin-babel": "5.3.0",
49
51
  "eslint-plugin-flowtype": "4.3.0",
50
52
  "eslint-plugin-prettier": "3.1.1",
51
53
  "eslint-plugin-react": "7.16.0",
52
54
  "eslint-plugin-standard": "4.0.1",
53
- "eslint-plugin-unicorn": "12.0.2",
55
+ "eslint-plugin-unicorn": "12.1.0",
54
56
  "eslint-plugin-vue": "5.2.3",
55
57
  "jest": "24.9.0",
56
58
  "prettier": "1.18.2",
57
59
  "replace": "1.1.1",
58
60
  "rimraf": "3.0.0",
59
- "typescript": "3.6.3"
61
+ "typescript": "3.6.4"
60
62
  },
61
63
  "peerDependencies": {
62
64
  "eslint": ">=3.14.1"
package/react.js CHANGED
@@ -1,21 +1,29 @@
1
1
  "use strict";
2
2
 
3
+ const includeDeprecated = !process.env.ESLINT_CONFIG_PRETTIER_NO_DEPRECATED;
4
+
3
5
  module.exports = {
4
- rules: {
5
- "react/jsx-child-element-spacing": "off",
6
- "react/jsx-closing-bracket-location": "off",
7
- "react/jsx-closing-tag-location": "off",
8
- "react/jsx-curly-newline": "off",
9
- "react/jsx-curly-spacing": "off",
10
- "react/jsx-equals-spacing": "off",
11
- "react/jsx-first-prop-new-line": "off",
12
- "react/jsx-indent": "off",
13
- "react/jsx-indent-props": "off",
14
- "react/jsx-max-props-per-line": "off",
15
- "react/jsx-one-expression-per-line": "off",
16
- "react/jsx-props-no-multi-spaces": "off",
17
- "react/jsx-space-before-closing": "off",
18
- "react/jsx-tag-spacing": "off",
19
- "react/jsx-wrap-multilines": "off"
20
- }
6
+ rules: Object.assign(
7
+ {
8
+ "react/jsx-child-element-spacing": "off",
9
+ "react/jsx-closing-bracket-location": "off",
10
+ "react/jsx-closing-tag-location": "off",
11
+ "react/jsx-curly-newline": "off",
12
+ "react/jsx-curly-spacing": "off",
13
+ "react/jsx-equals-spacing": "off",
14
+ "react/jsx-first-prop-new-line": "off",
15
+ "react/jsx-indent": "off",
16
+ "react/jsx-indent-props": "off",
17
+ "react/jsx-max-props-per-line": "off",
18
+ "react/jsx-one-expression-per-line": "off",
19
+ "react/jsx-props-no-multi-spaces": "off",
20
+ "react/jsx-tag-spacing": "off",
21
+ "react/jsx-wrap-multilines": "off"
22
+ },
23
+ includeDeprecated && {
24
+ // Deprecated since version 7.0.0.
25
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/CHANGELOG.md#700---2017-05-06
26
+ "react/jsx-space-before-closing": "off"
27
+ }
28
+ )
21
29
  };