eslint 6.3.0 → 6.6.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.
Files changed (189) hide show
  1. package/CHANGELOG.md +126 -0
  2. package/README.md +11 -10
  3. package/bin/eslint.js +38 -12
  4. package/lib/cli-engine/cascading-config-array-factory.js +2 -1
  5. package/lib/cli-engine/cli-engine.js +11 -11
  6. package/lib/cli-engine/config-array/config-array.js +0 -4
  7. package/lib/cli-engine/config-array/config-dependency.js +2 -0
  8. package/lib/cli-engine/config-array/override-tester.js +4 -2
  9. package/lib/cli-engine/config-array-factory.js +7 -1
  10. package/lib/cli-engine/file-enumerator.js +5 -3
  11. package/lib/cli-engine/formatters/html.js +1 -0
  12. package/lib/cli-engine/ignored-paths.js +4 -3
  13. package/lib/cli-engine/lint-result-cache.js +0 -1
  14. package/lib/cli.js +13 -12
  15. package/lib/init/autoconfig.js +1 -11
  16. package/lib/init/config-file.js +0 -1
  17. package/lib/init/config-initializer.js +0 -1
  18. package/lib/init/config-rule.js +3 -7
  19. package/lib/init/npm-utils.js +1 -6
  20. package/lib/linter/code-path-analysis/code-path-analyzer.js +24 -38
  21. package/lib/linter/code-path-analysis/code-path-segment.js +17 -25
  22. package/lib/linter/code-path-analysis/code-path-state.js +40 -81
  23. package/lib/linter/code-path-analysis/code-path.js +10 -11
  24. package/lib/linter/code-path-analysis/debug-helpers.js +9 -13
  25. package/lib/linter/code-path-analysis/fork-context.js +23 -34
  26. package/lib/linter/code-path-analysis/id-generator.js +2 -2
  27. package/lib/linter/linter.js +121 -96
  28. package/lib/linter/node-event-generator.js +3 -2
  29. package/lib/options.js +6 -0
  30. package/lib/rule-tester/rule-tester.js +7 -10
  31. package/lib/rules/accessor-pairs.js +59 -19
  32. package/lib/rules/array-bracket-newline.js +12 -15
  33. package/lib/rules/array-bracket-spacing.js +12 -12
  34. package/lib/rules/array-callback-return.js +6 -11
  35. package/lib/rules/array-element-newline.js +5 -8
  36. package/lib/rules/arrow-parens.js +0 -1
  37. package/lib/rules/block-scoped-var.js +3 -3
  38. package/lib/rules/block-spacing.js +4 -4
  39. package/lib/rules/capitalized-comments.js +2 -9
  40. package/lib/rules/class-methods-use-this.js +3 -3
  41. package/lib/rules/comma-dangle.js +15 -23
  42. package/lib/rules/comma-spacing.js +1 -1
  43. package/lib/rules/computed-property-spacing.js +28 -11
  44. package/lib/rules/consistent-return.js +4 -5
  45. package/lib/rules/consistent-this.js +5 -5
  46. package/lib/rules/constructor-super.js +14 -16
  47. package/lib/rules/curly.js +3 -5
  48. package/lib/rules/default-param-last.js +62 -0
  49. package/lib/rules/dot-location.js +11 -12
  50. package/lib/rules/eqeqeq.js +7 -19
  51. package/lib/rules/func-names.js +6 -6
  52. package/lib/rules/function-call-argument-newline.js +5 -5
  53. package/lib/rules/generator-star-spacing.js +4 -9
  54. package/lib/rules/getter-return.js +4 -7
  55. package/lib/rules/indent-legacy.js +1 -1
  56. package/lib/rules/indent.js +46 -8
  57. package/lib/rules/index.js +3 -0
  58. package/lib/rules/init-declarations.js +2 -2
  59. package/lib/rules/jsx-quotes.js +1 -1
  60. package/lib/rules/keyword-spacing.js +32 -56
  61. package/lib/rules/lines-around-directive.js +1 -1
  62. package/lib/rules/max-len.js +0 -5
  63. package/lib/rules/max-statements-per-line.js +3 -7
  64. package/lib/rules/multiline-ternary.js +3 -3
  65. package/lib/rules/new-parens.js +5 -1
  66. package/lib/rules/newline-after-var.js +6 -7
  67. package/lib/rules/newline-before-return.js +8 -9
  68. package/lib/rules/newline-per-chained-call.js +2 -4
  69. package/lib/rules/no-class-assign.js +2 -2
  70. package/lib/rules/no-compare-neg-zero.js +1 -2
  71. package/lib/rules/no-confusing-arrow.js +2 -2
  72. package/lib/rules/no-console.js +4 -8
  73. package/lib/rules/no-const-assign.js +1 -1
  74. package/lib/rules/no-dupe-args.js +1 -1
  75. package/lib/rules/no-dupe-class-members.js +3 -4
  76. package/lib/rules/no-dupe-keys.js +6 -5
  77. package/lib/rules/no-duplicate-imports.js +14 -18
  78. package/lib/rules/no-else-return.js +0 -8
  79. package/lib/rules/no-empty-function.js +2 -4
  80. package/lib/rules/no-eval.js +10 -18
  81. package/lib/rules/no-ex-assign.js +1 -1
  82. package/lib/rules/no-extra-bind.js +12 -13
  83. package/lib/rules/no-extra-boolean-cast.js +1 -3
  84. package/lib/rules/no-extra-label.js +13 -10
  85. package/lib/rules/no-extra-parens.js +32 -17
  86. package/lib/rules/no-extra-semi.js +5 -6
  87. package/lib/rules/no-fallthrough.js +6 -6
  88. package/lib/rules/no-func-assign.js +3 -3
  89. package/lib/rules/no-global-assign.js +4 -4
  90. package/lib/rules/no-implicit-coercion.js +10 -10
  91. package/lib/rules/no-implied-eval.js +0 -1
  92. package/lib/rules/no-import-assign.js +238 -0
  93. package/lib/rules/no-invalid-this.js +1 -3
  94. package/lib/rules/no-labels.js +3 -6
  95. package/lib/rules/no-lone-blocks.js +7 -2
  96. package/lib/rules/no-loop-func.js +6 -11
  97. package/lib/rules/no-magic-numbers.js +6 -6
  98. package/lib/rules/no-misleading-character-class.js +14 -7
  99. package/lib/rules/no-mixed-operators.js +13 -22
  100. package/lib/rules/no-mixed-requires.js +0 -1
  101. package/lib/rules/no-multi-spaces.js +1 -1
  102. package/lib/rules/no-native-reassign.js +4 -4
  103. package/lib/rules/no-obj-calls.js +29 -9
  104. package/lib/rules/no-octal-escape.js +14 -8
  105. package/lib/rules/no-param-reassign.js +28 -7
  106. package/lib/rules/no-redeclare.js +1 -1
  107. package/lib/rules/no-regex-spaces.js +105 -45
  108. package/lib/rules/no-restricted-imports.js +11 -11
  109. package/lib/rules/no-self-assign.js +18 -18
  110. package/lib/rules/no-sequences.js +5 -5
  111. package/lib/rules/no-shadow.js +1 -4
  112. package/lib/rules/no-tabs.js +8 -2
  113. package/lib/rules/no-this-before-super.js +12 -13
  114. package/lib/rules/no-trailing-spaces.js +19 -7
  115. package/lib/rules/no-undef-init.js +7 -1
  116. package/lib/rules/no-unmodified-loop-condition.js +16 -29
  117. package/lib/rules/no-unneeded-ternary.js +3 -3
  118. package/lib/rules/no-unreachable.js +7 -7
  119. package/lib/rules/no-unsafe-finally.js +4 -7
  120. package/lib/rules/no-unsafe-negation.js +34 -19
  121. package/lib/rules/no-unused-expressions.js +11 -7
  122. package/lib/rules/no-unused-labels.js +3 -6
  123. package/lib/rules/no-unused-vars.js +22 -29
  124. package/lib/rules/no-use-before-define.js +10 -15
  125. package/lib/rules/no-useless-call.js +4 -4
  126. package/lib/rules/no-useless-concat.js +4 -4
  127. package/lib/rules/no-useless-constructor.js +14 -22
  128. package/lib/rules/no-useless-escape.js +3 -5
  129. package/lib/rules/no-useless-rename.js +32 -20
  130. package/lib/rules/no-useless-return.js +11 -17
  131. package/lib/rules/no-var.js +12 -25
  132. package/lib/rules/no-warning-comments.js +0 -1
  133. package/lib/rules/no-whitespace-before-property.js +3 -3
  134. package/lib/rules/object-curly-newline.js +7 -10
  135. package/lib/rules/object-curly-spacing.js +14 -15
  136. package/lib/rules/object-shorthand.js +36 -10
  137. package/lib/rules/one-var-declaration-per-line.js +2 -2
  138. package/lib/rules/operator-assignment.js +22 -1
  139. package/lib/rules/padded-blocks.js +1 -1
  140. package/lib/rules/padding-line-between-statements.js +0 -16
  141. package/lib/rules/prefer-arrow-callback.js +6 -6
  142. package/lib/rules/prefer-const.js +13 -21
  143. package/lib/rules/prefer-destructuring.js +1 -7
  144. package/lib/rules/prefer-named-capture-group.js +3 -16
  145. package/lib/rules/prefer-numeric-literals.js +35 -3
  146. package/lib/rules/prefer-object-spread.js +7 -7
  147. package/lib/rules/prefer-regex-literals.js +125 -0
  148. package/lib/rules/prefer-rest-params.js +3 -6
  149. package/lib/rules/prefer-spread.js +4 -4
  150. package/lib/rules/prefer-template.js +5 -6
  151. package/lib/rules/quote-props.js +1 -1
  152. package/lib/rules/quotes.js +11 -6
  153. package/lib/rules/radix.js +5 -10
  154. package/lib/rules/require-await.js +2 -5
  155. package/lib/rules/require-yield.js +2 -2
  156. package/lib/rules/rest-spread-spacing.js +1 -1
  157. package/lib/rules/sort-imports.js +3 -4
  158. package/lib/rules/sort-keys.js +1 -3
  159. package/lib/rules/space-before-blocks.js +1 -2
  160. package/lib/rules/space-before-function-paren.js +12 -1
  161. package/lib/rules/space-in-parens.js +81 -75
  162. package/lib/rules/space-infix-ops.js +5 -5
  163. package/lib/rules/spaced-comment.js +15 -18
  164. package/lib/rules/strict.js +2 -4
  165. package/lib/rules/symbol-description.js +1 -2
  166. package/lib/rules/template-curly-spacing.js +2 -2
  167. package/lib/rules/use-isnan.js +104 -6
  168. package/lib/rules/utils/ast-utils.js +53 -81
  169. package/lib/rules/utils/fix-tracker.js +0 -6
  170. package/lib/rules/utils/lazy-loading-rule-map.js +0 -1
  171. package/lib/rules/vars-on-top.js +11 -11
  172. package/lib/shared/config-ops.js +2 -2
  173. package/lib/shared/logging.js +2 -0
  174. package/lib/shared/runtime-info.js +163 -0
  175. package/lib/shared/traverser.js +2 -0
  176. package/lib/source-code/source-code.js +11 -12
  177. package/lib/source-code/token-store/backward-token-comment-cursor.js +5 -5
  178. package/lib/source-code/token-store/backward-token-cursor.js +5 -5
  179. package/lib/source-code/token-store/cursors.js +17 -19
  180. package/lib/source-code/token-store/decorative-cursor.js +1 -1
  181. package/lib/source-code/token-store/filter-cursor.js +2 -2
  182. package/lib/source-code/token-store/forward-token-comment-cursor.js +5 -5
  183. package/lib/source-code/token-store/forward-token-cursor.js +5 -5
  184. package/lib/source-code/token-store/index.js +86 -92
  185. package/lib/source-code/token-store/limit-cursor.js +2 -2
  186. package/lib/source-code/token-store/padded-token-cursor.js +7 -7
  187. package/lib/source-code/token-store/skip-cursor.js +2 -2
  188. package/lib/source-code/token-store/utils.js +9 -13
  189. package/package.json +8 -5
