eslint-config-prettier 3.6.0 → 4.3.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.
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ module.exports = {
4
+ rules: {
5
+ "@typescript-eslint/func-call-spacing": "off",
6
+ "@typescript-eslint/indent": "off",
7
+ "@typescript-eslint/member-delimiter-style": "off",
8
+ "@typescript-eslint/no-extra-parens": "off",
9
+ "@typescript-eslint/semi": "off",
10
+ "@typescript-eslint/type-annotation-spacing": "off"
11
+ }
12
+ };
package/CHANGELOG.md CHANGED
@@ -1,3 +1,33 @@
1
+ ### Version 4.3.0 (2019-05-16)
2
+
3
+ - Added: New [eslint-plugin-vue] rules: [vue/arrow-spacing],
4
+ [vue/block-spacing], [vue/brace-style] and [vue/comma-dangle].
5
+ - Added: New [@typescript-eslint/eslint-plugin] rules:
6
+ [@typescript-eslint/func-call-spacing] and [@typescript-eslint/semi].
7
+
8
+ ### Version 4.2.0 (2019-04-25)
9
+
10
+ - Added: [@typescript-eslint/no-extra-parens]. Thanks to Keiichiro Amemiya
11
+ (@Hoishin) and Jen Gorfine (@jgorfine)!
12
+
13
+ ### Version 4.1.0 (2019-02-26)
14
+
15
+ - Added: [linebreak-style]. Use Prettier’s [end-of-line] option instead.
16
+ - Added: [self-closing-comp]. Thanks to Gaurav Gupta (@gaurav5430)!
17
+
18
+ ### Version 4.0.0 (2019-01-26)
19
+
20
+ - Breaking change: Support for [eslint-plugin-typescript] has been removed and
21
+ replaced with support for its successor [@typescript-eslint/eslint-plugin].
22
+ Thanks to TANIGUCHI Masaya (@ta2gch) and everyone else who helped with this!
23
+ - Changed: [arrow-body-style] and [prefer-arrow-callback] are now marked as
24
+ [special rules][arrow-special], since they might cause problems if using
25
+ [eslint-plugin-prettier] and `--fix`. They are turned off by default, and the
26
+ CLI helper tool will _warn_ about them (but not error if you do enable them).
27
+ This won’t break your linting checks, but do note that these rules will be
28
+ disabled unless you explicitly enable them again, and that you might see new
29
+ warnings when running the CLI helper tool.
30
+
1
31
  ### Version 3.6.0 (2019-01-19)
2
32
 
3
33
  - Added: Support for [eslint-plugin-babel]. Thanks to Matija Marohnić
@@ -194,12 +224,20 @@
194
224
 
195
225
  - Initial release.
196
226
 
227
+ [@typescript-eslint/eslint-plugin]: https://github.com/typescript-eslint/typescript-eslint
228
+ [@typescript-eslint/func-call-spacing]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/func-call-spacing.md
229
+ [@typescript-eslint/no-extra-parens]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-extra-parens.md
230
+ [@typescript-eslint/semi]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/semi.md
197
231
  [ESLint 4.0.0]: https://eslint.org/blog/2017/06/eslint-v4.0.0-released
198
232
  [ESLint 4.6.0]: https://eslint.org/blog/2017/09/eslint-v4.6.0-released
199
233
  [array-bracket-newline]: https://eslint.org/docs/rules/array-bracket-newline
200
234
  [array-element-newline]: https://eslint.org/docs/rules/array-element-newline
235
+ [arrow-body-style]: https://eslint.org/docs/rules/arrow-body-style
236
+ [arrow-special]: https://github.com/prettier/eslint-config-prettier/blob/2c842675e55b91aecaef6f997d234ebf2d220ffb/README.md#arrow-body-style-and-prefer-arrow-callback
201
237
  [curly]: https://eslint.org/docs/rules/curly
238
+ [end-of-line]: https://prettier.io/docs/en/options.html#end-of-line
202
239
  [eslint-plugin-flowtype]: https://github.com/gajus/eslint-plugin-flowtype
240
+ [eslint-plugin-prettier]: https://github.com/prettier/eslint-plugin-prettier
203
241
  [eslint-plugin-react]: https://github.com/yannickcr/eslint-plugin-react
204
242
  [eslint-plugin-standard]: https://github.com/xjamundx/eslint-plugin-standard
205
243
  [eslint-plugin-typescript]: https://github.com/bradzacher/eslint-plugin-typescript
@@ -209,6 +247,7 @@
209
247
  [function-paren-newline]: https://eslint.org/docs/rules/function-paren-newline
