eslint 5.13.0 → 5.15.1

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.
Files changed (148) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/README.md +68 -156
  3. package/lib/built-in-rules-index.js +1 -0
  4. package/lib/cli-engine.js +5 -2
  5. package/lib/config/config-file.js +27 -4
  6. package/lib/config/config-initializer.js +151 -144
  7. package/lib/config/config-ops.js +2 -0
  8. package/lib/config/config-validator.js +1 -1
  9. package/lib/config/plugins.js +1 -1
  10. package/lib/formatters/codeframe.js +1 -1
  11. package/lib/formatters/stylish.js +2 -2
  12. package/lib/linter.js +7 -4
  13. package/lib/rules/accessor-pairs.js +4 -2
  14. package/lib/rules/array-callback-return.js +4 -3
  15. package/lib/rules/arrow-body-style.js +1 -1
  16. package/lib/rules/arrow-parens.js +2 -1
  17. package/lib/rules/arrow-spacing.js +7 -6
  18. package/lib/rules/brace-style.js +2 -1
  19. package/lib/rules/camelcase.js +5 -4
  20. package/lib/rules/capitalized-comments.js +10 -14
  21. package/lib/rules/class-methods-use-this.js +1 -1
  22. package/lib/rules/comma-spacing.js +10 -4
  23. package/lib/rules/complexity.js +6 -7
  24. package/lib/rules/consistent-return.js +2 -1
  25. package/lib/rules/curly.js +1 -1
  26. package/lib/rules/default-case.js +2 -2
  27. package/lib/rules/dot-notation.js +7 -5
  28. package/lib/rules/eol-last.js +1 -1
  29. package/lib/rules/func-call-spacing.js +2 -2
  30. package/lib/rules/func-style.js +3 -2
  31. package/lib/rules/getter-return.js +3 -2
  32. package/lib/rules/handle-callback-err.js +1 -1
  33. package/lib/rules/id-length.js +3 -2
  34. package/lib/rules/id-match.js +7 -4
  35. package/lib/rules/indent-legacy.js +1 -1
  36. package/lib/rules/indent.js +9 -6
  37. package/lib/rules/jsx-quotes.js +2 -2
  38. package/lib/rules/key-spacing.js +1 -1
  39. package/lib/rules/keyword-spacing.js +14 -14
  40. package/lib/rules/line-comment-position.js +5 -4
  41. package/lib/rules/lines-around-comment.js +14 -14
  42. package/lib/rules/lines-between-class-members.js +2 -1
  43. package/lib/rules/max-depth.js +5 -5
  44. package/lib/rules/max-len.js +21 -14
  45. package/lib/rules/max-lines-per-function.js +13 -17
  46. package/lib/rules/max-lines.js +3 -5
  47. package/lib/rules/max-nested-callbacks.js +6 -7
  48. package/lib/rules/max-params.js +5 -5
  49. package/lib/rules/max-statements-per-line.js +3 -2
  50. package/lib/rules/max-statements.js +6 -7
  51. package/lib/rules/multiline-comment-style.js +9 -9
  52. package/lib/rules/new-cap.js +9 -6
  53. package/lib/rules/newline-per-chained-call.js +2 -1
  54. package/lib/rules/no-alert.js +1 -1
  55. package/lib/rules/no-bitwise.js +2 -1
  56. package/lib/rules/no-caller.js +1 -1
  57. package/lib/rules/no-confusing-arrow.js +1 -1
  58. package/lib/rules/no-constant-condition.js +2 -1
  59. package/lib/rules/no-dupe-keys.js +2 -2
  60. package/lib/rules/no-duplicate-imports.js +2 -1
  61. package/lib/rules/no-else-return.js +4 -3
  62. package/lib/rules/no-empty-character-class.js +1 -1
  63. package/lib/rules/no-empty.js +2 -1
  64. package/lib/rules/no-eval.js +1 -1
  65. package/lib/rules/no-extra-parens.js +7 -1
  66. package/lib/rules/no-fallthrough.js +4 -3
  67. package/lib/rules/no-implicit-coercion.js +10 -7
  68. package/lib/rules/no-implied-eval.js +1 -1
  69. package/lib/rules/no-invalid-regexp.js +2 -2
  70. package/lib/rules/no-irregular-whitespace.js +11 -7
  71. package/lib/rules/no-labels.js +6 -4
  72. package/lib/rules/no-lonely-if.js +1 -1
  73. package/lib/rules/no-magic-numbers.js +6 -3
  74. package/lib/rules/no-mixed-operators.js +6 -5
  75. package/lib/rules/no-mixed-requires.js +1 -1
  76. package/lib/rules/no-mixed-spaces-and-tabs.js +2 -2
  77. package/lib/rules/no-multi-spaces.js +2 -1
  78. package/lib/rules/no-octal-escape.js +1 -1
  79. package/lib/rules/no-octal.js +1 -1
  80. package/lib/rules/no-param-reassign.js +2 -2
  81. package/lib/rules/no-path-concat.js +1 -1
  82. package/lib/rules/no-plusplus.js +2 -1
  83. package/lib/rules/no-redeclare.js +2 -2
  84. package/lib/rules/no-regex-spaces.js +1 -1
  85. package/lib/rules/no-return-assign.js +1 -1
  86. package/lib/rules/no-self-assign.js +3 -2
  87. package/lib/rules/no-shadow-restricted-names.js +16 -2
  88. package/lib/rules/no-shadow.js +3 -3
  89. package/lib/rules/no-sync.js +2 -1
  90. package/lib/rules/no-tabs.js +4 -3
  91. package/lib/rules/no-template-curly-in-string.js +1 -1
  92. package/lib/rules/no-trailing-spaces.js +7 -5
  93. package/lib/rules/no-undef.js +2 -1
  94. package/lib/rules/no-underscore-dangle.js +6 -3
  95. package/lib/rules/no-unexpected-multiline.js +1 -1
  96. package/lib/rules/no-unmodified-loop-condition.js +5 -5
  97. package/lib/rules/no-unneeded-ternary.js +2 -1
  98. package/lib/rules/no-unsafe-finally.js +3 -3
  99. package/lib/rules/no-unused-expressions.js +8 -5
  100. package/lib/rules/no-unused-vars.js +6 -6
  101. package/lib/rules/no-use-before-define.js +2 -2
  102. package/lib/rules/no-useless-escape.js +1 -1
  103. package/lib/rules/no-useless-rename.js +3 -3
  104. package/lib/rules/no-var.js +1 -1
  105. package/lib/rules/no-warning-comments.js +6 -6
  106. package/lib/rules/object-property-newline.js +5 -3
  107. package/lib/rules/one-var.js +18 -35
  108. package/lib/rules/padded-blocks.js +32 -9
  109. package/lib/rules/padding-line-between-statements.js +4 -3
  110. package/lib/rules/prefer-arrow-callback.js +4 -2
  111. package/lib/rules/prefer-const.js +5 -5
  112. package/lib/rules/prefer-destructuring.js +56 -5
  113. package/lib/rules/prefer-named-capture-group.js +123 -0
  114. package/lib/rules/prefer-object-spread.js +1 -1
  115. package/lib/rules/prefer-promise-reject-errors.js +1 -1
  116. package/lib/rules/prefer-spread.js +2 -13
  117. package/lib/rules/prefer-template.js +3 -3
  118. package/lib/rules/quotes.js +2 -2
  119. package/lib/rules/require-jsdoc.js +13 -7
  120. package/lib/rules/semi-spacing.js +6 -8
  121. package/lib/rules/semi.js +4 -4
  122. package/lib/rules/sort-imports.js +6 -3
  123. package/lib/rules/sort-keys.js +13 -5
  124. package/lib/rules/sort-vars.js +2 -1
  125. package/lib/rules/space-infix-ops.js +2 -1
  126. package/lib/rules/space-unary-ops.js +5 -3
  127. package/lib/rules/spaced-comment.js +6 -5
  128. package/lib/rules/switch-colon-spacing.js +2 -2
  129. package/lib/rules/template-curly-spacing.js +2 -2
  130. package/lib/rules/use-isnan.js +1 -1
  131. package/lib/rules/valid-jsdoc.js +12 -7
  132. package/lib/rules/valid-typeof.js +2 -1
  133. package/lib/rules/vars-on-top.js +1 -1
  134. package/lib/rules/wrap-iife.js +3 -2
  135. package/lib/rules/yoda.js +6 -4
  136. package/lib/util/ajv.js +1 -0
  137. package/lib/util/ast-utils.js +12 -12
  138. package/lib/util/config-comment-parser.js +4 -4
  139. package/lib/util/glob-utils.js +3 -3
  140. package/lib/util/ignored-paths.js +4 -4
  141. package/lib/util/interpolate.js +1 -1
  142. package/lib/util/naming.js +6 -6
  143. package/lib/util/node-event-generator.js +1 -1
  144. package/lib/util/path-utils.js +2 -2
  145. package/lib/util/patterns/letters.js +1 -1
  146. package/lib/util/source-code.js +2 -2
  147. package/lib/util/xml-escape.js +1 -1
  148. package/package.json +25 -23
