eslint-config-prettier 5.1.0 → 6.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.
@@ -2,6 +2,9 @@
2
2
 
3
3
  module.exports = {
4
4
  rules: {
5
+ "@typescript-eslint/quotes": 0,
6
+
7
+ "@typescript-eslint/brace-style": "off",
5
8
  "@typescript-eslint/func-call-spacing": "off",
6
9
  "@typescript-eslint/indent": "off",
7
10
  "@typescript-eslint/member-delimiter-style": "off",
package/CHANGELOG.md CHANGED
@@ -1,3 +1,53 @@
1
+ ### Version 6.3.0 (2019-09-10)
2
+
3
+ - Added: [@typescript-eslint/brace-style]. Thanks to Masafumi Koba
4
+ (@ybiquitous)!
5
+
6
+ ### Version 6.2.0 (2019-09-03)
7
+
8
+ - Added: [@typescript-eslint/quotes] (as a [special
9
+ rule][@typescript-eslint/quotes-special]). Thanks to Masafumi Koba
10
+ (@ybiquitous)!
11
+
12
+ ### Version 6.1.0 (2019-08-19)
13
+
14
+ - Added: [function-call-argument-newline] \(new in ESLint 6.2.0). Thanks to
15
+ Masafumi Koba (@ybiquitous)!
16
+
17
+ ### Version 6.0.0 (2019-06-25)
18
+
19
+ - Changed: The CLI helper tool now considers [no-confusing-arrow] to conflict
20
+ if you use the default value of its `allowParens` option. The default was
21
+ changed to `true` in ESLint 6, which conflicts with Prettier.
22
+
23
+ If the CLI helper tool gives you errors about this after upgrading, the
24
+ solution is to change this:
25
+
26
+ ```json
27
+ {
28
+ "rules": {
29
+ "no-confusing-arrow": ["error"]
30
+ }
31
+ }
32
+ ```
33
+
34
+ Into this:
35
+
36
+ ```json
37
+ {
38
+ "rules": {
39
+ "no-confusing-arrow": ["error", { "allowParens": false }]
40
+ }
41
+ }
42
+ ```
43
+
44
+ The latter works in both ESLint 6 as well as in ESLint 5 and older.
45
+
46
+ - Improved: `eslint --print-config` usage instructions. The CLI tool help
47
+ text as well as the documentation has been updated to suggest commands that
48
+ work in ESLint 6.0 as well as in ESLint 5 and older. (Instead of `eslint
49
+ --print-config .`, use `eslint --print-config path/to/main.js`.)
50
+
1
51
  ### Version 5.1.0 (2019-06-25)
2
52
 
3
53
  - Added: [react/jsx-curly-newline]. Thanks to Masafumi Koba (@ybiquitous)!
@@ -251,9 +301,12 @@
251
301
 
252
302
  - Initial release.
253
303
 
304
+ [@typescript-eslint/brace-style]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/brace-style.md
254
305
  [@typescript-eslint/eslint-plugin]: https://github.com/typescript-eslint/typescript-eslint
255
306
  [@typescript-eslint/func-call-spacing]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/func-call-spacing.md
256
307
  [@typescript-eslint/no-extra-parens]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-extra-parens.md
308
+ [@typescript-eslint/quotes-special]: https://github.com/prettier/eslint-config-prettier/blob/857257179fe69715362dfa9300762d6e534c0603/README.md#quotes
309
+ [@typescript-eslint/quotes]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/quotes.md
257
310
  [@typescript-eslint/semi]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/semi.md
258
311
  [array-bracket-newline]: https://eslint.org/docs/rules/array-bracket-newline
259
312
  [array-element-newline]: https://eslint.org/docs/rules/array-element-newline
@@ -263,6 +316,7 @@
263
316
  [end-of-line]: https://prettier.io/docs/en/options.html#end-of-line
264
317
  [ESLint 4.0.0]: https://eslint.org/blog/2017/06/eslint-v4.0.0-released
265
318
  [ESLint 4.6.0]: https://eslint.org/blog/2017/09/eslint-v4.6.0-released
319
+ [eslint-plugin-babel]: https://github.com/babel/eslint-plugin-babel
266
320
  [eslint-plugin-flowtype]: https://github.com/gajus/eslint-plugin-flowtype
267
321
  [eslint-plugin-prettier]: https://github.com/prettier/eslint-plugin-prettier
268
322
  [eslint-plugin-react]: https://github.com/yannickcr/eslint-plugin-react
@@ -271,6 +325,7 @@
271
325
  [eslint-plugin-unicorn]: https://github.com/sindresorhus/eslint-plugin-unicorn
272
326
  [eslint-plugin-vue]: https://github.com/vuejs/eslint-plugin-vue
273
327
  [flowtype/boolean-style]: https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-boolean-style
328
+ [function-call-argument-newline]: https://eslint.org/docs/rules/function-call-argument-newline
274
329
  [function-paren-newline]: https://eslint.org/docs/rules/function-paren-newline
275
330
  [implicit-arrow-linebreak]: https://eslint.org/docs/rules/implicit-arrow-linebreak
276
331
  [indent-legacy]: https://eslint.org/docs/rules/indent-legacy
@@ -293,7 +348,7 @@
293
348
  [quotes]: https://eslint.org/docs/rules/quotes
294
349
  [react/jsx-child-element-spacing]: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-child-element-spacing.md
295
350
  [react/jsx-closing-tag-location]: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-closing-tag-location.md
296
- [react/jsx-curly-newline]: [react/jsx-curly-newline]
351
+ [react/jsx-curly-newline]: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-newline.md
297
352
  [react/jsx-one-expression-per-line]: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-one-expression-per-line.md
298
353
  [react/jsx-props-no-multi-spaces]: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-props-no-multi-spaces.md
299
354
  [react/self-closing-comp]: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/self-closing-comp.md
package/README.md CHANGED
@@ -119,19 +119,27 @@ First, add a script for it to package.json:
119
119
  ```json
120
120
  {
121
121
  "scripts": {
122
- "eslint-check": "eslint --print-config . | eslint-config-prettier-check"
122
+ "eslint-check": "eslint --print-config path/to/main.js | eslint-config-prettier-check"
123
123
  }
124
124
  }
125
125
  ```
126
126
 
127
- Then run `npm run eslint-check`.
127
+ Then run `npm run eslint-check`. (Change `path/to/main.js` to a file that
128
+ exists in your project.)
128
129
 
129
- If you use [multiple configuration files] or [overrides], you may need to run
130
- the above script several times with different `--print-config` arguments, such
131
- as:
130
+ In theory you need to run `eslint --print-config file.js |
131
+ eslint-config-prettier-check` for every single file in your project to be
132
+ 100% sure that there are no conflicting rules, because ESLint supports having
133
+ different rules for different files. But usually you’ll have about the same
134
+ rules for all files, so it is enough to run the command on one file (pick one
135
+ that you won’t be moving). If you use [multiple configuration files] or
136
+ [overrides], you can (but you probably don’t need to!) run the above script
137
+ several times with different `--print-config` arguments, such as:
132
138
 
133
139
  ```
140
+ eslint --print-config index.js | eslint-config-prettier-check
134
141
  eslint --print-config test/index.js | eslint-config-prettier-check
142
+ eslint --print-config legacy/main.js | eslint-config-prettier-check
135
143
  ```
136
144
 
137
145
  Exit codes:
@@ -365,22 +373,14 @@ For example, the rule could warn about this line:
365
373
  var x = a => 1 ? 2 : 3;
366
374
  ```
367
375
 
368
- By default, ESLint suggests switching to an explicit return:
369
-
370
- ```js
371
- var x = a => { return 1 ? 2 : 3; };
372
- ```
373
-
374
- That causes no problems with Prettier.
375
-
376
- With `{allowParens: true}`, adding parentheses is also considered a valid way to
377
- avoid the arrow confusion:
376
+ With `{allowParens: true}` (the default since ESLint 6.0.0), adding
377
+ parentheses is considered a valid way to avoid the arrow confusion:
378
378
 
379
379
  ```js
380
380
  var x = a => (1 ? 2 : 3);
381
381
  ```
382
382
 
383
- While Prettier keeps thoses parentheses, it removes them if the line is long
383
+ While Prettier keeps those parentheses, it removes them if the line is long
384
384
  enough to introduce a line break:
385
385
 
386
386
  ```js
@@ -388,6 +388,15 @@ EnterpriseCalculator.prototype.calculateImportantNumbers = inputNumber =>
388
388
  1 ? 2 : 3;
389
389
  ```
390
390
 
391
+ With `{allowParens: false}`, ESLint instead suggests switching to an explicit
392
+ return:
393
+
394
+ ```js
395
+ var x = a => { return 1 ? 2 : 3; };
396
+ ```
397
+
398
+ That causes no problems with Prettier.
399
+
391
400
  If you like this rule, it can be used just fine with Prettier as long as the
392
401
  `allowParens` option is off.
393
402
 
@@ -396,11 +405,18 @@ Example ESLint configuration:
396
405
  ```json
397
406
  {
398
407
  "rules": {
399
- "no-confusing-arrow": "error"
408
+ "no-confusing-arrow": ["error", { "allowParens": false }]
400
409
  }
401
410
  }
402
411
  ```
403
412
 
413
+ (Note: The CLI helper tool considers `{allowParens: true}` to be the default,
414
+ which is the case since ESLint 6.0.0. The tool will produce a warning if you
415
+ use the default even if you use an older version of ESLint. It doesn’t hurt
416
+ to explicitly set `{allowParens: false}` even though it is technically
417
+ redundant. This way you are prepared for a future ESLint upgrade and the CLI
418
+ tool can be kept simple.)
419
+
404
420
  ### [no-mixed-operators]
405
421
 
406
422
  **This rule requires special attention when writing code.**
@@ -559,7 +575,7 @@ Example configuration:
559
575
 
560
576
  ### [quotes]
561
577
 
562
- (The following applies to [babel/quotes] as well.)
578
+ (The following applies to [babel/quotes] and [@typescript-eslint/quotes] as well.)
563
579
 
564
580
  **This rule requires certain options and certain Prettier options.**
565
581
 
@@ -764,16 +780,17 @@ You can also supply a custom message if you want:
764
780
 
765
781
  eslint-config-prettier has been tested with:
766
782
 
767
- - ESLint 5.16.0
783
+ - ESLint 6.3.0
784
+ - eslint-config-prettier 5.1.0 and older were tested with ESLint 5.x
768
785
  - eslint-config-prettier 2.10.0 and older were tested with ESLint 4.x
769
786
  - eslint-config-prettier 2.1.1 and older were tested with ESLint 3.x
770
787
  - prettier 1.18.2
771
- - @typescript-eslint/eslint-plugin 1.11.0
788
+ - @typescript-eslint/eslint-plugin 2.2.0
772
789
  - eslint-plugin-babel 5.3.0
773
- - eslint-plugin-flowtype 3.11.1
774
- - eslint-plugin-react 7.14.2
775
- - eslint-plugin-standard 4.0.0
776
- - eslint-plugin-unicorn 9.1.1
790
+ - eslint-plugin-flowtype 4.3.0
791
+ - eslint-plugin-react 7.14.3
792
+ - eslint-plugin-standard 4.0.1
793
+ - eslint-plugin-unicorn 10.0.0
777
794
  - eslint-plugin-vue 5.2.3
778
795
 
779
796
  Have new rules been added since those versions? Have we missed any rules? Is
@@ -841,6 +858,7 @@ several other npm scripts:
841
858
  [MIT](LICENSE).
842
859
 
843
860
  [@typescript-eslint/eslint-plugin]: https://github.com/typescript-eslint/typescript-eslint
861
+ [@typescript-eslint/quotes]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/quotes.md
844
862
  [ESlint 5.7.0]: https://eslint.org/blog/2018/10/eslint-v5.7.0-released
845
863
  [Prettier]: https://github.com/prettier/prettier
846
864
  [arrow-body-style]: https://eslint.org/docs/rules/arrow-body-style
package/bin/cli.js CHANGED
@@ -17,7 +17,7 @@ if (module === require.main) {
17
17
  "This tool checks whether an ESLint configuration contains rules that are",
18
18
  "unnecessary or conflict with Prettier. It’s supposed to be run like this:",
19
19
  "",
20
- " eslint --print-config . | eslint-config-prettier-check",
20
+ " eslint --print-config path/to/main.js | eslint-config-prettier-check",
21
21
  " eslint --print-config test/index.js | eslint-config-prettier-check",
22
22
  "",
23
23
  "Exit codes:",
package/bin/validators.js CHANGED
@@ -32,11 +32,11 @@ module.exports = {
32
32
 
33
33
  "no-confusing-arrow"(options) {
34
34
  if (options.length === 0) {
35
- return true;
35
+ return false;
36
36
  }
37
37
 
38
38
  const firstOption = options[0];
39
- return !(firstOption && firstOption.allowParens);
39
+ return firstOption ? firstOption.allowParens === false : false;
40
40
  },
41
41
 
42
42
  "vue/html-self-closing"(options) {
package/index.js CHANGED
@@ -30,6 +30,7 @@ module.exports = {
30
30
  "dot-location": "off",
31
31
  "eol-last": "off",
32
32
  "func-call-spacing": "off",
33
+ "function-call-argument-newline": "off",
33
34
  "function-paren-newline": "off",
34
35
  "generator-star": "off",
35
36
  "generator-star-spacing": "off",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-config-prettier",
3
- "version": "5.1.0",
3
+ "version": "6.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.",
@@ -30,7 +30,7 @@
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
32
  "test:jest": "jest",
33
- "test:cli-sanity": "eslint --print-config . | node ./bin/cli.js",
33
+ "test:cli-sanity": "eslint --print-config index.js | node ./bin/cli.js",
34
34
  "test:cli-sanity-warning": "eslint --print-config ./bin/cli.js | node ./bin/cli.js",
35
35
  "test": "npm run test:lint && npm run test:jest && npm run test:cli-sanity && npm run test:cli-sanity-warning"
36
36
  },
@@ -38,25 +38,25 @@
38
38
  "get-stdin": "^6.0.0"
39
39
  },
40
40
  "devDependencies": {
41
- "@typescript-eslint/eslint-plugin": "1.11.0",
42
- "@typescript-eslint/parser": "1.11.0",
43
- "babel-eslint": "10.0.2",
41
+ "@typescript-eslint/eslint-plugin": "2.2.0",
42
+ "@typescript-eslint/parser": "2.2.0",
43
+ "babel-eslint": "10.0.3",
44
44
  "cross-spawn": "6.0.5",
45
45
  "doctoc": "1.4.0",
46
- "eslint": "5.16.0",
47
- "eslint-config-google": "0.13.0",
46
+ "eslint": "6.3.0",
47
+ "eslint-config-google": "0.14.0",
48
48
  "eslint-plugin-babel": "5.3.0",
49
- "eslint-plugin-flowtype": "3.11.1",
49
+ "eslint-plugin-flowtype": "4.3.0",
50
50
  "eslint-plugin-prettier": "3.1.0",
51
- "eslint-plugin-react": "7.14.2",
52
- "eslint-plugin-standard": "4.0.0",
53
- "eslint-plugin-unicorn": "9.1.1",
51
+ "eslint-plugin-react": "7.14.3",
52
+ "eslint-plugin-standard": "4.0.1",
53
+ "eslint-plugin-unicorn": "10.0.0",
54
54
  "eslint-plugin-vue": "5.2.3",
55
- "jest": "24.8.0",
55
+ "jest": "24.9.0",
56
56
  "prettier": "1.18.2",
57
- "replace": "1.1.0",
58
- "rimraf": "2.6.3",
59
- "typescript": "3.5.2"
57
+ "replace": "1.1.1",
58
+ "rimraf": "3.0.0",
59
+ "typescript": "3.6.2"
60
60
  },
61
61
  "peerDependencies": {
62
62
  "eslint": ">=3.14.1"