210
248
  [implicit-arrow-linebreak]: https://eslint.org/docs/rules/implicit-arrow-linebreak
211
249
  [indent-legacy]: https://eslint.org/docs/rules/indent-legacy
250
+ [linebreak-style]: https://eslint.org/docs/rules/linebreak-style
212
251
  [lines-around-comment-special]: https://github.com/prettier/eslint-config-prettier/blob/5399175c37466747aae9d407021dffec2c169c8b/README.md#lines-around-comment
213
252
  [lines-around-comment]: https://eslint.org/docs/rules/lines-around-comment
214
253
  [no-confusing-arrow-special]: https://github.com/prettier/eslint-config-prettier/blob/08ac5bcc25c9cdc71864b4a1e4191e7d28dd2bc2/README.md#no-confusing-arrow
@@ -220,15 +259,21 @@
220
259
  [no-unexpected-multiline]: https://eslint.org/docs/rules/no-unexpected-multiline
221
260
  [nonblock-statement-body-position]: https://eslint.org/docs/rules/nonblock-statement-body-position
222
261
  [one-var-declaration-per-line]: https://eslint.org/docs/rules/one-var-declaration-per-line
262
+ [prefer-arrow-callback]: https://eslint.org/docs/rules/prefer-arrow-callback
223
263
  [prettier]: https://github.com/prettier
224
- [quotes]: https://eslint.org/docs/rules/quotes
225
264
  [quotes-special]: https://github.com/prettier/eslint-config-prettier/blob/8d264cd0a7f06c12e2e05415e0282a4f8f21ebc9/README.md#quotes
265
+ [quotes]: https://eslint.org/docs/rules/quotes
226
266
  [react/jsx-child-element-spacing]: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-child-element-spacing.md
227
267
  [react/jsx-closing-tag-location]: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-closing-tag-location.md
228
268
  [react/jsx-one-expression-per-line]: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-one-expression-per-line.md
229
269
  [react/jsx-props-no-multi-spaces]: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-props-no-multi-spaces.md
270
+ [self-closing-comp]: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/self-closing-comp.md
230
271
  [semi-style]: https://eslint.org/docs/rules/semi-style
231
272
  [switch-colon-spacing]: https://eslint.org/docs/rules/switch-colon-spacing
232
273
  [template-tag-spacing]: https://eslint.org/docs/rules/template-tag-spacing
233
- [vue/html-self-closing]: https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/html-self-closing.md
274
+ [vue/arrow-spacing]: https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/arrow-spacing.md
275
+ [vue/block-spacing]: https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/block-spacing.md
276
+ [vue/brace-style]: https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/brace-style.md
277
+ [vue/comma-dangle]: https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/comma-dangle.md
234
278
  [vue/html-self-closing-special]: https://github.com/prettier/eslint-config-prettier/blob/d5e7af986221df5faedc12893d8dc3150a808693/README.md#vuehtml-self-closing