package/CHANGELOG.md CHANGED
@@ -1,3 +1,72 @@
1
+ v5.15.1 - March 4, 2019
2
+
3
+ * [`fe1a892`](https://github.com/eslint/eslint/commit/fe1a892f85b09c3d2fea05bef011530a678a6af5) Build: bundle espree (fixes eslint/eslint.github.io#546) (#11467) (薛定谔的猫)
4
+ * [`458053b`](https://github.com/eslint/eslint/commit/458053b0b541f857bf233dacbde5ba80681820f8) Fix: avoid creating invalid regex in no-warning-comments (fixes #11471) (#11472) (Teddy Katz)
5
+
6
+ v5.15.0 - March 1, 2019
7
+
8
+ * [`4088c6c`](https://github.com/eslint/eslint/commit/4088c6c9d4578cd581ce8ff4385d90b58a75b755) Build: Remove path.resolve in webpack build (#11462) (Kevin Partington)
9
+ * [`ec59ec0`](https://github.com/eslint/eslint/commit/ec59ec09c8d001b8c04f9edc09994e2b0d0af0f9) New: add rule "prefer-named-capture-group" (fixes #11381) (#11392) (Pig Fang)
10
+ * [`a44f750`](https://github.com/eslint/eslint/commit/a44f75073306e5ea4e6722654009a99884fbca4f) Upgrade: eslint-scope@4.0.2 (#11461) (Teddy Katz)
11
+ * [`d3ce611`](https://github.com/eslint/eslint/commit/d3ce611e1c705440ccbcae357f2194134d026541) Sponsors: Sync README with website (ESLint Jenkins)
12
+ * [`ee88475`](https://github.com/eslint/eslint/commit/ee884754e4111e11994ff0df3f0c29e43e1dc3f2) Chore: add utils for rule tests (#11453) (薛定谔的猫)
13
+ * [`d4824e4`](https://github.com/eslint/eslint/commit/d4824e46d7a6ca1618454d3c6198403382108123) Sponsors: Sync README with website (ESLint Jenkins)
14
+ * [`6489518`](https://github.com/eslint/eslint/commit/64895185bde5233223648bcaf46f8deb72c9fb55) Fix: no-extra-parens crash when code is "((let))" (#11444) (Teddy Katz)
15
+ * [`9d20de2`](https://github.com/eslint/eslint/commit/9d20de2b0ac756bd62888119b8e08c7441d8a5aa) Sponsors: Sync README with website (ESLint Jenkins)
16
+ * [`3f14de4`](https://github.com/eslint/eslint/commit/3f14de458ba120e9c013f5fc7c6fe3e9b40c1460) Sponsors: Sync README with website (ESLint Jenkins)
17
+ * [`3d6c770`](https://github.com/eslint/eslint/commit/3d6c7709d47e047b25d91ca1a77d6dab92313061) Sponsors: Sync README with website (ESLint Jenkins)
18
+ * [`de5cbc5`](https://github.com/eslint/eslint/commit/de5cbc526b30405e742b35d85d04361529d49ed4) Update: remove invalid defaults from core rules (fixes #11415) (#11427) (Teddy Katz)
19
+ * [`eb0650b`](https://github.com/eslint/eslint/commit/eb0650ba20cf9f9ad78dbaccfeb7e0e7ab56e31d) Build: fix linting errors on master (#11428) (Teddy Katz)
20
+ * [`5018378`](https://github.com/eslint/eslint/commit/5018378131fd5190bbccca902c0cf4276ee1581a) Chore: enable require-unicode-regexp on ESLint codebase (#11422) (Teddy Katz)
21
+ * [`f6ba633`](https://github.com/eslint/eslint/commit/f6ba633f56eca6be20fc4b0d9496a78b9498d578) Chore: lint all files in the repo at the same time (#11425) (Teddy Katz)
22
+ * [`8f3d717`](https://github.com/eslint/eslint/commit/8f3d71754932669332ad7623bcc4c1aef3897125) Docs: Add non-attending TSC member info (#11411) (Nicholas C. Zakas)
23
+ * [`ce0777d`](https://github.com/eslint/eslint/commit/ce0777da5bc167fe0c529158fd8216d3eaf11565) Docs: use more common spelling (#11417) (薛定谔的猫)
24
+ * [`b9aabe3`](https://github.com/eslint/eslint/commit/b9aabe34311f6189b87c9d8a1aa40f3513fed773) Chore: run fuzzer along with unit tests (#11404) (Teddy Katz)
25
+ * [`db0c5e2`](https://github.com/eslint/eslint/commit/db0c5e2a7f894b7cda71007b0ba43d7814b3fb2e) Build: switch from browserify to webpack (fixes #11366) (#11398) (Pig Fang)
26
+
27
+ v5.14.1 - February 18, 2019
28
+
29
+ * [`1d6e639`](https://github.com/eslint/eslint/commit/1d6e63930073e79e52890f552cc6e9a0646b7fb4) Fix: sort-keys throws Error at SpreadElement (fixes #11402) (#11403) (Krist Wongsuphasawat)
30
+
31
+ v5.14.0 - February 15, 2019
32
+
33
+ * [`85a04b3`](https://github.com/eslint/eslint/commit/85a04b319e6dfde1458174cd1d8c9e7d33da0871) Fix: adds conditional for separateRequires in one-var (fixes #10179) (#10980) (Scott Stern)
34
+ * [`0c02932`](https://github.com/eslint/eslint/commit/0c02932f1b2e2a85809e84617efa1b8836c19cfb) Upgrade: espree@5.0.1 (#11401) (Ilya Volodin)
35
+ * [`104ae88`](https://github.com/eslint/eslint/commit/104ae881d0b21e9c64e006b2a2c21535cef0ad28) Docs: Update governance doc with reviewers status (#11399) (Nicholas C. Zakas)
36
+ * [`ab8ac6a`](https://github.com/eslint/eslint/commit/ab8ac6adaaf7a88e160899e7f438a4cfd655eb6e) Fix: Support boundary spread elements in sort-keys (#11158) (Jakub Rożek)
37
+ * [`a23d197`](https://github.com/eslint/eslint/commit/a23d1975d48841eafdead1a1357e2af842f688bc) New: add allowSingleLineBlocks opt. to padded-blocks rule (fixes #7145) (#11243) (richie3366)
38
+ * [`e25e7aa`](https://github.com/eslint/eslint/commit/e25e7aa3ea1e8c9b3cd3242acda6d4a5572c2c6a) Fix: comma-spacing ignore comma before closing paren (fixes #11295) (#11374) (Pig Fang)
39
+ * [`a1f7c44`](https://github.com/eslint/eslint/commit/a1f7c44ea9efbd9393889c1cc91b74260e0a8e02) Docs: fix space-before-blocks correct code for "classes": "never" (#11391) (PoziWorld)
40
+ * [`14f58a2`](https://github.com/eslint/eslint/commit/14f58a2bec4d6aade0de22771c378b86b1e51959) Docs: fix grammar in object-curly-spacing docs (#11389) (PoziWorld)
41
+ * [`d3e9a27`](https://github.com/eslint/eslint/commit/d3e9a27bbba30008a610df59e82b7192f0ecc3a3) Docs: fix grammar in “those who says” (#11390) (PoziWorld)
42
+ * [`ea8e804`](https://github.com/eslint/eslint/commit/ea8e8045ba0e6c1e1015104346af962f3e16fd81) Docs: Add note about support for object spread (fixes #11136) (#11395) (Steven Thomas)
43
+ * [`95aa3fd`](https://github.com/eslint/eslint/commit/95aa3fdb392d265e6c3d813d54076458e88e7ad8) Docs: Update README team and sponsors (ESLint Jenkins)
44
+ * [`51c4972`](https://github.com/eslint/eslint/commit/51c497298a15ad296a2b1f8fc397df687976b836) Update: Behavior of --init (fixes #11105) (#11332) (Nicholas C. Zakas)
45
+ * [`ad7a380`](https://github.com/eslint/eslint/commit/ad7a38097c32a91e5a831ef1bc8933601532576c) Docs: Update README team and sponsors (ESLint Jenkins)
46
+ * [`550de1e`](https://github.com/eslint/eslint/commit/550de1e611a1e9af873bcb18d74cf2056e8d2e1b) Update: use `default` keyword in JSON schema (fixes #9929) (#11288) (Pig Fang)
47
+ * [`983c520`](https://github.com/eslint/eslint/commit/983c5201210d7a4ffab0b3d05ab9919c0754e5ca) Update: Use 'readonly' and 'writable' for globals (fixes #11359) (#11384) (Nicholas C. Zakas)
48
+ * [`f1d3a7e`](https://github.com/eslint/eslint/commit/f1d3a7ee7c82365989e219b1dae379f08f6dd526) Upgrade: some deps (fixes #11372) (#11373) (薛定谔的猫)
49
+ * [`3e0c417`](https://github.com/eslint/eslint/commit/3e0c4176eff085498b813f8ba1732d7ed6ee44f8) Docs: Fix grammar in “there’s nothing prevent you” (#11385) (PoziWorld)
50
+ * [`de988bc`](https://github.com/eslint/eslint/commit/de988bc909b491366ad0cd9bc83f4d6de42d041a) Docs: Fix grammar: Spacing improve -> Spacing improves (#11386) (PoziWorld)
51
+ * [`1309dfd`](https://github.com/eslint/eslint/commit/1309dfdebb5595460b79dcac20df6a1f109e7566) Revert "Build: fix test failure on Node 11 (#11100)" (#11375) (薛定谔的猫)
52
+ * [`1e56897`](https://github.com/eslint/eslint/commit/1e56897db3e254e0aef6d2fe3274157fc379c79e) Docs: “the function actually use”: use -> uses (#11380) (PoziWorld)
53
+ * [`5a71bc9`](https://github.com/eslint/eslint/commit/5a71bc95a7e961b1b1b77022645e0bd9cdd08dc0) Docs: Update README team and sponsors (ESLint Jenkins)
54
+ * [`82a58ce`](https://github.com/eslint/eslint/commit/82a58ce26b282fd80335b3ac4fc88f21266c3ba1) Docs: Update README team and sponsors (ESLint Jenkins)
55
+ * [`546d355`](https://github.com/eslint/eslint/commit/546d355ace65631e27de859baea3ffcc50e0ad2c) Docs: Update README with latest sponsors/team data (#11378) (Nicholas C. Zakas)
56
+ * [`c0df9fe`](https://github.com/eslint/eslint/commit/c0df9febb7c7e045ababc10b88dbcbb3f28c724c) Docs: `...` is not an operator (#11232) (Felix Kling)
57
+ * [`7ecfdef`](https://github.com/eslint/eslint/commit/7ecfdefaeadb772f8b96ffe37c4a2c97fde0da16) Docs: update typescript parser (refs #11368) (#11369) (薛定谔的猫)
58
+ * [`3c90dd7`](https://github.com/eslint/eslint/commit/3c90dd7e25cf97833deddb11cfbc107a5663ac08) Update: remove prefer-spread autofix (fixes #11330) (#11365) (薛定谔的猫)
59
+ * [`5eb3121`](https://github.com/eslint/eslint/commit/5eb3121b82c1837da0c3021b7d9384bb30832e36) Update: add fixer for `prefer-destructuring` (fixes #11151) (#11301) (golopot)
60
+ * [`173eb38`](https://github.com/eslint/eslint/commit/173eb38cdb3e4673cba947521f27158828186d77) Docs: Clarify ecmaVersion doesn't imply globals (refs #9812) (#11364) (Keith Maxwell)
61
+ * [`84ce72f`](https://github.com/eslint/eslint/commit/84ce72fdeba082b7b132e4ac6b714fb1a93831b7) Fix: Remove extraneous linefeeds in `one-var` fixer (fixes #10741) (#10955) (st-sloth)
62
+ * [`389362a`](https://github.com/eslint/eslint/commit/389362a06ac6601512b872d3e843c7371f2a1bcc) Docs: clarify motivation for no-prototype-builtins (#11356) (Teddy Katz)
63
+ * [`533d240`](https://github.com/eslint/eslint/commit/533d240b0811f663494cb213b06cc9e51e1ff2d0) Update: no-shadow-restricted-names lets unassigned vars shadow undefined (#11341) (Teddy Katz)
64
+ * [`d0e823a`](https://github.com/eslint/eslint/commit/d0e823aef196a6564c87a78b72c1ef980ce67af9) Update: Make --init run js config files through linter (fixes #9947) (#11337) (Brian Kurek)
65
+ * [`92fc2f4`](https://github.com/eslint/eslint/commit/92fc2f4f3faf8aeaae8a8e71db0de405404fb6c3) Fix: CircularJSON dependency warning (fixes #11052) (#11314) (Terry)
66
+ * [`4dd19a3`](https://github.com/eslint/eslint/commit/4dd19a3c4c037adc860a65e96f2ba3eeccace1de) Docs: mention 'prefer-spread' in docs of 'no-useless-call' (#11348) (Klaus Meinhardt)
67
+ * [`4fd83d5`](https://github.com/eslint/eslint/commit/4fd83d5ec47a6a7b81cd8801c3bd63d27ea1c7c4) Docs: fix a misleading example in one-var (#11350) (薛定谔的猫)
68
+ * [`9441ce7`](https://github.com/eslint/eslint/commit/9441ce77b7228f2c4562e158a10905afe11f31f2) Chore: update incorrect tests to fix build failing (#11354) (薛定谔的猫)
69
+
1
70
  v5.13.0 - February 1, 2019
2
71
 
3
72
  * [`91c8884`](https://github.com/eslint/eslint/commit/91c8884971f5e57f5f7490d8daf92c4a9a489836) Chore: use local function to append "s" instead of a package (#11293) (Timo Tijhof)
package/README.md CHANGED
@@ -197,170 +197,82 @@ These folks keep the project moving and are resources for help.
197
197
 
198
198
  The people who manage releases, review feature requests, and meet regularly to ensure ESLint is properly maintained.
199
199
 
200
- <table>
201
- <tbody>
202
- <tr>
203
- <td align="center" valign="top" width="11%">
204
- <a href="https://github.com/nzakas">
205
- <img src="https://github.com/nzakas.png?s=75" width="75px" height="75px"><br/>
206
- <sub>Nicholas C. Zakas</sub></a>
207
- </td>
208
- <td align="center" valign="top" width="11%">
209
- <a href="https://github.com/ilyavolodin">
210
- <img src="https://github.com/ilyavolodin.png?s=75" width="75px" height="75px"><br/>
211
- <sub>Ilya Volodin</sub></a>
212
- </td>
213
- <td align="center" valign="top" width="11%">
214
- <a href="https://github.com/btmills">
215
- <img src="https://github.com/btmills.png?s=75" width="75px" height="75px"><br/>
216
- <sub>Brandon Mills</sub></a>
217
- </td>
218
- <td align="center" valign="top" width="11%">
219
- <a href="https://github.com/gyandeeps">
220
- <img src="https://github.com/gyandeeps.png?s=75" width="75px" height="75px"><br/>
221
- <sub>Gyandeep Singh</sub></a>
222
- </td>
223
- <td align="center" valign="top" width="11%">
224
- <a href="https://github.com/mysticatea">
225
- <img src="https://github.com/mysticatea.png?s=75" width="75px" height="75px"><br/>
226
- <sub>Toru Nagashima</sub></a>
227
- </td>
228
- <td align="center" valign="top" width="11%">
229
- <a href="https://github.com/alberto">
230
- <img src="https://github.com/alberto.png?s=75" width="75px" height="75px"><br/>
231
- <sub>Alberto Rodríguez</sub></a>
232
- </td>
233
- <td align="center" valign="top" width="11%">
234
- <a href="https://github.com/kaicataldo">
235
- <img src="https://github.com/kaicataldo.png?s=75" width="75px" height="75px"><br/>
236
- <sub>Kai Cataldo</sub></a>
237
- </td>
238
- <td align="center" valign="top" width="11%">
239
- <a href="https://github.com/not-an-aardvark">
240
- <img src="https://github.com/not-an-aardvark.png?s=75" width="75px" height="75px"><br/>
241
- <sub>Teddy Katz</sub></a>
242
- </td>
243
- <td align="center" valign="top" width="11%">
244
- <a href="https://github.com/platinumazure">
245
- <img src="https://github.com/platinumazure.png?s=75" width="75px" height="75px"><br/>
246
- <sub>Kevin Partington</sub></a>
247
- </td>
248
- </tr>
249
- </tbody>
250
- </table>
200
+ <!-- NOTE: This section is autogenerated. Do not manually edit.-->
201
+ <!--tscstart-->
202
+ <table><tbody><tr><td align="center" valign="top" width="11%">
203
+ <a href="https://github.com/nzakas">
204
+ <img src="https://github.com/nzakas.png?s=75" width="75" height="75"><br />
205
+ Nicholas C. Zakas
206
+ </a>
207
+ </td><td align="center" valign="top" width="11%">
208
+ <a href="https://github.com/platinumazure">
209
+ <img src="https://github.com/platinumazure.png?s=75" width="75" height="75"><br />
210
+ Kevin Partington
211
+ </a>
212
+ </td><td align="center" valign="top" width="11%">
213
+ <a href="https://github.com/ilyavolodin">
214
+ <img src="https://github.com/ilyavolodin.png?s=75" width="75" height="75"><br />
215
+ Ilya Volodin
216
+ </a>
217
+ </td><td align="center" valign="top" width="11%">
218
+ <a href="https://github.com/btmills">
219
+ <img src="https://github.com/btmills.png?s=75" width="75" height="75"><br />
220
+ Brandon Mills
221
+ </a>
222
+ </td><td align="center" valign="top" width="11%">
223
+ <a href="https://github.com/mysticatea">
224
+ <img src="https://github.com/mysticatea.png?s=75" width="75" height="75"><br />
225
+ Toru Nagashima
226
+ </a>
227
+ </td><td align="center" valign="top" width="11%">
228
+ <a href="https://github.com/gyandeeps">
229
+ <img src="https://github.com/gyandeeps.png?s=75" width="75" height="75"><br />
230
+ Gyandeep Singh
231
+ </a>
232
+ </td><td align="center" valign="top" width="11%">
233
+ <a href="https://github.com/kaicataldo">
234
+ <img src="https://github.com/kaicataldo.png?s=75" width="75" height="75"><br />
235
+ Kai Cataldo
236
+ </a>
237
+ </td><td align="center" valign="top" width="11%">
238
+ <a href="https://github.com/not-an-aardvark">
239
+ <img src="https://github.com/not-an-aardvark.png?s=75" width="75" height="75"><br />
240
+ Teddy Katz
241
+ </a>
242
+ </td></tr></tbody></table><!--tscend-->
251
243
 
252
244
  ### Committers
253
245
 
254
246
  The people who review and fix bugs and help triage issues.
255
247
 
256
- <table>
257
- <tbody>
258
- <tr>
259
- <td align="center" valign="top" width="11%">
260
- <a href="https://github.com/Aladdin-ADD">
261
- <img src="https://github.com/Aladdin-ADD.png?s=75" width="75px" height="75px"><br/>
262
- <sub>薛定谔的猫</sub></a>
263
- </td>
264
- <td align="center" valign="top" width="11%">
265
- <a href="https://github.com/g-plane">
266
- <img src="https://github.com/g-plane.png?s=75" width="75px" height="75px"><br/>
267
- <sub>Pig Fang</sub></a>
268
- </td>
269
- </tr>
270
- </tbody>
271
- </table>
272
-
273
-
274
- ### Alumni
275
-
276
- Former TSC members and committers who previously helped maintain ESLint.
277
-
278
- <table>
279
- <tbody>
280
- <tr>
281
- <td align="center" valign="top" width="11%">
282
- <a href="https://github.com/lo1tuma">
283
- <img src="https://github.com/lo1tuma.png?s=75" width="75px" height="75px"><br/>
284
- <sub>Mathias Schreck</sub></a>
285
- </td>
286
- <td align="center" valign="top" width="11%">
287
- <a href="https://github.com/xjamundx">
288
- <img src="https://github.com/xjamundx.png?s=75" width="75px" height="75px"><br/>
289
- <sub>Jamund Ferguson</sub></a>
290
- </td>
291
- <td align="center" valign="top" width="11%">
292
- <a href="https://github.com/ianvs">
293
- <img src="https://github.com/ianvs.png?s=75" width="75px" height="75px"><br/>
294
- <sub>Ian VanSchooten</sub></a>
295
- </td>
296
- <td align="center" valign="top" width="11%">
297
- <a href="https://github.com/byk">
298
- <img src="https://github.com/byk.png?s=75" width="75px" height="75px"><br/>
299
- <sub>Burak Yiğit Kaya</sub></a>
300
- </td>
301
- <td align="center" valign="top" width="11%">
302
- <a href="https://github.com/michaelficarra">
303
- <img src="https://github.com/michaelficarra.png?s=75" width="75px" height="75px"><br/>
304
- <sub>Michael Ficarra</sub></a>
305
- </td>
306
- <td align="center" valign="top" width="11%">
307
- <a href="https://github.com/pedrottimark">
308
- <img src="https://github.com/pedrottimark.png?s=75" width="75px" height="75px"><br/>
309
- <sub>Mark Pedrotti</sub></a>
310
- </td>
311
- <td align="center" valign="top" width="11%">
312
- <a href="https://github.com/markelog">
313
- <img src="https://github.com/markelog.png?s=75" width="75px" height="75px"><br/>
314
- <sub>Oleg Gaidarenko</sub></a>
315
- </td>
316
- <td align="center" valign="top" width="11%">
317
- <a href="https://github.com/mikesherov">
318
- <img src="https://github.com/mikesherov.png?s=75" width="75px" height="75px"><br/>
319
- <sub>Mike Sherov</sub></a>
320
- </td>
321
- </tr>
322
- <tr>
323
- <td align="center" valign="top" width="11%">
324
- <a href="https://github.com/hzoo">
325
- <img src="https://github.com/hzoo.png?s=75" width="75px" height="75px"><br/>
326
- <sub>Henry Zhu</sub></a>
327
- </td>
328
- <td align="center" valign="top" width="11%">
329
- <a href="https://github.com/mdevils">
330
- <img src="https://github.com/mdevils.png?s=75" width="75px" height="75px"><br/>
331
- <sub>Marat Dulin</sub></a>
332
- </td>
333
- <td align="center" valign="top" width="11%">
334
- <a href="https://github.com/zxqfox">
335
- <img src="https://github.com/zxqfox.png?s=75" width="75px" height="75px"><br/>
336
- <sub>Alexej Yaroshevich</sub></a>
337
- </td>
338
- <td align="center" valign="top" width="11%">
339
- <a href="https://github.com/vitorbal">
340
- <img src="https://github.com/vitorbal.png?s=75" width="75px" height="75px"><br/>
341
- <sub>Vitor Balocco</sub></a>
342
- </td>
343
- <td align="center" valign="top" width="11%">
344
- <a href="https://github.com/JamesHenry">
345
- <img src="https://github.com/JamesHenry.png?s=75" width="75px" height="75px"><br/>
346
- <sub>James Henry</sub></a>
347
- </td>
348
- <td align="center" valign="top" width="11%">
349
- <a href="https://github.com/soda0289">
350
- <img src="https://github.com/soda0289.png?s=75" width="75px" height="75px"><br/>
351
- <sub>Reyad Attiyat</sub></a>
352
- </td>
353
- <td align="center" valign="top" width="11%">
354
- <a href="https://github.com/VictorHom">
355
- <img src="https://github.com/VictorHom.png?s=75" width="75px" height="75px"><br/>
356
- <sub>Victor Hom</sub></a>
357
- </td>
358
- </tr>
359
- </tbody>
360
- </table>
248
+ <!-- NOTE: This section is autogenerated. Do not manually edit.-->
249
+ <!--committersstart-->
250
+ <table><tbody><tr><td align="center" valign="top" width="11%">
251
+ <a href="https://github.com/aladdin-add">
252
+ <img src="https://github.com/aladdin-add.png?s=75" width="75" height="75"><br />
253
+ 薛定谔的猫
254
+ </a>
255
+ </td><td align="center" valign="top" width="11%">
256
+ <a href="https://github.com/g-plane">
257
+ <img src="https://github.com/g-plane.png?s=75" width="75" height="75"><br />
258
+ Pig Fang
259
+ </a>
260
+ </td></tr></tbody></table><!--committersend-->
361
261
 
362
262
  ## Sponsors
363
263
 
264
+ The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://opencollective.com/eslint) to get your logo on our README and website.
265
+
266
+ <!-- NOTE: This section is autogenerated. Do not manually edit.-->
267
+ <!--sponsorsstart-->
268
+ <h3>Gold Sponsors</h3>
269
+ <p><a href="https://www.airbnb.com/"><img src="https://images.opencollective.com/proxy/images/?src=https%3A%2F%2Fopencollective-production.s3-us-west-1.amazonaws.com%2F098e3bd0-4d57-11e8-9324-0f6cc1f92bf1.png&height=96" alt="Airbnb" height="96"></a> <a href="https://code.facebook.com/projects/"><img src="https://images.opencollective.com/proxy/images/?src=https%3A%2F%2Fres.cloudinary.com%2Fopencollective%2Fimage%2Fupload%2Fv1508519428%2FS9gk78AS_400x400_fulq2l.jpg&height=96" alt="Facebook Open Source" height="96"></a> <a href="https://badoo.com/team?utm_source=eslint"><img src="https://images.opencollective.com/proxy/images/?src=https%3A%2F%2Fopencollective-production.s3-us-west-1.amazonaws.com%2Fbbdb9cc0-3b5d-11e9-9537-ad85092287b8.png&height=96" alt="Badoo" height="96"></a></p><h3>Silver Sponsors</h3>
270
+ <p><a href="https://www.ampproject.org/"><img src="https://images.opencollective.com/proxy/images/?src=https%3A%2F%2Fopencollective-production.s3-us-west-1.amazonaws.com%2F68ed8b70-ebf2-11e6-9958-cb7e79408c56.png&height=96" alt="AMP Project" height="64"></a></p><h3>Bronze Sponsors</h3>
271
+ <p><a href="http://faithlife.com/ref/about"><img src="https://images.opencollective.com/proxy/images/?src=https%3A%2F%2Flogo.clearbit.com%2Ffaithlife.com&height=96" alt="Faithlife" height="32"></a></p>
272
+ <!--sponsorsend-->
273
+
274
+ ## Technology Sponsors
275
+
364
276
  * Site search ([eslint.org](https://eslint.org)) is sponsored by [Algolia](https://www.algolia.com)
365
277
 
366
278
 
@@ -232,6 +232,7 @@ module.exports = {
232
232
  "prefer-arrow-callback": require("./rules/prefer-arrow-callback"),
233
233
  "prefer-const": require("./rules/prefer-const"),
234
234
  "prefer-destructuring": require("./rules/prefer-destructuring"),
235
+ "prefer-named-capture-group": require("./rules/prefer-named-capture-group"),
235
236
  "prefer-numeric-literals": require("./rules/prefer-numeric-literals"),
236
237
  "prefer-object-spread": require("./rules/prefer-object-spread"),
237
238
  "prefer-promise-reject-errors": require("./rules/prefer-promise-reject-errors"),
package/lib/cli-engine.js CHANGED
@@ -258,7 +258,7 @@ function processFile(filename, configHelper, options, linter) {
258
258
  */
259
259
  function createIgnoreResult(filePath, baseDir) {
260
260
  let message;
261
- const isHidden = /^\./.test(path.basename(filePath));
261
+ const isHidden = /^\./u.test(path.basename(filePath));
262
262
  const isInNodeModules = baseDir && path.relative(baseDir, filePath).startsWith("node_modules");
263
263
  const isInBowerComponents = baseDir && path.relative(baseDir, filePath).startsWith("bower_components");
264
264
 
@@ -455,6 +455,9 @@ class CLIEngine {
455
455
  if (this.options.rules && Object.keys(this.options.rules).length) {
456
456
  const loadedRules = this.linter.getRules();
457
457
 
458
+ // Ajv validator with default schema will mutate original object, so we must clone it recursively.
459
+ this.options.rules = lodash.cloneDeep(this.options.rules);
460
+
458
461
  Object.keys(this.options.rules).forEach(name => {
459
462
  validator.validateRuleOptions(loadedRules.get(name), name, this.options.rules[name], "CLI");
460
463
  });
@@ -754,7 +757,7 @@ class CLIEngine {
754
757
  if (typeof resolvedFormatName === "string") {
755
758
 
756
759
  // replace \ with / for Windows compatibility
757
- const normalizedFormatName = resolvedFormatName.replace(/\\/g, "/");
760
+ const normalizedFormatName = resolvedFormatName.replace(/\\/gu, "/");
758
761
 
759
762
  const cwd = this.options ? this.options.cwd : process.cwd();
760
763
  const namespace = naming.getNamespaceFromTerm(normalizedFormatName);
@@ -61,7 +61,7 @@ const resolver = new ModuleResolver();
61
61
  * @private
62
62
  */
63
63
  function readFile(filePath) {
64
- return fs.readFileSync(filePath, "utf8").replace(/^\ufeff/, "");
64
+ return fs.readFileSync(filePath, "utf8").replace(/^\ufeff/u, "");
65
65
  }
66
66
 
67
67
  /**
@@ -73,7 +73,7 @@ function readFile(filePath) {
73
73
  * @private
74
74
  */
75
75
  function isFilePath(filePath) {
76
- return path.isAbsolute(filePath) || !/\w|@/.test(filePath.charAt(0));
76
+ return path.isAbsolute(filePath) || !/\w|@/u.test(filePath.charAt(0));
77
77
  }
78
78
 
79
79
  /**
@@ -280,15 +280,38 @@ function writeYAMLConfigFile(config, filePath) {
280
280
  * Writes a configuration file in JavaScript format.
281
281
  * @param {Object} config The configuration object to write.
282
282
  * @param {string} filePath The filename to write to.
283
+ * @throws {Error} If an error occurs linting the config file contents.
283
284
  * @returns {void}
284
285
  * @private
285
286
  */
286
287
  function writeJSConfigFile(config, filePath) {
287
288
  debug(`Writing JS config file: ${filePath}`);
288
289
 
289
- const content = `module.exports = ${stringify(config, { cmp: sortByKey, space: 4 })};`;
290
+ let contentToWrite;
291
+ const stringifiedContent = `module.exports = ${stringify(config, { cmp: sortByKey, space: 4 })};`;
290
292
 
291
- fs.writeFileSync(filePath, content, "utf8");
293
+ try {
294
+ const CLIEngine = require("../cli-engine");
295
+ const linter = new CLIEngine({
296
+ baseConfig: config,
297
+ fix: true,
298
+ useEslintrc: false
299
+ });
300
+ const report = linter.executeOnText(stringifiedContent);
301
+
302
+ contentToWrite = report.results[0].output || stringifiedContent;
303
+ } catch (e) {
304
+ debug("Error linting JavaScript config file, writing unlinted version");
305
+ const errorMessage = e.message;
306
+
307
+ contentToWrite = stringifiedContent;
308
+ e.message = "An error occurred while generating your JavaScript config file. ";
309
+ e.message += "A config file was still generated, but the config file itself may not follow your linting rules.";
310
+ e.message += `\nError: ${errorMessage}`;
311
+ throw e;
312
+ } finally {
313
+ fs.writeFileSync(filePath, contentToWrite, "utf8");
314
+ }
292
315
  }
293
316
 
294
317
  /**