package/CHANGELOG.md CHANGED
@@ -1,3 +1,129 @@
1
+ v6.6.0 - October 25, 2019
2
+
3
+ * [`39dfe08`](https://github.com/eslint/eslint/commit/39dfe0880fa934e287e8ea1f7b56d5cba8d43765) Update: false positives in function-call-argument-newline (fixes #12123) (#12280) (Scott O'Hara)
4
+ * [`4d84210`](https://github.com/eslint/eslint/commit/4d842105c9c82026be668d7425213138903d4d41) Update: improve report location for no-trailing-spaces (fixes #12315) (#12477) (Milos Djermanovic)
5
+ * [`c6a7745`](https://github.com/eslint/eslint/commit/c6a7745a1371a85932bfae5fec039d1b6fcfc128) Update: no-trailing-spaces false negatives after comments (fixes #12479) (#12480) (Milos Djermanovic)
6
+ * [`0bffe95`](https://github.com/eslint/eslint/commit/0bffe953d2752dd2d3045f2f8771c96b6cee8fc4) Fix: no-misleading-character-class crash on invalid regex (fixes #12169) (#12347) (Milos Djermanovic)
7
+ * [`c6a9a3b`](https://github.com/eslint/eslint/commit/c6a9a3bc58b69dbf9be9cd09b0283c081ca211e7) Update: Add enforceForIndexOf option to use-isnan (fixes #12207) (#12379) (Milos Djermanovic)
8
+ * [`364877b`](https://github.com/eslint/eslint/commit/364877b2504e8f7ece04770b93d517e2f27458d0) Update: measure plugin loading time and output in debug message (#12395) (Victor Homyakov)
9
+ * [`1744fab`](https://github.com/eslint/eslint/commit/1744faba3c93c869f7dbbf0a704d32e2692d6856) Fix: operator-assignment removes and duplicates comments (#12485) (Milos Djermanovic)
10
+ * [`52ca11a`](https://github.com/eslint/eslint/commit/52ca11a66ab6c2fb5a71d8b9869482f14f98cb9d) Fix: operator-assignment invalid autofix with adjacent tokens (#12483) (Milos Djermanovic)
11
+ * [`0f6d0dc`](https://github.com/eslint/eslint/commit/0f6d0dcdf5adc30079a7379bbf605a4ef3887a85) Fix: CLIEngine#addPlugin reset lastConfigArrays (fixes #12425) (#12468) (Toru Nagashima)
12
+ * [`923a8cb`](https://github.com/eslint/eslint/commit/923a8cb752b8dee1e622c5fd36f3f53288e30602) Chore: Fix lint failure in JSDoc comment (#12489) (Brandon Mills)
13
+ * [`aac3be4`](https://github.com/eslint/eslint/commit/aac3be435cccc241781150fcac728df04d086fa8) Update: Add ignored prop regex no-param-reassign (#11275) (Luke Bennett)
14
+ * [`e5382d6`](https://github.com/eslint/eslint/commit/e5382d6e4eb1344f537b6f107535269e9939fcb8) Chore: Remove unused parameter in dot-location (#12464) (Milos Djermanovic)
15
+ * [`49faefb`](https://github.com/eslint/eslint/commit/49faefbee3fc7daaf2482d9d7d23513d6ffda9e8) Fix: no-obj-calls false positive (fixes #12437) (#12467) (Toru Nagashima)
16
+ * [`b3dbd96`](https://github.com/eslint/eslint/commit/b3dbd9657bbeac6571111a4429b03fc085ba6655) Fix: problematic installation issue (fixes #11018) (#12309) (Toru Nagashima)
17
+ * [`cd7c29b`](https://github.com/eslint/eslint/commit/cd7c29b17085c14c9cf6345201c72a192c0d0e0c) Sponsors: Sync README with website (ESLint Jenkins)
18
+ * [`8233873`](https://github.com/eslint/eslint/commit/8233873b8e5facd80ab7b172bff1e896a9c5fd39) Docs: Add note about Node.js requiring SSL support (fixes #11413) (#12475) (Nicholas C. Zakas)
19
+ * [`89e8aaf`](https://github.com/eslint/eslint/commit/89e8aafcc622a4763bed6b9d62f148ef95798f38) Fix: improve report location for no-tabs (#12471) (Milos Djermanovic)
20
+ * [`7dffe48`](https://github.com/eslint/eslint/commit/7dffe482d646d4e5f94fa87a22f3b5b2e0a4b189) Update: Enable function string option in comma-dangle (fixes #12058) (#12462) (YeonJuan)
21
+ * [`e15e1f9`](https://github.com/eslint/eslint/commit/e15e1f933f287d274a726e7f0f0a1dd80f0964af) Docs: fix doc for no-unneeded-ternary rule (fixes #12098) (#12410) (Sam Rae)
22
+ * [`b1dc58f`](https://github.com/eslint/eslint/commit/b1dc58f0a717cb3d19300c845ca23a21ceb610d3) Sponsors: Sync README with website (ESLint Jenkins)
23
+ * [`61749c9`](https://github.com/eslint/eslint/commit/61749c94bd8a2ebcdfb89e0cd48c4a029a945079) Chore: Provide debug log for parser errors (#12474) (Brad Zacher)
24
+ * [`7c8bbe0`](https://github.com/eslint/eslint/commit/7c8bbe0391944e1f92e083a04715bf4b3fe6be5d) Update: enforceForOrderingRelations no-unsafe-negation (fixes #12163) (#12414) (Sam Rae)
25
+ * [`349ed67`](https://github.com/eslint/eslint/commit/349ed6700e1155384597e1e6035550a96cb8a42d) Update: improve report location for no-mixed-operators (#12328) (Chiawen Chen)
26
+ * [`a102eaa`](https://github.com/eslint/eslint/commit/a102eaa9ac19e1c6d92f79a4033e9048cfb64c0d) Fix: prefer-numeric-literals invalid autofix with adjacent tokens (#12387) (Milos Djermanovic)
27
+ * [`6e7c18d`](https://github.com/eslint/eslint/commit/6e7c18ddb30b32ee5b2e842cc8258aa7aebb7445) Update: enforceForNewInMemberExpressions no-extra-parens (fixes #12428) (#12436) (Milos Djermanovic)
28
+ * [`51fbbd7`](https://github.com/eslint/eslint/commit/51fbbd78f98f223d17071650f5117d07f60dadc2) Fix: array-bracket-newline consistent error with comments (fixes #12416) (#12441) (Milos Djermanovic)
29
+ * [`e657d4c`](https://github.com/eslint/eslint/commit/e657d4ccb9f3dd5cacceaaa40ffe24ac29a1349a) Fix: report full dot location in dot-location (#12452) (Milos Djermanovic)
30
+ * [`2d6e345`](https://github.com/eslint/eslint/commit/2d6e345e3c2626b0f2252f22cfaffdf53ea0871a) Update: make isSpaceBetweenTokens() ignore newline in comments (#12407) (YeonJuan)
31
+ * [`84f71de`](https://github.com/eslint/eslint/commit/84f71de0e686e0fe37b83d6728ce1825caaa44fb) Update: remove default overrides in keyword-spacing (fixes #12369) (#12411) (YeonJuan)
32
+ * [`18a0b0e`](https://github.com/eslint/eslint/commit/18a0b0e3df927428a22b5b5295f9faee4bd57246) Update: improve report location for no-space-in-parens (#12364) (Chiawen Chen)
33
+ * [`d61c8a5`](https://github.com/eslint/eslint/commit/d61c8a5a75447a36276f2d4f84afb3e1129618da) Update: improve report location for no-multi-spaces (#12329) (Chiawen Chen)
34
+ * [`561093f`](https://github.com/eslint/eslint/commit/561093fc4267a4ae317d63bc9f103020fad88802) Upgrade: bump inquirer to ^7.0.0 (#12440) (Joe Graham)
35
+ * [`fb633b2`](https://github.com/eslint/eslint/commit/fb633b2bbd0a390b247047524fdd1f612dbab803) Chore: Add a script for testing with more control (#12444) (Eric Wang)
36
+ * [`012ec51`](https://github.com/eslint/eslint/commit/012ec5151113a2be06fc0e4cd208d714e52dbc57) Sponsors: Sync README with website (ESLint Jenkins)
37
+ * [`874fe16`](https://github.com/eslint/eslint/commit/874fe1642a10a0fb937ccccdd4d22343b84f80dc) New: pass cwd from cli engine (#12389) (Eric Wang)
38
+ * [`b962775`](https://github.com/eslint/eslint/commit/b962775b8cb7c90985a5ab63e56744bb2ba79644) Update: no-self-assign should detect member expression with this (#12279) (Tibor Blenessy)
39
+ * [`02977f2`](https://github.com/eslint/eslint/commit/02977f25a922dd0b8617c16116bb4364d0f30e94) Docs: Clarify `eslint:recommended` semver policy (#12429) (Kevin Partington)
40
+ * [`97045ae`](https://github.com/eslint/eslint/commit/97045ae0805e6503887eef0b131dcb9e70b6d185) Docs: Fixes object type for `rules` in "Use a Plugin" (#12409) (Daisy Develops)
41
+ * [`24ca088`](https://github.com/eslint/eslint/commit/24ca088fdc901feef8f10b050414fbde64b55c7d) Docs: Fix typo in v6 migration guide (#12412) (Benjamim Sonntag)
42
+ * [`b094008`](https://github.com/eslint/eslint/commit/b094008fb196dc1de5b4c27b7dbf0bcbb4b7b352) Chore: update version parameter name (#12402) (Toru Nagashima)
43
+ * [`e5637ba`](https://github.com/eslint/eslint/commit/e5637badd42f087d115f81575b832097fe6fe554) Chore: enable jsdoc/require-description (#12365) (Kai Cataldo)
44
+ * [`d31f337`](https://github.com/eslint/eslint/commit/d31f3370396ec4868722bdc044aa697b135ac183) Sponsors: Sync README with website (ESLint Jenkins)
45
+ * [`7ffb22f`](https://github.com/eslint/eslint/commit/7ffb22f61cf1622511a7fe42b5ead7c3b216df5e) Chore: Clean up inline directive parsing (#12375) (Jordan Eldredge)
46
+ * [`84467c0`](https://github.com/eslint/eslint/commit/84467c07461cc47ee43807ba9014e13700473c5c) Docs: fix wrong max-depth example (fixes #11991) (#12358) (Gabriel R Sezefredo)
47
+ * [`3642342`](https://github.com/eslint/eslint/commit/364234262efabd91fa8bd53161d9d3e1e37e7944) Docs: Fix minor formatting/grammar errors (#12371) (cherryblossom000)
48
+ * [`c47fa0d`](https://github.com/eslint/eslint/commit/c47fa0dfc76211b3b0e5649c63acdd9606ce0eca) Docs: Fix missing word in sentence (#12361) (Dan Boulet)
49
+ * [`8108f49`](https://github.com/eslint/eslint/commit/8108f49f9fa0c2de80b3b66c847551beff585951) Chore: enable additional eslint-plugin-jsdoc rules (#12336) (Kai Cataldo)
50
+ * [`b718d2e`](https://github.com/eslint/eslint/commit/b718d2e6c9fe3fc56aa7cfc68b1a40b5cd8a7c01) Chore: update issue template with --eslint-fix flag (#12352) (James George)
51
+ * [`20ba14d`](https://github.com/eslint/eslint/commit/20ba14dc78fc2654b2920d14877dde21c6c10da4) Sponsors: Sync README with website (ESLint Jenkins)
52
+ * [`566a947`](https://github.com/eslint/eslint/commit/566a947f67c8038a50e204d68723519778a78a0f) Sponsors: Sync README with website (ESLint Jenkins)
53
+ * [`070cbd0`](https://github.com/eslint/eslint/commit/070cbd0a2ec07831962a25c4276d08e097302416) Sponsors: Sync README with website (ESLint Jenkins)
54
+
55
+ v6.5.1 - September 30, 2019
56
+
57
+ * [`0d3d7d9`](https://github.com/eslint/eslint/commit/0d3d7d9cdd83a7f0e035c95f716a91b9ecc4868b) Docs: fix typo in no-magic-numbers (#12345) (Josiah Rooney)
58
+ * [`447ac87`](https://github.com/eslint/eslint/commit/447ac877e8ca2858d61b1e983f72d39e3e2ca74d) Fix: no-useless-rename handles ExperimentalRestProperty (fixes #12335) (#12339) (Kai Cataldo)
59
+ * [`b6ff73c`](https://github.com/eslint/eslint/commit/b6ff73cad13282fbfc91186cf4bc2f20278a8936) Sponsors: Sync README with website (ESLint Jenkins)
60
+
61
+ v6.5.0 - September 29, 2019
62
+
63
+ * [`73596cb`](https://github.com/eslint/eslint/commit/73596cbdf0a12e2878b2994783f9b969b0c5fbeb) Update: Add enforceForSwitchCase option to use-isnan (#12106) (Milos Djermanovic)
64
+ * [`d592a24`](https://github.com/eslint/eslint/commit/d592a248d67920f7200925c003f10853d29f1f8d) Fix: exclude `\u000d` so new line won't convert to text (fixes #12027) (#12031) (zamboney)
65
+ * [`e85d27a`](https://github.com/eslint/eslint/commit/e85d27af427d6185ac553a0d801b5103153426d4) Fix: no-regex-spaces false positives and invalid autofix (fixes #12226) (#12231) (Milos Djermanovic)
66
+ * [`b349bf7`](https://github.com/eslint/eslint/commit/b349bf79ad56dded826bc99cb52c3551af34fa63) Fix: prefer-named-capture-group incorrect locations (fixes #12233) (#12247) (Milos Djermanovic)
67
+ * [`7dc1ea9`](https://github.com/eslint/eslint/commit/7dc1ea9a1b9a21daaffcf712ba9c0e91af81b906) Fix: no-useless-return autofix removes comments (#12292) (Milos Djermanovic)
68
+ * [`0e68677`](https://github.com/eslint/eslint/commit/0e68677ec0aaf060a071ecf71e4af954dddb6af0) Fix: no-extra-bind autofix removes comments (#12293) (Milos Djermanovic)
69
+ * [`6ad7e86`](https://github.com/eslint/eslint/commit/6ad7e864303e56a39c89569d50c6caf80752ee21) Fix: no-extra-label autofix removes comments (#12298) (Milos Djermanovic)
70
+ * [`acec201`](https://github.com/eslint/eslint/commit/acec201f06df780791179ad92cfc484f9b6d23d4) Fix: no-undef-init autofix removes comments (#12299) (Milos Djermanovic)
71
+ * [`d89390b`](https://github.com/eslint/eslint/commit/d89390b75e3e9993f347387a49b0ac5550f45c7f) Fix: use async reading of stdin in bin/eslint.js (fixes #12212) (#12230) (Barrie Treloar)
72
+ * [`334ca7c`](https://github.com/eslint/eslint/commit/334ca7c8b9c18ac097849c1cefaa43097a4e51dc) Update: no-useless-rename also reports default values (fixes #12301) (#12322) (Kai Cataldo)
73
+ * [`41bfe91`](https://github.com/eslint/eslint/commit/41bfe919c06932b7e58cd9ead20157e06656160a) Update: Fix handling of chained new expressions in new-parens (#12303) (Milos Djermanovic)
74
+ * [`160b7c4`](https://github.com/eslint/eslint/commit/160b7c46b556ccb6023eb411a8be8801a4bda6df) Chore: add autofix npm script (#12330) (Kai Cataldo)
75
+ * [`04b6adb`](https://github.com/eslint/eslint/commit/04b6adb7f1bcb2b6cb3fa377b1ca4cecd810630e) Chore: enable eslint-plugin-jsdoc (refs #11146) (#12332) (Kai Cataldo)
76
+ * [`9b86167`](https://github.com/eslint/eslint/commit/9b86167e6f053e4a72bf68ebc79db53903f7f8c3) Docs: Add new ES environments to Configuring ESLint (#12289) (Milos Djermanovic)
77
+ * [`c9aeab2`](https://github.com/eslint/eslint/commit/c9aeab21a71c6743f51163b7a8fdf4f0cbfcdbde) Docs: Add supported ECMAScript version to README (#12290) (Milos Djermanovic)
78
+ * [`8316e7b`](https://github.com/eslint/eslint/commit/8316e7be5a9429513d7ecf2ee2afc40ab4415b8f) Fix: no-useless-rename autofix removes comments (#12300) (Milos Djermanovic)
79
+ * [`29c12f1`](https://github.com/eslint/eslint/commit/29c12f18726a3afb21fc89ab1bdacc6972d49e68) Chore: cache results in runtime-info (#12320) (Kai Cataldo)
80
+ * [`f5537b2`](https://github.com/eslint/eslint/commit/f5537b2ed0b0b5e51a34c22cdd4ebfd024eaea3d) Fix: prefer-numeric-literals autofix removes comments (#12313) (Milos Djermanovic)
81
+ * [`11ae6fc`](https://github.com/eslint/eslint/commit/11ae6fcb5d5503e5dea41c02780369efe51f0bb9) Update: Fix call, new and member expressions in no-extra-parens (#12302) (Milos Djermanovic)
82
+ * [`a7894eb`](https://github.com/eslint/eslint/commit/a7894ebb43523152d36720efa770bb1fe8b58c07) New: add --env-info flag to CLI (#12270) (Kai Cataldo)
83
+ * [`61392ff`](https://github.com/eslint/eslint/commit/61392ff5ec660bfc01ac2ff0e9660d259cf88fd6) Sponsors: Sync README with website (ESLint Jenkins)
84
+ * [`2c6bf8e`](https://github.com/eslint/eslint/commit/2c6bf8ea9c8a8f94746f980bd5bea0a8c5c4d6b7) Docs: English fix (#12306) (Daniel Nixon)
85
+ * [`6f11877`](https://github.com/eslint/eslint/commit/6f118778366613fc53036cb6a7537e1b4c6e7af8) Sponsors: Sync README with website (ESLint Jenkins)
86
+ * [`2e202ca`](https://github.com/eslint/eslint/commit/2e202ca2228846e6226aa8dd99c614d572fb86a8) Docs: fix links in array-callback-return (#12288) (Milos Djermanovic)
87
+ * [`e39c631`](https://github.com/eslint/eslint/commit/e39c6318af0fd27edd5fd2aaf2b24a3e204005dd) Docs: add example for CLIEngine#executeOnText 3rd arg (#12286) (Kai Cataldo)
88
+ * [`d4f9a16`](https://github.com/eslint/eslint/commit/d4f9a16af7e00021e2ed63823d9c2f149bc985d6) Update: add support for JSXFragments in indent rule (fixes #12208) (#12210) (Kai Cataldo)
89
+ * [`c6af95f`](https://github.com/eslint/eslint/commit/c6af95f5bf1ef10f08545d54fd52b98e85fdf7f7) Sponsors: Sync README with website (ESLint Jenkins)
90
+ * [`8cadd52`](https://github.com/eslint/eslint/commit/8cadd5229b7372aed0d4785dcae15532a399bf55) Sponsors: Sync README with website (ESLint Jenkins)
91
+ * [`f9fc695`](https://github.com/eslint/eslint/commit/f9fc695d77c19cd5ecb3f0e97e1ea124c8543409) Chore: enable default-param-last (#12244) (薛定谔的猫)
92
+ * [`9984c3e`](https://github.com/eslint/eslint/commit/9984c3e27c92de76b8c05a58525dbcea12b10b83) Docs: Update README team and sponsors (ESLint Jenkins)
93
+
94
+ v6.4.0 - September 13, 2019
95
+
96
+ * [`e915fff`](https://github.com/eslint/eslint/commit/e915fffb6089a23ff1cae926cc607f9b87dc1819) Docs: Improve examples and clarify default option (#12067) (Yuping Zuo)
97
+ * [`540296f`](https://github.com/eslint/eslint/commit/540296fcecd232a09dc873a5a22f5839b59b7842) Update: enforceForClassMembers option to accessor-pairs (fixes #12063) (#12192) (Milos Djermanovic)
98
+ * [`d3c2334`](https://github.com/eslint/eslint/commit/d3c2334646eae9287d5be9e457d041e445efb512) Update: flag nested block with declaration as error (#12193) (David Waller)
99
+ * [`b2498d2`](https://github.com/eslint/eslint/commit/b2498d284b9c30ed1543429c2f45d9014e12fe22) Update: Fix handling of property names in no-self-assign (#12105) (Milos Djermanovic)
100
+ * [`1ee61b0`](https://github.com/eslint/eslint/commit/1ee61b06715fcc750be2c923034a1e59ba663287) Update: enforceForClassMembers computed-property-spacing (fixes #12049) (#12214) (Milos Djermanovic)
101
+ * [`520c922`](https://github.com/eslint/eslint/commit/520c92270eed6e90c1a796e8af275980f01705e0) Docs: Added naming convention details to plugin usage (#12202) (Henrique Barcelos)
102
+ * [`f826eab`](https://github.com/eslint/eslint/commit/f826eabbeecddb047f58f4e7308a14c18148d369) Fix: Allow line comment exception in object-curly-spacing (fixes #11902) (#12216) (Milos Djermanovic)
103
+ * [`db2a29b`](https://github.com/eslint/eslint/commit/db2a29beb0fa28183f65bf9e659c66c03a8918b5) Update: indentation of comment followed by semicolon (fixes #12232) (#12243) (Kai Cataldo)
104
+ * [`ae17d1c`](https://github.com/eslint/eslint/commit/ae17d1ca59dd466aa64da0680ec2453c2dc3b80d) Fix: no-sequences is reporting incorrect locations (#12241) (Milos Djermanovic)
105
+ * [`365331a`](https://github.com/eslint/eslint/commit/365331a42e22af5a77ac9cfa9673d6a8f653eb5a) Fix: object-shorthand providing invalid fixes for typescript (#12260) (Brad Zacher)
106
+ * [`1c921c6`](https://github.com/eslint/eslint/commit/1c921c6dfd7ddfb0308c8103e53d32c1241475f0) New: add no-import-assign (fixes #12237) (#12252) (Toru Nagashima)
107
+ * [`3be04fd`](https://github.com/eslint/eslint/commit/3be04fd6a4e7b3f5a5ecb845a29cf29b71fe2dfb) New: Add prefer-regex-literals rule (fixes #12238) (#12254) (Milos Djermanovic)
108
+ * [`37c0fde`](https://github.com/eslint/eslint/commit/37c0fdeb87b92a0b779b125adf45535b79b65757) Update: Report global Atomics calls in no-obj-calls (fixes #12234) (#12258) (Milos Djermanovic)
109
+ * [`985c9e5`](https://github.com/eslint/eslint/commit/985c9e5eba351965a8a1491a41dbdcc78154b8f4) Fix: space-before-function-paren autofix removes comments (fixes #12259) (#12264) (Milos Djermanovic)
110
+ * [`01da7d0`](https://github.com/eslint/eslint/commit/01da7d04c4e5a7376cf241ec02db7971726a1bf9) Fix: eqeqeq rule reports incorrect locations (#12265) (Milos Djermanovic)
111
+ * [`319e4d8`](https://github.com/eslint/eslint/commit/319e4d8386ea846928f0f906c251b46043a53491) Docs: adding finally example (#12256) (Jens Melgaard)
112
+ * [`d52328f`](https://github.com/eslint/eslint/commit/d52328f012f3704c7d1ce39427e63f80531c7979) Docs: fix no-sequences `with` examples (#12239) (Milos Djermanovic)
113
+ * [`a41fdc0`](https://github.com/eslint/eslint/commit/a41fdc07404a7675d14183fab245fb8f49dcb858) Fix: Remove autofixer for no-unsafe-negation (#12157) (Milos Djermanovic)
114
+ * [`e38f5fd`](https://github.com/eslint/eslint/commit/e38f5fdfc786363a3eae642f1a69a8725600aa61) Update: fix no-octal-escape false negatives after \0 (#12079) (Milos Djermanovic)
115
+ * [`9418fbe`](https://github.com/eslint/eslint/commit/9418fbe0eb31cace3debe27b620709628df2fad7) Sponsors: Sync README with website (ESLint Jenkins)
116
+ * [`acc5ec5`](https://github.com/eslint/eslint/commit/acc5ec5082aed466a29899f651e6767b39155aec) Sponsors: Sync README with website (ESLint Jenkins)
117
+ * [`460c5ad`](https://github.com/eslint/eslint/commit/460c5ad176eaf39ff579cd96b3bcbe0539093f8f) Sponsors: Sync README with website (ESLint Jenkins)
118
+ * [`0313441`](https://github.com/eslint/eslint/commit/0313441d016c8aa0674c135f9da67a676e766ec5) New: add rule default-param-last (fixes #11361) (#12188) (Chiawen Chen)
119
+ * [`7621f5d`](https://github.com/eslint/eslint/commit/7621f5d2aa7d87e798b75ca47d6889c280597e99) Update: add more specific linting messages to space-in-parens (#11121) (Che Fisher)
120
+ * [`21eb904`](https://github.com/eslint/eslint/commit/21eb9044135c01b6c12188517bba840614483fc6) Fix: basePath of OverrideTester (fixes #12032) (#12205) (Toru Nagashima)
121
+ * [`86e5e65`](https://github.com/eslint/eslint/commit/86e5e657ea3fbf12b10524abcbc197afd215a060) Sponsors: Sync README with website (ESLint Jenkins)
122
+ * [`2b1a13f`](https://github.com/eslint/eslint/commit/2b1a13fa0de8360586857f3ced8da514c971297d) Fix: no-extra-boolean-cast reports wrong negation node (fixes #11324) (#12197) (Milos Djermanovic)
123
+ * [`ba8c2aa`](https://github.com/eslint/eslint/commit/ba8c2aa0154561fbeca33db0343cb39a7fbd9b4f) Sponsors: Sync README with website (ESLint Jenkins)
124
+ * [`a0a9746`](https://github.com/eslint/eslint/commit/a0a9746724ccd22c721ddc1b25c566aa9acea154) Docs: Fix link in no-irregular-whitespace.md (#12196) (Timo Tijhof)
125
+ * [`e10eeba`](https://github.com/eslint/eslint/commit/e10eebab4abd193dee697c4de7fb2d95bbab2d8c) Fix: quotes autofix produces syntax error with octal escape sequences (#12118) (Milos Djermanovic)
126
+
1
127
  v6.3.0 - August 30, 2019
2
128
 
3
129
  * [`0acdefb`](https://github.com/eslint/eslint/commit/0acdefb97f35bb09db2910540c70dc377a01ad62) Chore: refactor code (#12113) (James George)
package/README.md CHANGED
@@ -40,7 +40,7 @@ ESLint is a tool for identifying and reporting on patterns found in ECMAScript/J
40
40
 
41
41
  ## <a name="installation-and-usage"></a>Installation and Usage
42
42
 
43
- Prerequisites: [Node.js](https://nodejs.org/) (`^8.10.0`, `^10.13.0`, or `>=11.10.1`), npm version 3+.
43
+ Prerequisites: [Node.js](https://nodejs.org/) (`^8.10.0`, `^10.13.0`, or `>=11.10.1`) built with SSL support. (If you are using an official Node.js distribution, SSL is always built in.)
44
44
 
45
45
  You can install ESLint using npm:
46
46
 
@@ -120,7 +120,7 @@ Yes, ESLint natively supports parsing JSX syntax (this must be enabled in [confi
120
120
 
121
121
  ### What ECMAScript versions does ESLint support?
122
122
 
123
- ESLint has full support for ECMAScript 3, 5 (default), 2015, 2016, 2017, and 2018. You can set your desired ECMAScript syntax (and other settings, like global variables or your target environments) through [configuration](https://eslint.org/docs/user-guide/configuring).
123
+ ESLint has full support for ECMAScript 3, 5 (default), 2015, 2016, 2017, 2018, and 2019. You can set your desired ECMAScript syntax (and other settings, like global variables or your target environments) through [configuration](https://eslint.org/docs/user-guide/configuring).
124
124
 
125
125
  ### What about experimental features?
126
126
 
@@ -156,8 +156,9 @@ ESLint follows [semantic versioning](https://semver.org). However, due to the na
156
156
  * A new CLI capability is created.
157
157
  * New capabilities to the public API are added (new classes, new methods, new arguments to existing methods, etc.).
158
158
  * A new formatter is created.
159
+ * `eslint:recommended` is updated and will result in strictly fewer errors (e.g., rule removals).
159
160
  * Major release (likely to break your lint build)
160
- * `eslint:recommended` is updated.
161
+ * `eslint:recommended` is updated and may result in new errors (e.g., rule additions, most rule option updates).
161
162
  * A new option to an existing rule that results in ESLint reporting more errors by default.
162
163
  * An existing formatter is removed.
163
164
  * Part of the public API is removed or changed in an incompatible way.
@@ -210,11 +211,6 @@ Toru Nagashima
210
211
  Gyandeep Singh
211
212
  </a>
212
213
  </td><td align="center" valign="top" width="11%">
213
- <a href="https://github.com/kaicataldo">
214
- <img src="https://github.com/kaicataldo.png?s=75" width="75" height="75"><br />
215
- Kai Cataldo
216
- </a>
217
- </td><td align="center" valign="top" width="11%">
218
214
  <a href="https://github.com/not-an-aardvark">
219
215
  <img src="https://github.com/not-an-aardvark.png?s=75" width="75" height="75"><br />
220
216
  Teddy Katz
@@ -241,6 +237,11 @@ The people who review and implement new features.
241
237
  The people who review and fix bugs and help triage issues.
242
238
 
243
239
  <table><tbody><tr><td align="center" valign="top" width="11%">
240
+ <a href="https://github.com/kaicataldo">
241
+ <img src="https://github.com/kaicataldo.png?s=75" width="75" height="75"><br />
242
+ Kai Cataldo
243
+ </a>
244
+ </td><td align="center" valign="top" width="11%">
244
245
  <a href="https://github.com/g-plane">
245
246
  <img src="https://github.com/g-plane.png?s=75" width="75" height="75"><br />
246
247
  Pig Fang
@@ -262,9 +263,9 @@ The following companies, organizations, and individuals support ESLint's ongoing
262
263
  <!-- NOTE: This section is autogenerated. Do not manually edit.-->
263
264
  <!--sponsorsstart-->
264
265
  <h3>Gold Sponsors</h3>
265
- <p><a href="https://www.shopify.com"><img src="https://images.opencollective.com/shopify/eeb91aa/logo.png" alt="Shopify" height="96"></a> <a href="http://engineering.salesforce.com"><img src="https://images.opencollective.com/salesforce/d1b37c4/logo.png" alt="Salesforce" height="96"></a> <a href="https://badoo.com/team?utm_source=eslint"><img src="https://images.opencollective.com/badoo/2826a3b/logo.png" alt="Badoo" height="96"></a> <a href="https://www.airbnb.com/"><img src="https://images.opencollective.com/airbnb/001a341/logo.png" alt="Airbnb" height="96"></a> <a href="https://code.facebook.com/projects/"><img src="https://images.opencollective.com/fbopensource/fbb8a5b/logo.png" alt="Facebook Open Source" height="96"></a></p><h3>Silver Sponsors</h3>
266
+ <p><a href="https://www.shopify.com"><img src="https://images.opencollective.com/shopify/eeb91aa/logo.png" alt="Shopify" height="96"></a> <a href="http://engineering.salesforce.com"><img src="https://images.opencollective.com/salesforce/ca8f997/logo.png" alt="Salesforce" height="96"></a> <a href="https://badoo.com/team?utm_source=eslint"><img src="https://images.opencollective.com/badoo/2826a3b/logo.png" alt="Badoo" height="96"></a> <a href="https://www.airbnb.com/"><img src="https://images.opencollective.com/airbnb/d327d66/logo.png" alt="Airbnb" height="96"></a> <a href="https://opensource.facebook.com"><img src="https://images.opencollective.com/fbopensource/fbb8a5b/logo.png" alt="Facebook Open Source" height="96"></a></p><h3>Silver Sponsors</h3>
266
267
  <p><a href="https://www.ampproject.org/"><img src="https://images.opencollective.com/amp/c8a3b25/logo.png" alt="AMP Project" height="64"></a></p><h3>Bronze Sponsors</h3>
267
- <p><a href="https://www.vpsserver.com"><img src="https://images.opencollective.com/vpsservercom/logo.png" alt="VPS Server" height="32"></a> <a href="https://icons8.com"><img src="https://images.opencollective.com/icons8/0b37d14/logo.png" alt="Free Icons by Icons8" height="32"></a> <a href="https://uxplanet.org/top-ui-ux-design-agencies-user-experience-firms-8c54697e290"><img src="https://images.opencollective.com/ui-ux-design-agencies/cae5dfe/logo.png" alt="UI UX Design Agencies" height="32"></a> <a href="https://clay.global"><img src="https://images.opencollective.com/clayglobal/2468f34/logo.png" alt="clay" height="32"></a> <a href="https://discordapp.com"><img src="https://images.opencollective.com/discordapp/7e3d9a9/logo.png" alt="Discord" height="32"></a> <a href="https://themeisle.com"><img src="https://images.opencollective.com/themeisle/logo.png" alt="ThemeIsle" height="32"></a> <a href="https://tekhattan.com"><img src="https://images.opencollective.com/tekhattan/bc73c28/logo.png" alt="TekHattan" height="32"></a> <a href="https://www.marfeel.com/"><img src="https://images.opencollective.com/marfeel/4b88e30/logo.png" alt="Marfeel" height="32"></a> <a href="http://www.firesticktricks.com"><img src="https://images.opencollective.com/fire-stick-tricks/b8fbe2c/logo.png" alt="Fire Stick Tricks" height="32"></a> <a href="https://jsheroes.io/"><img src="https://images.opencollective.com/jsheroes1/9fedf0b/logo.png" alt="JSHeroes " height="32"></a></p>
268
+ <p><a href="https://uxplanet.org/top-ui-ux-design-agencies-user-experience-firms-8c54697e290"><img src="https://images.opencollective.com/ui-ux-design-agencies/cae5dfe/logo.png" alt="UI UX Design Agencies" height="32"></a> <a href="https://www.bugsnag.com/platforms?utm_source=Open Collective&utm_medium=Website&utm_content=open-source&utm_campaign=2019-community&utm_term="><img src="https://images.opencollective.com/bugsnag-stability-monitoring/c2cef36/logo.png" alt="Bugsnag Stability Monitoring" height="32"></a> <a href="https://www.minitool.com"><img src="https://images.opencollective.com/minitool-software-ltd/6d68e16/logo.png" alt="MiniTool Software Ltd" height="32"></a> <a href="https://www.codacy.com/?utm_source=eslint&utm_medium=cpm&utm_campaign=eslint-sponsorship"><img src="https://images.opencollective.com/codacy/ed22716/logo.png" alt="Codacy" height="32"></a> <a href="https://mixpanel.com"><img src="https://images.opencollective.com/mixpanel/cd682f7/logo.png" alt="Mixpanel" height="32"></a> <a href="https://www.vpsserver.com"><img src="https://images.opencollective.com/vpsservercom/logo.png" alt="VPS Server" height="32"></a> <a href="https://icons8.com"><img src="https://images.opencollective.com/icons8/0b37d14/logo.png" alt="Free Icons by Icons8" height="32"></a> <a href="https://www.crosswordsolver.com"><img src="https://images.opencollective.com/crosswordsolver/d4481d6/logo.png" alt="Crosswordsolver" height="32"></a> <a href="https://clay.global"><img src="https://images.opencollective.com/clayglobal/2468f34/logo.png" alt="clay" height="32"></a> <a href="https://discordapp.com"><img src="https://images.opencollective.com/discordapp/7e3d9a9/logo.png" alt="Discord" height="32"></a> <a href="https://themeisle.com"><img src="https://images.opencollective.com/themeisle/logo.png" alt="ThemeIsle" height="32"></a> <a href="https://tekhattan.com"><img src="https://images.opencollective.com/tekhattan/bc73c28/logo.png" alt="TekHattan" height="32"></a> <a href="https://www.marfeel.com/"><img src="https://images.opencollective.com/marfeel/4b88e30/logo.png" alt="Marfeel" height="32"></a> <a href="http://www.firesticktricks.com"><img src="https://images.opencollective.com/fire-stick-tricks/b8fbe2c/logo.png" alt="Fire Stick Tricks" height="32"></a> <a href="https://jsheroes.io/"><img src="https://images.opencollective.com/jsheroes1/9fedf0b/logo.png" alt="JSHeroes " height="32"></a></p>
268
269
  <!--sponsorsend-->
269
270
 
270
271
  ## <a name="technology-sponsors"></a>Technology Sponsors
package/bin/eslint.js CHANGED
@@ -16,9 +16,9 @@ require("v8-compile-cache");
16
16
  // Helpers
17
17
  //------------------------------------------------------------------------------
18
18
 
19
- const useStdIn = (process.argv.indexOf("--stdin") > -1),
20
- init = (process.argv.indexOf("--init") > -1),
21
- debug = (process.argv.indexOf("--debug") > -1);
19
+ const useStdIn = process.argv.includes("--stdin"),
20
+ init = process.argv.includes("--init"),
21
+ debug = process.argv.includes("--debug");
22
22
 
23
23
  // must do this initialization *before* other requires in order to work
24
24
  if (debug) {
@@ -30,9 +30,9 @@ if (debug) {
30
30
  //------------------------------------------------------------------------------
31
31
 
32
32
  // now we can safely include the other modules that use debug
33
- const cli = require("../lib/cli"),
34
- path = require("path"),
35
- fs = require("fs");
33
+ const path = require("path"),
34
+ fs = require("fs"),
35
+ cli = require("../lib/cli");
36
36
 
37
37
  //------------------------------------------------------------------------------
38
38
  // Execution
@@ -50,7 +50,6 @@ process.once("uncaughtException", err => {
50
50
  console.error("\nOops! Something went wrong! :(");
51
51
  console.error(`\nESLint: ${pkg.version}.\n\n${template(err.messageData || {})}`);
52
52
  } else {
53
-
54
53
  console.error(err.stack);
55
54
  }
56
55
 
@@ -60,13 +59,40 @@ process.once("uncaughtException", err => {
60
59
  if (useStdIn) {
61
60
 
62
61
  /*
63
- * Note: `process.stdin.fd` is not used here due to https://github.com/nodejs/node/issues/7439.
64
- * Accessing the `process.stdin` property seems to modify the behavior of file descriptor 0, resulting
65
- * in an error when stdin is piped in asynchronously.
62
+ * Note: See
63
+ * - https://github.com/nodejs/node/blob/master/doc/api/process.md#processstdin
64
+ * - https://github.com/nodejs/node/blob/master/doc/api/process.md#a-note-on-process-io
65
+ * - https://lists.gnu.org/archive/html/bug-gnu-emacs/2016-01/msg00419.html
66
+ * - https://github.com/nodejs/node/issues/7439 (historical)
67
+ *
68
+ * On Windows using `fs.readFileSync(STDIN_FILE_DESCRIPTOR, "utf8")` seems
69
+ * to read 4096 bytes before blocking and never drains to read further data.
70
+ *
71
+ * The investigation on the Emacs thread indicates:
72
+ *
73
+ * > Emacs on MS-Windows uses pipes to communicate with subprocesses; a
74
+ * > pipe on Windows has a 4K buffer. So as soon as Emacs writes more than
75
+ * > 4096 bytes to the pipe, the pipe becomes full, and Emacs then waits for
76
+ * > the subprocess to read its end of the pipe, at which time Emacs will
77
+ * > write the rest of the stuff.
78
+ *
79
+ * Using the nodejs code example for reading from stdin.
66
80
  */
67
- const STDIN_FILE_DESCRIPTOR = 0;
81
+ let contents = "",
82
+ chunk = "";
83
+
84
+ process.stdin.setEncoding("utf8");
85
+ process.stdin.on("readable", () => {
68
86
 
69
- process.exitCode = cli.execute(process.argv, fs.readFileSync(STDIN_FILE_DESCRIPTOR, "utf8"));
87
+ // Use a loop to make sure we read all available data.
88
+ while ((chunk = process.stdin.read()) !== null) {
89
+ contents += chunk;
90
+ }
91
+ });
92
+
93
+ process.stdin.on("end", () => {
94
+ process.exitCode = cli.execute(process.argv, contents, "utf8");
95
+ });
70
96
  } else if (init) {
71
97
  const configInit = require("../lib/init/config-initializer");
72
98
 
@@ -152,8 +152,9 @@ function createCLIConfigArray({
152
152
  */
153
153
  class ConfigurationNotFoundError extends Error {
154
154
 
155
+ // eslint-disable-next-line jsdoc/require-description
155
156
  /**
156
- * @param {string} directoryPath - The directory path.
157
+ * @param {string} directoryPath The directory path.
157
158
  */
158
159
  constructor(directoryPath) {
159
160
  super(`No ESLint configuration found in ${directoryPath}.`);
@@ -85,8 +85,8 @@ const validFixTypes = new Set(["problem", "suggestion", "layout"]);
85
85
  * @property {number} warningCount Number of warnings for the result.
86
86
  * @property {number} fixableErrorCount Number of fixable errors for the result.
87
87
  * @property {number} fixableWarningCount Number of fixable warnings for the result.
88
- * @property {string=} [source] The source code of the file that was linted.
89
- * @property {string=} [output] The source code of the file that was linted, with as many fixes applied as possible.
88
+ * @property {string} [source] The source code of the file that was linted.
89
+ * @property {string} [output] The source code of the file that was linted, with as many fixes applied as possible.
90
90
  */
91
91
 
92
92
  /**
@@ -145,7 +145,7 @@ function validateFixTypes(fixTypes) {
145
145
 
146
146
  /**
147
147
  * It will calculate the error and warning count for collection of messages per file
148
- * @param {LintMessage[]} messages - Collection of messages
148
+ * @param {LintMessage[]} messages Collection of messages
149
149
  * @returns {Object} Contains the stats
150
150
  * @private
151
151
  */
@@ -173,7 +173,7 @@ function calculateStatsPerFile(messages) {
173
173
 
174
174
  /**
175
175
  * It will calculate the error and warning count for collection of results from all files
176
- * @param {LintResult[]} results - Collection of messages from all the files
176
+ * @param {LintResult[]} results Collection of messages from all the files
177
177
  * @returns {Object} Contains the stats
178
178
  * @private
179
179
  */
@@ -272,8 +272,8 @@ function verifyText({
272
272
 
273
273
  /**
274
274
  * Returns result with warning by ignore settings
275
- * @param {string} filePath - File path of checked code
276
- * @param {string} baseDir - Absolute path of base directory
275
+ * @param {string} filePath File path of checked code
276
+ * @param {string} baseDir Absolute path of base directory
277
277
  * @returns {LintResult} Result with single warning
278
278
  * @private
279
279
  */
@@ -329,7 +329,6 @@ function getRule(ruleId, configArrays) {
329
329
  /**
330
330
  * Collect used deprecated rules.
331
331
  * @param {ConfigArray[]} usedConfigArrays The config arrays which were used.
332
- * @param {Map<string, Object>} ruleMap The rule definitions which were used (built-ins).
333
332
  * @returns {IterableIterator<DeprecatedRuleInfo>} Used deprecated rules.
334
333
  */
335
334
  function *iterateRuleDeprecationWarnings(usedConfigArrays) {
@@ -388,7 +387,6 @@ function isErrorMessage(message) {
388
387
  * name will be the `cacheFile/.cache_hashOfCWD`
389
388
  *
390
389
  * if cacheFile points to a file or looks like a file then in will just use that file
391
- *
392
390
  * @param {string} cacheFile The name of file to be used to store the cache
393
391
  * @param {string} cwd Current working directory
394
392
  * @returns {string} the resolved path to the cache file
@@ -530,7 +528,6 @@ class CLIEngine {
530
528
  /**
531
529
  * Creates a new instance of the core CLI engine.
532
530
  * @param {CLIEngineOptions} providedOptions The options for this instance.
533
- * @constructor
534
531
  */
535
532
  constructor(providedOptions) {
536
533
  const options = Object.assign(
@@ -570,7 +567,7 @@ class CLIEngine {
570
567
  });
571
568
  const lintResultCache =
572
569
  options.cache ? new LintResultCache(cacheFilePath) : null;
573
- const linter = new Linter();
570
+ const linter = new Linter({ cwd: options.cwd });
574
571
 
575
572
  /** @type {ConfigArray[]} */
576
573
  const lastConfigArrays = [configArrayFactory.getConfigArrayForFile()];
@@ -670,11 +667,14 @@ class CLIEngine {
670
667
  addPlugin(name, pluginObject) {
671
668
  const {
672
669
  additionalPluginPool,
673
- configArrayFactory
670
+ configArrayFactory,
671
+ lastConfigArrays
674
672
  } = internalSlotsMap.get(this);
675
673
 
676
674
  additionalPluginPool.set(name, pluginObject);
677
675
  configArrayFactory.clearCache();
676
+ lastConfigArrays.length = 1;
677
+ lastConfigArrays[0] = configArrayFactory.getConfigArrayForFile();
678
678
  }
679
679
 
680
680
  /**
@@ -126,7 +126,6 @@ function isNonNullObject(x) {
126
126
  *
127
127
  * Assign every property values of `y` to `x` if `x` doesn't have the property.
128
128
  * If `x`'s property value is an object, it does recursive.
129
- *
130
129
  * @param {Object} target The destination to merge
131
130
  * @param {Object|undefined} source The source to merge.
132
131
  * @returns {void}
@@ -157,7 +156,6 @@ function mergeWithoutOverwrite(target, source) {
157
156
  /**
158
157
  * Merge plugins.
159
158
  * `target`'s definition is prior to `source`'s.
160
- *
161
159
  * @param {Record<string, DependentPlugin>} target The destination to merge
162
160
  * @param {Record<string, DependentPlugin>|undefined} source The source to merge.
163
161
  * @returns {void}
@@ -187,7 +185,6 @@ function mergePlugins(target, source) {
187
185
  /**
188
186
  * Merge rule configs.
189
187
  * `target`'s definition is prior to `source`'s.
190
- *
191
188
  * @param {Record<string, Array>} target The destination to merge
192
189
  * @param {Record<string, RuleConf>|undefined} source The source to merge.
193
190
  * @returns {void}
@@ -382,7 +379,6 @@ function ensurePluginMemberMaps(instance) {
382
379
  * You need to call `ConfigArray#extractConfig(filePath)` method in order to
383
380
  * extract, merge and get only the config data which is related to an arbitrary
384
381
  * file.
385
- *
386
382
  * @extends {Array<ConfigArrayElement>}
387
383
  */
388
384
  class ConfigArray extends Array {
@@ -81,6 +81,7 @@ class ConfigDependency {
81
81
  this.importerPath = importerPath;
82
82
  }
83
83
 
84
+ // eslint-disable-next-line jsdoc/require-description
84
85
  /**
85
86
  * @returns {Object} a JSON compatible object.
86
87
  */
@@ -95,6 +96,7 @@ class ConfigDependency {
95
96
  return obj;
96
97
  }
97
98
 
99
+ // eslint-disable-next-line jsdoc/require-description
98
100
  /**
99
101
  * @returns {Object} an object to display by `console.log()`.
100
102
  */
@@ -125,10 +125,10 @@ class OverrideTester {
125
125
  */
126
126
  static and(a, b) {
127
127
  if (!b) {
128
- return a;
128
+ return a && new OverrideTester(a.patterns, a.basePath);
129
129
  }
130
130
  if (!a) {
131
- return b;
131
+ return new OverrideTester(b.patterns, b.basePath);
132
132
  }
133
133
 
134
134
  assert.strictEqual(a.basePath, b.basePath);
@@ -166,6 +166,7 @@ class OverrideTester {
166
166
  ));
167
167
  }
168
168
 
169
+ // eslint-disable-next-line jsdoc/require-description
169
170
  /**
170
171
  * @returns {Object} a JSON compatible object.
171
172
  */
@@ -182,6 +183,7 @@ class OverrideTester {
182
183
  };
183
184
  }
184
185
 
186
+ // eslint-disable-next-line jsdoc/require-description
185
187
  /**
186
188
  * @returns {Object} an object to display by `console.log()`.
187
189
  */
@@ -859,8 +859,14 @@ class ConfigArrayFactory {
859
859
  if (filePath) {
860
860
  try {
861
861
  writeDebugLogForLoading(request, relativeTo, filePath);
862
+
863
+ const startTime = Date.now();
864
+ const pluginDefinition = require(filePath);
865
+
866
+ debug(`Plugin ${filePath} loaded in: ${Date.now() - startTime}ms`);
867
+
862
868
  return new ConfigDependency({
863
- definition: normalizePlugin(require(filePath)),
869
+ definition: normalizePlugin(pluginDefinition),
864
870
  filePath,
865
871
  id,
866
872
  importerName,
@@ -149,9 +149,10 @@ function readdirSafeSync(directoryPath) {
149
149
  */
150
150
  class NoFilesFoundError extends Error {
151
151
 
152
+ // eslint-disable-next-line jsdoc/require-description
152
153
  /**
153
- * @param {string} pattern - The glob pattern which was not found.
154
- * @param {boolean} globDisabled - If `true` then the pattern was a glob pattern, but glob was disabled.
154
+ * @param {string} pattern The glob pattern which was not found.
155
+ * @param {boolean} globDisabled If `true` then the pattern was a glob pattern, but glob was disabled.
155
156
  */
156
157
  constructor(pattern, globDisabled) {
157
158
  super(`No files matching '${pattern}' were found${globDisabled ? " (glob was disabled)" : ""}.`);
@@ -165,8 +166,9 @@ class NoFilesFoundError extends Error {
165
166
  */
166
167
  class AllFilesIgnoredError extends Error {
167
168
 
169
+ // eslint-disable-next-line jsdoc/require-description
168
170
  /**
169
- * @param {string} pattern - The glob pattern which was not found.
171
+ * @param {string} pattern The glob pattern which was not found.
170
172
  */
171
173
  constructor(pattern) {
172
174
  super(`All files matched by '${pattern}' are ignored.`);
@@ -96,6 +96,7 @@ function renderMessages(messages, parentIndex, rulesMeta) {
96
96
  }).join("\n");
97
97
  }
98
98
 
99
+ // eslint-disable-next-line jsdoc/require-description
99
100
  /**
100
101
  * @param {Array} results Test results.
101
102
  * @param {Object} rulesMeta Dictionary containing metadata for each rule executed by the analysis.
@@ -78,7 +78,7 @@ function mergeDefaultOptions(options) {
78
78
  return Object.assign({}, DEFAULT_OPTIONS, options);
79
79
  }
80
80
 
81
- /* eslint-disable valid-jsdoc */
81
+ /* eslint-disable jsdoc/check-param-names, jsdoc/require-param */
82
82
  /**
83
83
  * Normalize the path separators in a given string.
84
84
  * On Windows environment, this replaces `\` by `/`.
@@ -89,7 +89,7 @@ function mergeDefaultOptions(options) {
89
89
  const normalizePathSeps = path.sep === "/"
90
90
  ? (str => str)
91
91
  : ((seps, str) => str.replace(seps, "/")).bind(null, new RegExp(`\\${path.sep}`, "gu"));
92
- /* eslint-enable valid-jsdoc */
92
+ /* eslint-enable jsdoc/check-param-names, jsdoc/require-param */
93
93
 
94
94
  /**
95
95
  * Converts a glob pattern to a new glob pattern relative to a different directory
@@ -121,6 +121,7 @@ function relativize(globPattern, relativePathToOldBaseDir) {
121
121
  */
122
122
  class IgnoredPaths {
123
123
 
124
+ // eslint-disable-next-line jsdoc/require-description
124
125
  /**
125
126
  * @param {Object} providedOptions object containing 'ignore', 'ignorePath' and 'patterns' properties
126
127
  */
@@ -298,7 +299,7 @@ class IgnoredPaths {
298
299
 
299
300
  /**
300
301
  * read ignore filepath
301
- * @param {string} filePath, file to add to ig
302
+ * @param {string} filePath file to add to ig
302
303
  * @returns {Array} raw ignore rules
303
304
  */
304
305
  readIgnoreFile(filePath) {
@@ -47,7 +47,6 @@ class LintResultCache {
47
47
 
48
48
  /**
49
49
  * Creates a new LintResultCache instance.
50
- * @constructor
51
50
  * @param {string} cacheFileLocation The cache file location.
52
51
  * configuration lookup by file path).
53
52
  */