279
+ [vue/html-self-closing]: https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/html-self-closing.md
package/README.md CHANGED
@@ -18,6 +18,7 @@ it together with some other config.
18
18
  - [CLI helper tool](#cli-helper-tool)
19
19
  - [Example configuration](#example-configuration)
20
20
  - [Special rules](#special-rules)
21
+ - [arrow-body-style and prefer-arrow-callback](#arrow-body-style-and-prefer-arrow-callback)
21
22
  - [curly](#curly)
22
23
  - [lines-around-comment](#lines-around-comment)
23
24
  - [max-len](#max-len)
@@ -64,11 +65,11 @@ configs.
64
65
 
65
66
  A few ESLint plugins are supported as well:
66
67
 
68
+ - [@typescript-eslint/eslint-plugin]
67
69
  - [eslint-plugin-babel]
68
70
  - [eslint-plugin-flowtype]
69
71
  - [eslint-plugin-react]
70
72
  - [eslint-plugin-standard]
71
- - [eslint-plugin-typescript]
72
73
  - [eslint-plugin-unicorn]
73
74
  - [eslint-plugin-vue]
74
75
 
@@ -79,17 +80,34 @@ Add extra exclusions for the plugins you use like so:
79
80
  "extends": [
80
81
  "some-other-config-you-use",
81
82
  "prettier",
83
+ "prettier/@typescript-eslint",
82
84
  "prettier/babel",
83
85
  "prettier/flowtype",
84
86
  "prettier/react",
85
87
  "prettier/standard",
86
- "prettier/typescript",
87
88
  "prettier/unicorn",
88
89
  "prettier/vue"
89
90
  ]
90
91
  }
91
92
  ```
92
93
 
94
+ If you extend a config which uses a plugin, it is recommended to add
95
+ `"prettier/that-plugin"` (if available). For example, [eslint-config-airbnb]
96
+ enables [eslint-plugin-react] rules, so `"prettier/react"` is needed:
97
+
98
+ ```json
99
+ {
100
+ "extends": [
101
+ "airbnb",
102
+ "prettier",
103
+ "prettier/react"
104
+ ]
105
+ }
106
+ ```
107
+
108
+ If you’re unsure which plugins are used, you can usually find them in your
109
+ `package.json`.
110
+
93
111
  ## CLI helper tool
94
112
 
95
113
  eslint-config-prettier also ships with a little CLI tool to help you check if
@@ -128,27 +146,27 @@ Exit codes:
128
146
  {
129
147
  "extends": [
130
148
  "standard",
149
+ "plugin:@typescript-eslint/recommended",
131
150
  "plugin:flowtype/recommended",
132
151
  "plugin:react/recommended",
133
- "plugin:typescript/recommended",
134
152
  "plugin:unicorn/recommended",
135
153
  "plugin:vue/recommended",
136
154
  "prettier",
155
+ "prettier/@typescript-eslint",
137
156
  "prettier/babel",
138
157
  "prettier/flowtype",
139
158
  "prettier/react",
140
159
  "prettier/standard",
141
- "prettier/typescript",
142
160
  "prettier/unicorn",
143
161
  "prettier/vue"
144
162
  ],
145
163
  "plugins": [
164
+ "@typescript-eslint",
146
165
  "babel",
147
166
  "flowtype",
148
- "react",
149
167
  "prettier",
168
+ "react",
150
169
  "standard",
151
- "typescript",
152
170
  "unicorn",
153
171
  "vue"
154
172
  ],
@@ -177,10 +195,44 @@ enabled in some cases.
177
195
  - Some require special attention when writing code. The CLI helper tool warns
178
196
  you if any of those rules are enabled, but can’t tell if anything is
179
197
  problematic.
198
+ - Some can cause problems if using [eslint-plugin-prettier] and `--fix`.
180
199
 
181
200
  For maximum ease of use, the special rules are disabled by default. If you want
182
201
  them, you need to explicitly specify them in your ESLint config.
183
202
 
203
+ ### [arrow-body-style] and [prefer-arrow-callback]
204
+
205
+ **These rules might cause problems if using [eslint-plugin-prettier] and `--fix`.**
206
+
207
+ If you use any of these rules together with the `prettier/prettier` rule from
208
+ [eslint-plugin-prettier], you can in some cases end up with invalid code due to
209
+ a bug in ESLint’s autofix.
210
+
211
+ These rules are safe to use if:
212
+
213
+ - You don’t use [eslint-plugin-prettier]. In other words, you run `eslint --fix`
214
+ and `prettier --write` as separate steps.
215
+ - You _do_ use [eslint-plugin-prettier], but don’t use `--fix`. (But then,
216
+ what’s the point?)
217
+
218
+ You _can_ still use these rules together with [eslint-plugin-prettier] if you
219
+ want, because the bug does not occur _all the time._ But if you do, you need to
220
+ keep in mind that you might end up with invalid code, where you manually have to
221
+ insert a missing closing parenthesis to get going again.
222
+
223
+ If you’re fixing large of amounts of previously unformatted code, consider
224
+ temporarily disabling the `prettier/prettier` rule and running `eslint --fix`
225
+ and `prettier --write` separately.
226
+
227
+ See these issues for more information:
228
+
229
+ - [eslint-config-prettier#31]
230
+ - [eslint-config-prettier#71]
231
+ - [eslint-plugin-prettier#65]
232
+
233
+ When the autofix bug in ESLint has been fixed, the special case for these rules
234
+ can be removed.
235
+
184
236
  ### [curly]
185
237
 
186
238
  **This rule requires certain options.**
@@ -712,17 +764,17 @@ You can also supply a custom message if you want:
712
764
 
713
765
  eslint-config-prettier has been tested with:
714
766
 
715
- - ESLint 5.12.0
767
+ - ESLint 5.16.0
716
768
  - eslint-config-prettier 2.10.0 and older were tested with ESLint 4.x
717
769
  - eslint-config-prettier 2.1.1 and older were tested with ESLint 3.x
718
- - prettier 1.15.3
770
+ - prettier 1.17.1
771
+ - @typescript-eslint/eslint-plugin 1.9.0
719
772
  - eslint-plugin-babel 5.3.0
720
- - eslint-plugin-flowtype 3.2.1
721
- - eslint-plugin-react 7.12.4
773
+ - eslint-plugin-flowtype 3.9.0
774
+ - eslint-plugin-react 7.13.0
722
775
  - eslint-plugin-standard 4.0.0
723
- - eslint-plugin-typescript 1.0.0-rc.1
724
- - eslint-plugin-unicorn 7.0.0
725
- - eslint-plugin-vue 5.1.0
776
+ - eslint-plugin-unicorn 8.0.2
777
+ - eslint-plugin-vue 5.2.2
726
778
 
727
779
  Have new rules been added since those versions? Have we missed any rules? Is
728
780
  there a plugin you would like to see exclusions for? Open an issue or a pull
@@ -788,16 +840,21 @@ several other npm scripts:
788
840
 
789
841
  [MIT](LICENSE).
790
842
 
843
+ [@typescript-eslint/eslint-plugin]: https://github.com/typescript-eslint/typescript-eslint
791
844
  [ESlint 5.7.0]: https://eslint.org/blog/2018/10/eslint-v5.7.0-released
792
845
  [Prettier]: https://github.com/prettier/prettier
846
+ [arrow-body-style]: https://eslint.org/docs/rules/arrow-body-style
793
847
  [babel/quotes]: https://github.com/babel/eslint-plugin-babel#rules
794
848
  [curly]: https://eslint.org/docs/rules/curly
849
+ [eslint-config-airbnb]: https://www.npmjs.com/package/eslint-config-airbnb
850
+ [eslint-config-prettier#31]: https://github.com/prettier/eslint-config-prettier/issues/31
851
+ [eslint-config-prettier#71]: https://github.com/prettier/eslint-config-prettier/issues/71
795
852
  [eslint-plugin-babel]: https://github.com/babel/eslint-plugin-babel
796
853
  [eslint-plugin-flowtype]: https://github.com/gajus/eslint-plugin-flowtype
854
+ [eslint-plugin-prettier#65]: https://github.com/prettier/eslint-plugin-prettier/issues/65
797
855
  [eslint-plugin-prettier]: https://github.com/prettier/eslint-plugin-prettier
798
856
  [eslint-plugin-react]: https://github.com/yannickcr/eslint-plugin-react
799
857
  [eslint-plugin-standard]: https://github.com/xjamundx/eslint-plugin-standard
800
- [eslint-plugin-typescript]: https://github.com/bradzacher/eslint-plugin-typescript
801
858
  [eslint-plugin-unicorn]: https://github.com/sindresorhus/eslint-plugin-unicorn
802
859
  [eslint-plugin-vue]: https://github.com/vuejs/eslint-plugin-vue
803
860
  [lines-around-comment]: https://eslint.org/docs/rules/lines-around-comment
@@ -811,6 +868,7 @@ several other npm scripts:
811
868
  [no-tabs]: https://eslint.org/docs/rules/no-tabs
812
869
  [no-unexpected-multiline]: https://eslint.org/docs/rules/no-unexpected-multiline
813
870
  [overrides]: https://eslint.org/docs/user-guide/configuring#configuration-based-on-glob-patterns
871
+ [prefer-arrow-callback]: https://eslint.org/docs/rules/prefer-arrow-callback
814
872
  [quotes]: https://eslint.org/docs/rules/quotes
815
873
  [singleQuote]: https://prettier.io/docs/en/options.html#quotes
816
874
  [string formatting rules]: https://prettier.io/docs/en/rationale.html#strings
package/index.js CHANGED
@@ -5,6 +5,7 @@ module.exports = {
5
5
  // The following rules can be used in some cases. See the README for more
6
6
  // information. (These are marked with `0` instead of `"off"` so that a
7
7
  // script can distinguish them.)
8
+ "arrow-body-style": 0,
8
9
  curly: 0,
9
10
  "lines-around-comment": 0,
10
11
  "max-len": 0,
@@ -12,6 +13,7 @@ module.exports = {
12
13
  "no-mixed-operators": 0,
13
14
  "no-tabs": 0,
14
15
  "no-unexpected-multiline": 0,
16
+ "prefer-arrow-callback": 0,
15
17
  quotes: 0,
16
18
  // The rest are rules that you never need to enable when using Prettier.
17
19
  "array-bracket-newline": "off",
@@ -37,6 +39,7 @@ module.exports = {
37
39
  "jsx-quotes": "off",
38
40
  "key-spacing": "off",
39
41
  "keyword-spacing": "off",
42
+ "linebreak-style": "off",
40
43
  "multiline-ternary": "off",
41
44
  "newline-per-chained-call": "off",
42
45
  "new-parens": "off",
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "eslint-config-prettier",
3
- "version": "3.6.0",
3
+ "version": "4.3.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.",
7
7
  "repository": "prettier/eslint-config-prettier",
8
8
  "files": [
9
9
  "bin/",
10
+ "@typescript-eslint.js",
10
11
  "babel.js",
11
12
  "flowtype.js",
12
13
  "index.js",
13
14
  "react.js",
14
15
  "standard.js",
15
- "typescript.js",
16
16
  "unicorn.js",
17
17
  "vue.js"
18
18
  ],
@@ -25,7 +25,7 @@
25
25
  "prettier"
26
26
  ],
27
27
  "scripts": {
28
- "doctoc": "doctoc README.md && replace \"\\[(\\[[\\w/-]+\\])\\]\" \"\\$1\" README.md",
28
+ "doctoc": "doctoc README.md && replace \"\\[\\[([\\w/-]+)\\](?:([^\\[\\]]+)\\[([\\w/-]+)\\])?\\]\" \"[\\$1\\$2\\$3]\" README.md",
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",
@@ -38,24 +38,25 @@
38
38
  "get-stdin": "^6.0.0"
39
39
  },
40
40
  "devDependencies": {
41
+ "@typescript-eslint/eslint-plugin": "1.9.0",
42
+ "@typescript-eslint/parser": "1.9.0",
41
43
  "babel-eslint": "10.0.1",
42
44
  "cross-spawn": "6.0.5",
43
45
  "doctoc": "1.4.0",
44
- "eslint": "5.12.0",
45
- "eslint-config-google": "0.11.0",
46
+ "eslint": "5.16.0",
47
+ "eslint-config-google": "0.13.0",
46
48
  "eslint-plugin-babel": "5.3.0",
47
- "eslint-plugin-flowtype": "3.2.1",
48
- "eslint-plugin-prettier": "3.0.1",
49
- "eslint-plugin-react": "7.12.4",
49
+ "eslint-plugin-flowtype": "3.9.0",
50
+ "eslint-plugin-prettier": "3.1.0",
51
+ "eslint-plugin-react": "7.13.0",
50
52
  "eslint-plugin-standard": "4.0.0",
51
- "eslint-plugin-typescript": "1.0.0-rc.1",
52
- "eslint-plugin-unicorn": "7.0.0",
53
- "eslint-plugin-vue": "github:vuejs/eslint-plugin-vue#9c49dcc8ff792ec6798037bd6b7f4ac3d26fdf68",
54
- "jest": "23.6.0",
55
- "prettier": "1.15.3",
56
- "replace": "1.0.1",
53
+ "eslint-plugin-unicorn": "8.0.2",
54
+ "eslint-plugin-vue": "5.2.2",
55
+ "jest": "24.8.0",
56
+ "prettier": "1.17.1",
57
+ "replace": "1.1.0",
57
58
  "rimraf": "2.6.3",
58
- "typescript": "3.2.4"
59
+ "typescript": "3.4.5"
59
60
  },
60
61
  "peerDependencies": {
61
62
  "eslint": ">=3.14.1"
package/react.js CHANGED
@@ -15,6 +15,7 @@ module.exports = {
15
15
  "react/jsx-props-no-multi-spaces": "off",
16
16
  "react/jsx-space-before-closing": "off",
17
17
  "react/jsx-tag-spacing": "off",
18
- "react/jsx-wrap-multilines": "off"
18
+ "react/jsx-wrap-multilines": "off",
19
+ "react/self-closing-comp": "off"
19
20
  }
20
21
  };
package/vue.js CHANGED
@@ -5,6 +5,10 @@ module.exports = {
5
5
  "vue/html-self-closing": 0,
6
6
 
7
7
  "vue/array-bracket-spacing": "off",
8
+ "vue/arrow-spacing": "off",
9
+ "vue/block-spacing": "off",
10
+ "vue/brace-style": "off",
11
+ "vue/comma-dangle": "off",
8
12
  "vue/html-closing-bracket-newline": "off",
9
13
  "vue/html-closing-bracket-spacing": "off",
10
14
  "vue/html-end-tags": "off",
package/typescript.js DELETED
@@ -1,9 +0,0 @@
1
- "use strict";
2
-
3
- module.exports = {
4
- rules: {
5
- "typescript/indent": "off",
6
- "typescript/member-delimiter-style": "off",
7
- "typescript/type-annotation-spacing": "off"
8
- }
9
- };