eslint 6.5.0 → 6.7.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 (196) hide show
  1. package/CHANGELOG.md +115 -0
  2. package/README.md +10 -9
  3. package/conf/config-schema.js +1 -0
  4. package/conf/default-cli-options.js +1 -1
  5. package/lib/cli-engine/cascading-config-array-factory.js +40 -14
  6. package/lib/cli-engine/cli-engine.js +49 -21
  7. package/lib/cli-engine/config-array/config-array.js +13 -4
  8. package/lib/cli-engine/config-array/config-dependency.js +2 -0
  9. package/lib/cli-engine/config-array/extracted-config.js +27 -0
  10. package/lib/cli-engine/config-array/ignore-pattern.js +231 -0
  11. package/lib/cli-engine/config-array/index.js +2 -0
  12. package/lib/cli-engine/config-array/override-tester.js +2 -0
  13. package/lib/cli-engine/config-array-factory.js +120 -2
  14. package/lib/cli-engine/file-enumerator.js +51 -30
  15. package/lib/cli-engine/formatters/html.js +1 -0
  16. package/lib/init/autoconfig.js +1 -11
  17. package/lib/init/config-file.js +0 -1
  18. package/lib/init/config-initializer.js +4 -4
  19. package/lib/init/config-rule.js +1 -5
  20. package/lib/init/npm-utils.js +0 -5
  21. package/lib/linter/code-path-analysis/code-path-analyzer.js +24 -38
  22. package/lib/linter/code-path-analysis/code-path-segment.js +17 -25
  23. package/lib/linter/code-path-analysis/code-path-state.js +40 -81
  24. package/lib/linter/code-path-analysis/code-path.js +10 -11
  25. package/lib/linter/code-path-analysis/debug-helpers.js +8 -12
  26. package/lib/linter/code-path-analysis/fork-context.js +23 -34
  27. package/lib/linter/code-path-analysis/id-generator.js +2 -2
  28. package/lib/linter/linter.js +121 -95
  29. package/lib/linter/node-event-generator.js +3 -2
  30. package/lib/linter/report-translator.js +73 -7
  31. package/lib/rule-tester/rule-tester.js +46 -14
  32. package/lib/rules/accessor-pairs.js +8 -8
  33. package/lib/rules/array-bracket-newline.js +12 -15
  34. package/lib/rules/array-bracket-spacing.js +12 -12
  35. package/lib/rules/array-callback-return.js +6 -11
  36. package/lib/rules/array-element-newline.js +5 -8
  37. package/lib/rules/arrow-parens.js +0 -1
  38. package/lib/rules/block-scoped-var.js +3 -3
  39. package/lib/rules/block-spacing.js +4 -4
  40. package/lib/rules/camelcase.js +19 -6
  41. package/lib/rules/capitalized-comments.js +0 -7
  42. package/lib/rules/class-methods-use-this.js +3 -3
  43. package/lib/rules/comma-dangle.js +20 -25
  44. package/lib/rules/comma-spacing.js +1 -1
  45. package/lib/rules/computed-property-spacing.js +14 -14
  46. package/lib/rules/consistent-return.js +4 -5
  47. package/lib/rules/consistent-this.js +5 -5
  48. package/lib/rules/constructor-super.js +14 -16
  49. package/lib/rules/curly.js +12 -9
  50. package/lib/rules/default-param-last.js +1 -0
  51. package/lib/rules/dot-location.js +11 -12
  52. package/lib/rules/func-names.js +6 -6
  53. package/lib/rules/function-call-argument-newline.js +8 -6
  54. package/lib/rules/generator-star-spacing.js +4 -9
  55. package/lib/rules/getter-return.js +4 -7
  56. package/lib/rules/grouped-accessor-pairs.js +224 -0
  57. package/lib/rules/indent.js +13 -2
  58. package/lib/rules/index.js +5 -0
  59. package/lib/rules/init-declarations.js +2 -2
  60. package/lib/rules/jsx-quotes.js +1 -1
  61. package/lib/rules/keyword-spacing.js +32 -56
  62. package/lib/rules/lines-around-directive.js +1 -1
  63. package/lib/rules/max-len.js +0 -5
  64. package/lib/rules/max-statements-per-line.js +3 -7
  65. package/lib/rules/multiline-comment-style.js +237 -106
  66. package/lib/rules/multiline-ternary.js +3 -3
  67. package/lib/rules/newline-after-var.js +6 -7
  68. package/lib/rules/newline-before-return.js +8 -9
  69. package/lib/rules/newline-per-chained-call.js +2 -4
  70. package/lib/rules/no-class-assign.js +2 -2
  71. package/lib/rules/no-compare-neg-zero.js +1 -2
  72. package/lib/rules/no-cond-assign.js +14 -4
  73. package/lib/rules/no-confusing-arrow.js +2 -2
  74. package/lib/rules/no-console.js +4 -8
  75. package/lib/rules/no-const-assign.js +1 -1
  76. package/lib/rules/no-constructor-return.js +62 -0
  77. package/lib/rules/no-dupe-args.js +1 -1
  78. package/lib/rules/no-dupe-class-members.js +3 -4
  79. package/lib/rules/no-dupe-else-if.js +122 -0
  80. package/lib/rules/no-dupe-keys.js +6 -5
  81. package/lib/rules/no-duplicate-imports.js +14 -18
  82. package/lib/rules/no-else-return.js +0 -8
  83. package/lib/rules/no-empty-function.js +2 -4
  84. package/lib/rules/no-eval.js +10 -18
  85. package/lib/rules/no-ex-assign.js +1 -1
  86. package/lib/rules/no-extra-bind.js +5 -12
  87. package/lib/rules/no-extra-boolean-cast.js +0 -2
  88. package/lib/rules/no-extra-label.js +4 -9
  89. package/lib/rules/no-extra-parens.js +17 -15
  90. package/lib/rules/no-extra-semi.js +5 -6
  91. package/lib/rules/no-fallthrough.js +6 -6
  92. package/lib/rules/no-func-assign.js +3 -3
  93. package/lib/rules/no-global-assign.js +4 -4
  94. package/lib/rules/no-implicit-coercion.js +10 -10
  95. package/lib/rules/no-implicit-globals.js +90 -8
  96. package/lib/rules/no-implied-eval.js +0 -1
  97. package/lib/rules/no-inline-comments.js +25 -11
  98. package/lib/rules/no-invalid-this.js +17 -5
  99. package/lib/rules/no-labels.js +3 -6
  100. package/lib/rules/no-lone-blocks.js +1 -1
  101. package/lib/rules/no-loop-func.js +6 -11
  102. package/lib/rules/no-magic-numbers.js +6 -6
  103. package/lib/rules/no-misleading-character-class.js +14 -7
  104. package/lib/rules/no-mixed-operators.js +13 -22
  105. package/lib/rules/no-mixed-requires.js +0 -1
  106. package/lib/rules/no-multi-spaces.js +1 -1
  107. package/lib/rules/no-native-reassign.js +4 -4
  108. package/lib/rules/no-octal-escape.js +1 -1
  109. package/lib/rules/no-param-reassign.js +28 -7
  110. package/lib/rules/no-redeclare.js +1 -1
  111. package/lib/rules/no-regex-spaces.js +0 -1
  112. package/lib/rules/no-restricted-imports.js +11 -11
  113. package/lib/rules/no-self-assign.js +12 -13
  114. package/lib/rules/no-sequences.js +3 -3
  115. package/lib/rules/no-setter-return.js +227 -0
  116. package/lib/rules/no-shadow.js +1 -4
  117. package/lib/rules/no-tabs.js +8 -2
  118. package/lib/rules/no-this-before-super.js +12 -13
  119. package/lib/rules/no-trailing-spaces.js +19 -7
  120. package/lib/rules/no-underscore-dangle.js +23 -4
  121. package/lib/rules/no-unmodified-loop-condition.js +16 -29
  122. package/lib/rules/no-unneeded-ternary.js +3 -3
  123. package/lib/rules/no-unreachable.js +7 -7
  124. package/lib/rules/no-unsafe-finally.js +4 -7
  125. package/lib/rules/no-unsafe-negation.js +32 -9
  126. package/lib/rules/no-unused-expressions.js +11 -7
  127. package/lib/rules/no-unused-labels.js +3 -6
  128. package/lib/rules/no-unused-vars.js +22 -29
  129. package/lib/rules/no-use-before-define.js +10 -15
  130. package/lib/rules/no-useless-call.js +4 -4
  131. package/lib/rules/no-useless-computed-key.js +60 -33
  132. package/lib/rules/no-useless-concat.js +4 -4
  133. package/lib/rules/no-useless-constructor.js +14 -22
  134. package/lib/rules/no-useless-escape.js +29 -8
  135. package/lib/rules/no-useless-rename.js +15 -7
  136. package/lib/rules/no-useless-return.js +8 -15
  137. package/lib/rules/no-var.js +12 -25
  138. package/lib/rules/no-warning-comments.js +0 -1
  139. package/lib/rules/no-whitespace-before-property.js +3 -3
  140. package/lib/rules/object-curly-newline.js +7 -10
  141. package/lib/rules/object-curly-spacing.js +21 -22
  142. package/lib/rules/object-shorthand.js +1 -1
  143. package/lib/rules/one-var-declaration-per-line.js +2 -2
  144. package/lib/rules/operator-assignment.js +33 -3
  145. package/lib/rules/padded-blocks.js +1 -1
  146. package/lib/rules/padding-line-between-statements.js +0 -16
  147. package/lib/rules/prefer-arrow-callback.js +6 -6
  148. package/lib/rules/prefer-const.js +27 -28
  149. package/lib/rules/prefer-destructuring.js +1 -7
  150. package/lib/rules/prefer-exponentiation-operator.js +189 -0
  151. package/lib/rules/prefer-named-capture-group.js +0 -1
  152. package/lib/rules/prefer-numeric-literals.js +32 -4
  153. package/lib/rules/prefer-object-spread.js +7 -7
  154. package/lib/rules/prefer-rest-params.js +3 -6
  155. package/lib/rules/prefer-spread.js +4 -4
  156. package/lib/rules/prefer-template.js +5 -6
  157. package/lib/rules/quote-props.js +1 -1
  158. package/lib/rules/quotes.js +5 -6
  159. package/lib/rules/radix.js +5 -10
  160. package/lib/rules/require-await.js +10 -5
  161. package/lib/rules/require-yield.js +2 -2
  162. package/lib/rules/rest-spread-spacing.js +1 -1
  163. package/lib/rules/semi.js +6 -3
  164. package/lib/rules/sort-imports.js +3 -4
  165. package/lib/rules/sort-keys.js +1 -3
  166. package/lib/rules/space-before-blocks.js +1 -2
  167. package/lib/rules/space-in-parens.js +4 -4
  168. package/lib/rules/space-infix-ops.js +6 -6
  169. package/lib/rules/spaced-comment.js +20 -22
  170. package/lib/rules/strict.js +2 -4
  171. package/lib/rules/symbol-description.js +1 -2
  172. package/lib/rules/template-curly-spacing.js +2 -2
  173. package/lib/rules/use-isnan.js +40 -3
  174. package/lib/rules/utils/ast-utils.js +84 -85
  175. package/lib/rules/utils/fix-tracker.js +0 -6
  176. package/lib/rules/utils/lazy-loading-rule-map.js +0 -1
  177. package/lib/rules/vars-on-top.js +11 -11
  178. package/lib/shared/config-ops.js +2 -2
  179. package/lib/shared/runtime-info.js +8 -8
  180. package/lib/shared/traverser.js +2 -0
  181. package/lib/shared/types.js +9 -0
  182. package/lib/source-code/source-code.js +62 -17
  183. package/lib/source-code/token-store/backward-token-comment-cursor.js +5 -5
  184. package/lib/source-code/token-store/backward-token-cursor.js +5 -5
  185. package/lib/source-code/token-store/cursors.js +17 -19
  186. package/lib/source-code/token-store/decorative-cursor.js +1 -1
  187. package/lib/source-code/token-store/filter-cursor.js +2 -2
  188. package/lib/source-code/token-store/forward-token-comment-cursor.js +5 -5
  189. package/lib/source-code/token-store/forward-token-cursor.js +5 -5
  190. package/lib/source-code/token-store/index.js +86 -92
  191. package/lib/source-code/token-store/limit-cursor.js +2 -2
  192. package/lib/source-code/token-store/padded-token-cursor.js +7 -7
  193. package/lib/source-code/token-store/skip-cursor.js +2 -2
  194. package/lib/source-code/token-store/utils.js +9 -13
  195. package/package.json +9 -7
  196. package/lib/cli-engine/ignored-paths.js +0 -362
package/CHANGELOG.md CHANGED
@@ -1,3 +1,118 @@
1
+ v6.7.1 - November 24, 2019
2
+
3
+ * [`dd1e9f4`](https://github.com/eslint/eslint/commit/dd1e9f4df2103c43509a54b0ad5f9106557997f9) Fix: revert changes to key-spacing due to regression (#12598) (Kai Cataldo)
4
+ * [`c644b54`](https://github.com/eslint/eslint/commit/c644b5429e5bc8a050afd70c99ec82035eb611fa) Docs: Update README team and sponsors (ESLint Jenkins)
5
+
6
+ v6.7.0 - November 22, 2019
7
+
8
+ * [`312a88f`](https://github.com/eslint/eslint/commit/312a88f2230082d898b7d8d82f8af63cb352e55a) New: Add grouped-accessor-pairs rule (fixes #12277) (#12331) (Milos Djermanovic)
9
+ * [`5c68f5f`](https://github.com/eslint/eslint/commit/5c68f5feeb4a6c0cb53ff76b2fd255b5bfa69c93) Update: Add 'lexicalBindings' to no-implicit-globals and change messages (#11996) (Milos Djermanovic)
10
+ * [`6eaad96`](https://github.com/eslint/eslint/commit/6eaad964ff159d0a38de96c1104782ffe6858c78) New: Add suggestions API (#12384) (Will Douglas)
11
+ * [`b336fbe`](https://github.com/eslint/eslint/commit/b336fbedecd85731611fdc2dfd8edb635a8b1c39) Fix: indent rule with JSX spread props (#12581) (Nathan Woltman)
12
+ * [`97c745d`](https://github.com/eslint/eslint/commit/97c745dc277febbea82552a4d9186e3df847f860) Update: Report assignment expression location in no-cond-assign (#12465) (Milos Djermanovic)
13
+ * [`0f01f3d`](https://github.com/eslint/eslint/commit/0f01f3d0807c580631c2fdcff29192a64a870637) Update: Check member expressions with `this` in operator-assignment (#12495) (Milos Djermanovic)
14
+ * [`62c7038`](https://github.com/eslint/eslint/commit/62c7038a493d89e4a7b14ac673a063d09d04057b) Fix: invalid token checking in computed-property-spacing (fixes #12198) (#12533) (YeonJuan)
15
+ * [`4f8a1ee`](https://github.com/eslint/eslint/commit/4f8a1ee1c26ccb5882e5e83ea7eab2f406c7476b) Update: Add enforceForClassMembers option to no-useless-computed-key (#12110) (ark120202)
16
+ * [`1a2eb99`](https://github.com/eslint/eslint/commit/1a2eb99f11c65813bba11d6576a06cff2b823cc9) New: new rule no-constructor-return (fixes #12481) (#12529) (Pig Fang)
17
+ * [`ca3b2a6`](https://github.com/eslint/eslint/commit/ca3b2a62c9e829dc4534bca3643d6bc729b46df0) New: ignorePatterns in config files (refs eslint/rfcs#22) (#12274) (Toru Nagashima)
18
+ * [`60204a3`](https://github.com/eslint/eslint/commit/60204a3620e33a078c1c35fa2e5d839a16c627ff) Docs: Added another Textmate 2 bundle. (#12580) (Ryan Fitzer)
19
+ * [`62623f9`](https://github.com/eslint/eslint/commit/62623f9f611a3adb79696304760a2fd14be8afbc) Fix: preserve whitespace in multiline-comment-style (fixes #12312) (#12316) (Kai Cataldo)
20
+ * [`17a8849`](https://github.com/eslint/eslint/commit/17a8849491a983f6cb8e98da8c0c9d52ff5f2aa6) New: Add no-dupe-else-if rule (fixes #12469) (#12504) (Milos Djermanovic)
21
+ * [`41a78fd`](https://github.com/eslint/eslint/commit/41a78fd7ce245cad8ff6a96c42f5840688849427) Update: improve location for semi and comma-dangle (#12380) (Chiawen Chen)
22
+ * [`0a480f8`](https://github.com/eslint/eslint/commit/0a480f8307a0e438032f484254941e6426748143) Docs: Change "Code Conventions" link in pull-requests.md (#12401) (Denis Sikuler)
23
+ * [`fed20bb`](https://github.com/eslint/eslint/commit/fed20bb039cf9f53adfcf93e467f418c5e958f45) Fix: require-await crash on global await (#12571) (Brad Zacher)
24
+ * [`b8030fc`](https://github.com/eslint/eslint/commit/b8030fc23e88f57a04d955b3befd1ab0fc2c5d10) Update: deprecate personal config (fixes #11914, refs eslint/rfcs#32) (#12426) (Toru Nagashima)
25
+ * [`40c8c32`](https://github.com/eslint/eslint/commit/40c8c3264c7c383d98c9faf9c4cb4f8b75aee40f) Fix: improve report location for object-curly-spacing (#12563) (Milos Djermanovic)
26
+ * [`1110045`](https://github.com/eslint/eslint/commit/1110045e0d28a461e75d2f57d5f01533d59ef239) Fix: ignore marker-only comments in spaced-comment (fixes #12036) (#12558) (Milos Djermanovic)
27
+ * [`6503cb8`](https://github.com/eslint/eslint/commit/6503cb8d99e549fece53b80b110e890a7978b9fd) Update: Fix uglified object align in key-spacing (fixes #11414) (#12472) (YeonJuan)
28
+ * [`40791af`](https://github.com/eslint/eslint/commit/40791af69efde1701690637603ad37d41e15a727) Docs: clarify ignoreDestructuring option in the camelcase rule (#12553) (Milos Djermanovic)
29
+ * [`07d398d`](https://github.com/eslint/eslint/commit/07d398d91d5b6d0247e58b1f8ea64bb5acd570a8) Chore: Add GitHub organization to Sponsor button (#12562) (Brandon Mills)
30
+ * [`a477707`](https://github.com/eslint/eslint/commit/a47770706ac59633dcd73e886d1a7282b324ee06) Chore: Format style guide links so they can be clicked (#12189) (Ivan V)
31
+ * [`0f7edef`](https://github.com/eslint/eslint/commit/0f7edefdc1576d5e3e7ef89083002b0a4a31f039) Update: add react plugin config for eslint init (#12446) (Ibrahim Rouis)
32
+ * [`448ff1e`](https://github.com/eslint/eslint/commit/448ff1e53734c503fb9e7e6802c1c7e441d4c019) Update: Report '\08' and '\09' in no-octal-escape (fixes #12080) (#12526) (Milos Djermanovic)
33
+ * [`45aa6a3`](https://github.com/eslint/eslint/commit/45aa6a3ba3486f1b116c5daab6432d144e5ea574) New: Add no-setter-return rule (fixes #12285) (#12346) (Milos Djermanovic)
34
+ * [`0afb518`](https://github.com/eslint/eslint/commit/0afb518d1f139376245613dddd8eaef32b52d619) Fix: invalid autofix in function-call-argument-newline (fixes #12454) (#12539) (YeonJuan)
35
+ * [`90305e0`](https://github.com/eslint/eslint/commit/90305e017c2c5fba0b4b62f41b180910b4baeedb) Update: Depcrecate isSpaceBetweenTokens() (#12519) (Kai Cataldo)
36
+ * [`41b1e43`](https://github.com/eslint/eslint/commit/41b1e4308c1cb01c8b00cc8adc36440e77854117) New: add option for camelcase (fixes #12527) (#12528) (Pig Fang)
37
+ * [`f49f1e0`](https://github.com/eslint/eslint/commit/f49f1e0a69afa49f6548af7b2c0e6347e1ea022d) Upgrade: upgrade optionator to avoid license issue (fixes #11536) (#12537) (Pig Fang)
38
+ * [`0286b57`](https://github.com/eslint/eslint/commit/0286b5730501b391c74e069db46849f0de0885d2) Docs: Clean up Getting Started Guide (#12544) (Nicholas C. Zakas)
39
+ * [`575a98d`](https://github.com/eslint/eslint/commit/575a98d724b2688f1e9c83744c5dc9ffe9a7bfb4) Chore: Add funding field to package.json (#12543) (Nicholas C. Zakas)
40
+ * [`9e29e18`](https://github.com/eslint/eslint/commit/9e29e189752f06362fd1956659e07834efb746a5) Fix: sourceCode#isSpaceBetweenTokens() checks non-adjacent tokens (#12491) (Kai Cataldo)
41
+ * [`5868550`](https://github.com/eslint/eslint/commit/586855060afb3201f4752be8820dc85703b523a6) Docs: add notice about `function` keyword in keyword-spacing (#12524) (Pig Fang)
42
+ * [`bb556d5`](https://github.com/eslint/eslint/commit/bb556d5fd735ad2dcea322082edcc07a58105ce9) Fix: curly `multi` reports single lexical declarations (fixes #11908) (#12513) (Milos Djermanovic)
43
+ * [`ac60621`](https://github.com/eslint/eslint/commit/ac606217d4beebc35b865d14a7f9723fd21faa48) Fix: unexpected autofix in prefer-const (fixes #12514) (#12521) (YeonJuan)
44
+ * [`990065e`](https://github.com/eslint/eslint/commit/990065e5f58b6cc6922ab6cee5b97bfc56a6237a) Update: curly multi-or-nest flagging semis on next line (fixes #12370) (#12378) (cherryblossom000)
45
+ * [`084a8a6`](https://github.com/eslint/eslint/commit/084a8a63a749232681fefe9bdac6802efdcdc8a8) Fix: no-cond-assign with `always` option reports switch case clauses (#12470) (Milos Djermanovic)
46
+ * [`7e41355`](https://github.com/eslint/eslint/commit/7e41355b19a8ef347620dd7c0dde491c3460937b) Update: improve report location for space-infix-ops (#12324) (Chiawen Chen)
47
+ * [`94ff921`](https://github.com/eslint/eslint/commit/94ff921689115f856578159564ee1968b4b914be) Update: Add capIsConstructor option to no-invalid-this (fixes #12271) (#12308) (Milos Djermanovic)
48
+ * [`de65de6`](https://github.com/eslint/eslint/commit/de65de6e488112a602949e6a5d27dd4c754b003c) New: Add prefer-exponentiation-operator rule (fixes #10482) (#12360) (Milos Djermanovic)
49
+ * [`c78f4a7`](https://github.com/eslint/eslint/commit/c78f4a73de68f81cd41132b46d4840b91599d599) Update: Allow JSX exception in no-inline-comments (fixes #11270) (#12388) (Milos Djermanovic)
50
+ * [`e17fb90`](https://github.com/eslint/eslint/commit/e17fb90f5817d16081e690eb06b7720afcb9fa2a) New: allowAfterThisConstructor for no-underscore-dangle (fixes #11488) (#11489) (sripberger)
51
+ * [`287ca56`](https://github.com/eslint/eslint/commit/287ca562811d037bde09a47af7f5b9c7b741e022) Build: update CI for Node.js 13 (#12496) (Toru Nagashima)
52
+ * [`98e1d50`](https://github.com/eslint/eslint/commit/98e1d50273f31c2a7b59772298280ed7305274c8) Upgrade: globals to v12.1.0 (#12296) (Tony Brix)
53
+ * [`8ac71a3`](https://github.com/eslint/eslint/commit/8ac71a3c89a9db13706a44b23d1b509b65185113) Sponsors: Sync README with website (ESLint Jenkins)
54
+ * [`4e142ea`](https://github.com/eslint/eslint/commit/4e142ea411dfb692b6e2a69cd5f1204ade4dd58a) Docs: Update README team and sponsors (ESLint Jenkins)
55
+
56
+ v6.6.0 - October 25, 2019
57
+
58
+ * [`39dfe08`](https://github.com/eslint/eslint/commit/39dfe0880fa934e287e8ea1f7b56d5cba8d43765) Update: false positives in function-call-argument-newline (fixes #12123) (#12280) (Scott O'Hara)
59
+ * [`4d84210`](https://github.com/eslint/eslint/commit/4d842105c9c82026be668d7425213138903d4d41) Update: improve report location for no-trailing-spaces (fixes #12315) (#12477) (Milos Djermanovic)
60
+ * [`c6a7745`](https://github.com/eslint/eslint/commit/c6a7745a1371a85932bfae5fec039d1b6fcfc128) Update: no-trailing-spaces false negatives after comments (fixes #12479) (#12480) (Milos Djermanovic)
61
+ * [`0bffe95`](https://github.com/eslint/eslint/commit/0bffe953d2752dd2d3045f2f8771c96b6cee8fc4) Fix: no-misleading-character-class crash on invalid regex (fixes #12169) (#12347) (Milos Djermanovic)
62
+ * [`c6a9a3b`](https://github.com/eslint/eslint/commit/c6a9a3bc58b69dbf9be9cd09b0283c081ca211e7) Update: Add enforceForIndexOf option to use-isnan (fixes #12207) (#12379) (Milos Djermanovic)
63
+ * [`364877b`](https://github.com/eslint/eslint/commit/364877b2504e8f7ece04770b93d517e2f27458d0) Update: measure plugin loading time and output in debug message (#12395) (Victor Homyakov)
64
+ * [`1744fab`](https://github.com/eslint/eslint/commit/1744faba3c93c869f7dbbf0a704d32e2692d6856) Fix: operator-assignment removes and duplicates comments (#12485) (Milos Djermanovic)
65
+ * [`52ca11a`](https://github.com/eslint/eslint/commit/52ca11a66ab6c2fb5a71d8b9869482f14f98cb9d) Fix: operator-assignment invalid autofix with adjacent tokens (#12483) (Milos Djermanovic)
66
+ * [`0f6d0dc`](https://github.com/eslint/eslint/commit/0f6d0dcdf5adc30079a7379bbf605a4ef3887a85) Fix: CLIEngine#addPlugin reset lastConfigArrays (fixes #12425) (#12468) (Toru Nagashima)
67
+ * [`923a8cb`](https://github.com/eslint/eslint/commit/923a8cb752b8dee1e622c5fd36f3f53288e30602) Chore: Fix lint failure in JSDoc comment (#12489) (Brandon Mills)
68
+ * [`aac3be4`](https://github.com/eslint/eslint/commit/aac3be435cccc241781150fcac728df04d086fa8) Update: Add ignored prop regex no-param-reassign (#11275) (Luke Bennett)
69
+ * [`e5382d6`](https://github.com/eslint/eslint/commit/e5382d6e4eb1344f537b6f107535269e9939fcb8) Chore: Remove unused parameter in dot-location (#12464) (Milos Djermanovic)
70
+ * [`49faefb`](https://github.com/eslint/eslint/commit/49faefbee3fc7daaf2482d9d7d23513d6ffda9e8) Fix: no-obj-calls false positive (fixes #12437) (#12467) (Toru Nagashima)
71
+ * [`b3dbd96`](https://github.com/eslint/eslint/commit/b3dbd9657bbeac6571111a4429b03fc085ba6655) Fix: problematic installation issue (fixes #11018) (#12309) (Toru Nagashima)
72
+ * [`cd7c29b`](https://github.com/eslint/eslint/commit/cd7c29b17085c14c9cf6345201c72a192c0d0e0c) Sponsors: Sync README with website (ESLint Jenkins)
73
+ * [`8233873`](https://github.com/eslint/eslint/commit/8233873b8e5facd80ab7b172bff1e896a9c5fd39) Docs: Add note about Node.js requiring SSL support (fixes #11413) (#12475) (Nicholas C. Zakas)
74
+ * [`89e8aaf`](https://github.com/eslint/eslint/commit/89e8aafcc622a4763bed6b9d62f148ef95798f38) Fix: improve report location for no-tabs (#12471) (Milos Djermanovic)
75
+ * [`7dffe48`](https://github.com/eslint/eslint/commit/7dffe482d646d4e5f94fa87a22f3b5b2e0a4b189) Update: Enable function string option in comma-dangle (fixes #12058) (#12462) (YeonJuan)
76
+ * [`e15e1f9`](https://github.com/eslint/eslint/commit/e15e1f933f287d274a726e7f0f0a1dd80f0964af) Docs: fix doc for no-unneeded-ternary rule (fixes #12098) (#12410) (Sam Rae)
77
+ * [`b1dc58f`](https://github.com/eslint/eslint/commit/b1dc58f0a717cb3d19300c845ca23a21ceb610d3) Sponsors: Sync README with website (ESLint Jenkins)
78
+ * [`61749c9`](https://github.com/eslint/eslint/commit/61749c94bd8a2ebcdfb89e0cd48c4a029a945079) Chore: Provide debug log for parser errors (#12474) (Brad Zacher)
79
+ * [`7c8bbe0`](https://github.com/eslint/eslint/commit/7c8bbe0391944e1f92e083a04715bf4b3fe6be5d) Update: enforceForOrderingRelations no-unsafe-negation (fixes #12163) (#12414) (Sam Rae)
80
+ * [`349ed67`](https://github.com/eslint/eslint/commit/349ed6700e1155384597e1e6035550a96cb8a42d) Update: improve report location for no-mixed-operators (#12328) (Chiawen Chen)
81
+ * [`a102eaa`](https://github.com/eslint/eslint/commit/a102eaa9ac19e1c6d92f79a4033e9048cfb64c0d) Fix: prefer-numeric-literals invalid autofix with adjacent tokens (#12387) (Milos Djermanovic)
82
+ * [`6e7c18d`](https://github.com/eslint/eslint/commit/6e7c18ddb30b32ee5b2e842cc8258aa7aebb7445) Update: enforceForNewInMemberExpressions no-extra-parens (fixes #12428) (#12436) (Milos Djermanovic)
83
+ * [`51fbbd7`](https://github.com/eslint/eslint/commit/51fbbd78f98f223d17071650f5117d07f60dadc2) Fix: array-bracket-newline consistent error with comments (fixes #12416) (#12441) (Milos Djermanovic)
84
+ * [`e657d4c`](https://github.com/eslint/eslint/commit/e657d4ccb9f3dd5cacceaaa40ffe24ac29a1349a) Fix: report full dot location in dot-location (#12452) (Milos Djermanovic)
85
+ * [`2d6e345`](https://github.com/eslint/eslint/commit/2d6e345e3c2626b0f2252f22cfaffdf53ea0871a) Update: make isSpaceBetweenTokens() ignore newline in comments (#12407) (YeonJuan)
86
+ * [`84f71de`](https://github.com/eslint/eslint/commit/84f71de0e686e0fe37b83d6728ce1825caaa44fb) Update: remove default overrides in keyword-spacing (fixes #12369) (#12411) (YeonJuan)
87
+ * [`18a0b0e`](https://github.com/eslint/eslint/commit/18a0b0e3df927428a22b5b5295f9faee4bd57246) Update: improve report location for no-space-in-parens (#12364) (Chiawen Chen)
88
+ * [`d61c8a5`](https://github.com/eslint/eslint/commit/d61c8a5a75447a36276f2d4f84afb3e1129618da) Update: improve report location for no-multi-spaces (#12329) (Chiawen Chen)
89
+ * [`561093f`](https://github.com/eslint/eslint/commit/561093fc4267a4ae317d63bc9f103020fad88802) Upgrade: bump inquirer to ^7.0.0 (#12440) (Joe Graham)
90
+ * [`fb633b2`](https://github.com/eslint/eslint/commit/fb633b2bbd0a390b247047524fdd1f612dbab803) Chore: Add a script for testing with more control (#12444) (Eric Wang)
91
+ * [`012ec51`](https://github.com/eslint/eslint/commit/012ec5151113a2be06fc0e4cd208d714e52dbc57) Sponsors: Sync README with website (ESLint Jenkins)
92
+ * [`874fe16`](https://github.com/eslint/eslint/commit/874fe1642a10a0fb937ccccdd4d22343b84f80dc) New: pass cwd from cli engine (#12389) (Eric Wang)
93
+ * [`b962775`](https://github.com/eslint/eslint/commit/b962775b8cb7c90985a5ab63e56744bb2ba79644) Update: no-self-assign should detect member expression with this (#12279) (Tibor Blenessy)
94
+ * [`02977f2`](https://github.com/eslint/eslint/commit/02977f25a922dd0b8617c16116bb4364d0f30e94) Docs: Clarify `eslint:recommended` semver policy (#12429) (Kevin Partington)
95
+ * [`97045ae`](https://github.com/eslint/eslint/commit/97045ae0805e6503887eef0b131dcb9e70b6d185) Docs: Fixes object type for `rules` in "Use a Plugin" (#12409) (Daisy Develops)
96
+ * [`24ca088`](https://github.com/eslint/eslint/commit/24ca088fdc901feef8f10b050414fbde64b55c7d) Docs: Fix typo in v6 migration guide (#12412) (Benjamim Sonntag)
97
+ * [`b094008`](https://github.com/eslint/eslint/commit/b094008fb196dc1de5b4c27b7dbf0bcbb4b7b352) Chore: update version parameter name (#12402) (Toru Nagashima)
98
+ * [`e5637ba`](https://github.com/eslint/eslint/commit/e5637badd42f087d115f81575b832097fe6fe554) Chore: enable jsdoc/require-description (#12365) (Kai Cataldo)
99
+ * [`d31f337`](https://github.com/eslint/eslint/commit/d31f3370396ec4868722bdc044aa697b135ac183) Sponsors: Sync README with website (ESLint Jenkins)
100
+ * [`7ffb22f`](https://github.com/eslint/eslint/commit/7ffb22f61cf1622511a7fe42b5ead7c3b216df5e) Chore: Clean up inline directive parsing (#12375) (Jordan Eldredge)
101
+ * [`84467c0`](https://github.com/eslint/eslint/commit/84467c07461cc47ee43807ba9014e13700473c5c) Docs: fix wrong max-depth example (fixes #11991) (#12358) (Gabriel R Sezefredo)
102
+ * [`3642342`](https://github.com/eslint/eslint/commit/364234262efabd91fa8bd53161d9d3e1e37e7944) Docs: Fix minor formatting/grammar errors (#12371) (cherryblossom000)
103
+ * [`c47fa0d`](https://github.com/eslint/eslint/commit/c47fa0dfc76211b3b0e5649c63acdd9606ce0eca) Docs: Fix missing word in sentence (#12361) (Dan Boulet)
104
+ * [`8108f49`](https://github.com/eslint/eslint/commit/8108f49f9fa0c2de80b3b66c847551beff585951) Chore: enable additional eslint-plugin-jsdoc rules (#12336) (Kai Cataldo)
105
+ * [`b718d2e`](https://github.com/eslint/eslint/commit/b718d2e6c9fe3fc56aa7cfc68b1a40b5cd8a7c01) Chore: update issue template with --eslint-fix flag (#12352) (James George)
106
+ * [`20ba14d`](https://github.com/eslint/eslint/commit/20ba14dc78fc2654b2920d14877dde21c6c10da4) Sponsors: Sync README with website (ESLint Jenkins)
107
+ * [`566a947`](https://github.com/eslint/eslint/commit/566a947f67c8038a50e204d68723519778a78a0f) Sponsors: Sync README with website (ESLint Jenkins)
108
+ * [`070cbd0`](https://github.com/eslint/eslint/commit/070cbd0a2ec07831962a25c4276d08e097302416) Sponsors: Sync README with website (ESLint Jenkins)
109
+
110
+ v6.5.1 - September 30, 2019
111
+
112
+ * [`0d3d7d9`](https://github.com/eslint/eslint/commit/0d3d7d9cdd83a7f0e035c95f716a91b9ecc4868b) Docs: fix typo in no-magic-numbers (#12345) (Josiah Rooney)
113
+ * [`447ac87`](https://github.com/eslint/eslint/commit/447ac877e8ca2858d61b1e983f72d39e3e2ca74d) Fix: no-useless-rename handles ExperimentalRestProperty (fixes #12335) (#12339) (Kai Cataldo)
114
+ * [`b6ff73c`](https://github.com/eslint/eslint/commit/b6ff73cad13282fbfc91186cf4bc2f20278a8936) Sponsors: Sync README with website (ESLint Jenkins)
115
+
1
116
  v6.5.0 - September 29, 2019
2
117
 
3
118
  * [`73596cb`](https://github.com/eslint/eslint/commit/73596cbdf0a12e2878b2994783f9b969b0c5fbeb) Update: Add enforceForSwitchCase option to use-isnan (#12106) (Milos Djermanovic)
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
 
@@ -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.
@@ -205,9 +206,9 @@ Brandon Mills
205
206
  Toru Nagashima
206
207
  </a>
207
208
  </td><td align="center" valign="top" width="11%">
208
- <a href="https://github.com/gyandeeps">
209
- <img src="https://github.com/gyandeeps.png?s=75" width="75" height="75"><br />
210
- Gyandeep Singh
209
+ <a href="https://github.com/kaicataldo">
210
+ <img src="https://github.com/kaicataldo.png?s=75" width="75" height="75"><br />
211
+ Kai Cataldo
211
212
  </a>
212
213
  </td><td align="center" valign="top" width="11%">
213
214
  <a href="https://github.com/not-an-aardvark">
@@ -236,9 +237,9 @@ The people who review and implement new features.
236
237
  The people who review and fix bugs and help triage issues.
237
238
 
238
239
  <table><tbody><tr><td align="center" valign="top" width="11%">
239
- <a href="https://github.com/kaicataldo">
240
- <img src="https://github.com/kaicataldo.png?s=75" width="75" height="75"><br />
241
- Kai Cataldo
240
+ <a href="https://github.com/gyandeeps">
241
+ <img src="https://github.com/gyandeeps.png?s=75" width="75" height="75"><br />
242
+ Gyandeep Singh
242
243
  </a>
243
244
  </td><td align="center" valign="top" width="11%">
244
245
  <a href="https://github.com/g-plane">
@@ -264,7 +265,7 @@ The following companies, organizations, and individuals support ESLint's ongoing
264
265
  <h3>Gold Sponsors</h3>
265
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://discordapp.com"><img src="https://images.opencollective.com/discordapp/7e3d9a9/logo.png" alt="Discord" height="32"></a> <a href="https://mixpanel.com"><img src="https://images.opencollective.com/mixpanel/c35a9d7/logo.png" alt="Mixpanel" 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://www.vpsserver.com"><img src="https://images.opencollective.com/vpsservercom/logo.png" alt="VPS Server" 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://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.crosswordsolver.com"><img src="https://images.opencollective.com/crosswordsolver/d4481d6/logo.png" alt="Crosswordsolver" 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://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
269
  <!--sponsorsend-->
269
270
 
270
271
  ## <a name="technology-sponsors"></a>Technology Sponsors
@@ -55,6 +55,7 @@ const configSchema = {
55
55
  type: "object",
56
56
  properties: {
57
57
  root: { type: "boolean" },
58
+ ignorePatterns: { $ref: "#/definitions/stringOrStrings" },
58
59
  ...baseConfigProperties
59
60
  },
60
61
  additionalProperties: false
@@ -14,7 +14,7 @@ module.exports = {
14
14
  globals: [],
15
15
  extensions: [".js"],
16
16
  ignore: true,
17
- ignorePath: null,
17
+ ignorePath: void 0,
18
18
  cache: false,
19
19
 
20
20
  /*
@@ -27,7 +27,7 @@ const os = require("os");
27
27
  const path = require("path");
28
28
  const { validateConfigArray } = require("../shared/config-validator");
29
29
  const { ConfigArrayFactory } = require("./config-array-factory");
30
- const { ConfigArray, ConfigDependency } = require("./config-array");
30
+ const { ConfigArray, ConfigDependency, IgnorePattern } = require("./config-array");
31
31
  const loadRules = require("./load-rules");
32
32
  const debug = require("debug")("eslint:cascading-config-array-factory");
33
33
 
@@ -45,8 +45,9 @@ const debug = require("debug")("eslint:cascading-config-array-factory");
45
45
  * @typedef {Object} CascadingConfigArrayFactoryOptions
46
46
  * @property {Map<string,Plugin>} [additionalPluginPool] The map for additional plugins.
47
47
  * @property {ConfigData} [baseConfig] The config by `baseConfig` option.
48
- * @property {ConfigData} [cliConfig] The config by CLI options (`--env`, `--global`, `--parser`, `--parser-options`, `--plugin`, and `--rule`). CLI options overwrite the setting in config files.
48
+ * @property {ConfigData} [cliConfig] The config by CLI options (`--env`, `--global`, `--ignore-pattern`, `--parser`, `--parser-options`, `--plugin`, and `--rule`). CLI options overwrite the setting in config files.
49
49
  * @property {string} [cwd] The base directory to start lookup.
50
+ * @property {string} [ignorePath] The path to the alternative file of `.eslintignore`.
50
51
  * @property {string[]} [rulePaths] The value of `--rulesdir` option.
51
52
  * @property {string} [specificConfigPath] The value of `--config` option.
52
53
  * @property {boolean} [useEslintrc] if `false` then it doesn't load config files.
@@ -62,6 +63,7 @@ const debug = require("debug")("eslint:cascading-config-array-factory");
62
63
  * @property {Map<string, ConfigArray>} configCache The cache from directory paths to config arrays.
63
64
  * @property {string} cwd The base directory to start lookup.
64
65
  * @property {WeakMap<ConfigArray, ConfigArray>} finalizeCache The cache from config arrays to finalized config arrays.
66
+ * @property {string} [ignorePath] The path to the alternative file of `.eslintignore`.
65
67
  * @property {string[]|null} rulePaths The value of `--rulesdir` option. This is used to reset `baseConfigArray`.
66
68
  * @property {string|null} specificConfigPath The value of `--config` option. This is used to reset `cliConfigArray`.
67
69
  * @property {boolean} useEslintrc if `false` then it doesn't load config files.
@@ -86,14 +88,22 @@ function createBaseConfigArray({
86
88
  { name: "BaseConfig" }
87
89
  );
88
90
 
91
+ /*
92
+ * Create the config array element for the default ignore patterns.
93
+ * This element has `ignorePattern` property that ignores the default
94
+ * patterns in the current working directory.
95
+ */
96
+ baseConfigArray.unshift(configArrayFactory.create(
97
+ { ignorePatterns: IgnorePattern.DefaultPatterns },
98
+ { name: "DefaultIgnorePattern" }
99
+ )[0]);
100
+
101
+ /*
102
+ * Load rules `--rulesdir` option as a pseudo plugin.
103
+ * Use a pseudo plugin to define rules of `--rulesdir`, so we can validate
104
+ * the rule's options with only information in the config array.
105
+ */
89
106
  if (rulePaths && rulePaths.length > 0) {
90
-
91
- /*
92
- * Load rules `--rulesdir` option as a pseudo plugin.
93
- * Use a pseudo plugin to define rules of `--rulesdir`, so we can
94
- * validate the rule's options with only information in the config
95
- * array.
96
- */
97
107
  baseConfigArray.push({
98
108
  name: "--rulesdir",
99
109
  filePath: "",
@@ -128,6 +138,7 @@ function createBaseConfigArray({
128
138
  function createCLIConfigArray({
129
139
  cliConfigData,
130
140
  configArrayFactory,
141
+ ignorePath,
131
142
  specificConfigPath
132
143
  }) {
133
144
  const cliConfigArray = configArrayFactory.create(
@@ -135,6 +146,12 @@ function createCLIConfigArray({
135
146
  { name: "CLIOptions" }
136
147
  );
137
148
 
149
+ cliConfigArray.unshift(
150
+ ...(ignorePath
151
+ ? configArrayFactory.loadESLintIgnore(ignorePath)
152
+ : configArrayFactory.loadDefaultESLintIgnore())
153
+ );
154
+
138
155
  if (specificConfigPath) {
139
156
  cliConfigArray.unshift(
140
157
  ...configArrayFactory.loadFile(
@@ -152,8 +169,9 @@ function createCLIConfigArray({
152
169
  */
153
170
  class ConfigurationNotFoundError extends Error {
154
171
 
172
+ // eslint-disable-next-line jsdoc/require-description
155
173
  /**
156
- * @param {string} directoryPath - The directory path.
174
+ * @param {string} directoryPath The directory path.
157
175
  */
158
176
  constructor(directoryPath) {
159
177
  super(`No ESLint configuration found in ${directoryPath}.`);
@@ -177,6 +195,7 @@ class CascadingConfigArrayFactory {
177
195
  baseConfig: baseConfigData = null,
178
196
  cliConfig: cliConfigData = null,
179
197
  cwd = process.cwd(),
198
+ ignorePath,
180
199
  resolvePluginsRelativeTo = cwd,
181
200
  rulePaths = [],
182
201
  specificConfigPath = null,
@@ -199,6 +218,7 @@ class CascadingConfigArrayFactory {
199
218
  cliConfigArray: createCLIConfigArray({
200
219
  cliConfigData,
201
220
  configArrayFactory,
221
+ ignorePath,
202
222
  specificConfigPath
203
223
  }),
204
224
  cliConfigData,
@@ -206,6 +226,7 @@ class CascadingConfigArrayFactory {
206
226
  configCache: new Map(),
207
227
  cwd,
208
228
  finalizeCache: new WeakMap(),
229
+ ignorePath,
209
230
  rulePaths,
210
231
  specificConfigPath,
211
232
  useEslintrc
@@ -228,9 +249,11 @@ class CascadingConfigArrayFactory {
228
249
  * If `filePath` was not given, it returns the config which contains only
229
250
  * `baseConfigData` and `cliConfigData`.
230
251
  * @param {string} [filePath] The file path to a file.
252
+ * @param {Object} [options] The options.
253
+ * @param {boolean} [options.ignoreNotFoundError] If `true` then it doesn't throw `ConfigurationNotFoundError`.
231
254
  * @returns {ConfigArray} The config array of the file.
232
255
  */
233
- getConfigArrayForFile(filePath) {
256
+ getConfigArrayForFile(filePath, { ignoreNotFoundError = false } = {}) {
234
257
  const {
235
258
  baseConfigArray,
236
259
  cliConfigArray,
@@ -247,7 +270,8 @@ class CascadingConfigArrayFactory {
247
270
 
248
271
  return this._finalizeConfigArray(
249
272
  this._loadConfigInAncestors(directoryPath),
250
- directoryPath
273
+ directoryPath,
274
+ ignoreNotFoundError
251
275
  );
252
276
  }
253
277
 
@@ -353,10 +377,11 @@ class CascadingConfigArrayFactory {
353
377
  * Concatenate `--config` and other CLI options.
354
378
  * @param {ConfigArray} configArray The parent config array.
355
379
  * @param {string} directoryPath The path to the leaf directory to find config files.
380
+ * @param {boolean} ignoreNotFoundError If `true` then it doesn't throw `ConfigurationNotFoundError`.
356
381
  * @returns {ConfigArray} The loaded config.
357
382
  * @private
358
383
  */
359
- _finalizeConfigArray(configArray, directoryPath) {
384
+ _finalizeConfigArray(configArray, directoryPath, ignoreNotFoundError) {
360
385
  const {
361
386
  cliConfigArray,
362
387
  configArrayFactory,
@@ -402,7 +427,8 @@ class CascadingConfigArrayFactory {
402
427
  );
403
428
  }
404
429
 
405
- if (useEslintrc && finalConfigArray.length === 0) {
430
+ // At least one element (the default ignore patterns) exists.
431
+ if (!ignoreNotFoundError && useEslintrc && finalConfigArray.length <= 1) {
406
432
  throw new ConfigurationNotFoundError(directoryPath);
407
433
  }
408
434
 
@@ -25,10 +25,9 @@ const ModuleResolver = require("../shared/relative-module-resolver");
25
25
  const { Linter } = require("../linter");
26
26
  const builtInRules = require("../rules");
27
27
  const { CascadingConfigArrayFactory } = require("./cascading-config-array-factory");
28
- const { getUsedExtractedConfigs } = require("./config-array");
28
+ const { IgnorePattern, getUsedExtractedConfigs } = require("./config-array");
29
29
  const { FileEnumerator } = require("./file-enumerator");
30
30
  const hash = require("./hash");
31
- const { IgnoredPaths } = require("./ignored-paths");
32
31
  const LintResultCache = require("./lint-result-cache");
33
32
 
34
33
  const debug = require("debug")("eslint:cli-engine");
@@ -64,7 +63,7 @@ const validFixTypes = new Set(["problem", "suggestion", "layout"]);
64
63
  * @property {string[]} globals An array of global variables to declare.
65
64
  * @property {boolean} ignore False disables use of .eslintignore.
66
65
  * @property {string} ignorePath The ignore file to use instead of .eslintignore.
67
- * @property {string} ignorePattern A glob pattern of files to ignore.
66
+ * @property {string|string[]} ignorePattern One or more glob patterns to ignore.
68
67
  * @property {boolean} useEslintrc False disables looking for .eslintrc
69
68
  * @property {string} parser The name of the parser to use.
70
69
  * @property {ParserOptions} parserOptions An object of parserOption settings to use.
@@ -113,8 +112,8 @@ const validFixTypes = new Set(["problem", "suggestion", "layout"]);
113
112
  * @property {Map<string, Plugin>} additionalPluginPool The map for additional plugins.
114
113
  * @property {string} cacheFilePath The path to the cache of lint results.
115
114
  * @property {CascadingConfigArrayFactory} configArrayFactory The factory of configs.
115
+ * @property {(filePath: string) => boolean} defaultIgnores The default predicate function to check if a file ignored or not.
116
116
  * @property {FileEnumerator} fileEnumerator The file enumerator.
117
- * @property {IgnoredPaths} ignoredPaths The ignored paths.
118
117
  * @property {ConfigArray[]} lastConfigArrays The list of config arrays that the last `executeOnFiles` or `executeOnText` used.
119
118
  * @property {LintResultCache|null} lintResultCache The cache of lint results.
120
119
  * @property {Linter} linter The linter instance which has loaded rules.
@@ -145,7 +144,7 @@ function validateFixTypes(fixTypes) {
145
144
 
146
145
  /**
147
146
  * It will calculate the error and warning count for collection of messages per file
148
- * @param {LintMessage[]} messages - Collection of messages
147
+ * @param {LintMessage[]} messages Collection of messages
149
148
  * @returns {Object} Contains the stats
150
149
  * @private
151
150
  */
@@ -173,7 +172,7 @@ function calculateStatsPerFile(messages) {
173
172
 
174
173
  /**
175
174
  * 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
175
+ * @param {LintResult[]} results Collection of messages from all the files
177
176
  * @returns {Object} Contains the stats
178
177
  * @private
179
178
  */
@@ -272,8 +271,8 @@ function verifyText({
272
271
 
273
272
  /**
274
273
  * 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
274
+ * @param {string} filePath File path of checked code
275
+ * @param {string} baseDir Absolute path of base directory
277
276
  * @returns {LintResult} Result with single warning
278
277
  * @private
279
278
  */
@@ -387,7 +386,6 @@ function isErrorMessage(message) {
387
386
  * name will be the `cacheFile/.cache_hashOfCWD`
388
387
  *
389
388
  * if cacheFile points to a file or looks like a file then in will just use that file
390
- *
391
389
  * @param {string} cacheFile The name of file to be used to store the cache
392
390
  * @param {string} cwd Current working directory
393
391
  * @returns {string} the resolved path to the cache file
@@ -487,13 +485,20 @@ function toBooleanMap(keys, defaultValue, displayName) {
487
485
  * @returns {ConfigData|null} The created config data.
488
486
  */
489
487
  function createConfigDataFromOptions(options) {
490
- const { parser, parserOptions, plugins, rules } = options;
488
+ const {
489
+ ignorePattern,
490
+ parser,
491
+ parserOptions,
492
+ plugins,
493
+ rules
494
+ } = options;
491
495
  const env = toBooleanMap(options.envs, true, "envs");
492
496
  const globals = toBooleanMap(options.globals, false, "globals");
493
497
 
494
498
  if (
495
499
  env === void 0 &&
496
500
  globals === void 0 &&
501
+ (ignorePattern === void 0 || ignorePattern.length === 0) &&
497
502
  parser === void 0 &&
498
503
  parserOptions === void 0 &&
499
504
  plugins === void 0 &&
@@ -501,7 +506,15 @@ function createConfigDataFromOptions(options) {
501
506
  ) {
502
507
  return null;
503
508
  }
504
- return { env, globals, parser, parserOptions, plugins, rules };
509
+ return {
510
+ env,
511
+ globals,
512
+ ignorePatterns: ignorePattern,
513
+ parser,
514
+ parserOptions,
515
+ plugins,
516
+ rules
517
+ };
505
518
  }
506
519
 
507
520
  /**
@@ -552,23 +565,22 @@ class CLIEngine {
552
565
  baseConfig: options.baseConfig || null,
553
566
  cliConfig: createConfigDataFromOptions(options),
554
567
  cwd: options.cwd,
568
+ ignorePath: options.ignorePath,
555
569
  resolvePluginsRelativeTo: options.resolvePluginsRelativeTo,
556
570
  rulePaths: options.rulePaths,
557
571
  specificConfigPath: options.configFile,
558
572
  useEslintrc: options.useEslintrc
559
573
  });
560
- const ignoredPaths = new IgnoredPaths(options);
561
574
  const fileEnumerator = new FileEnumerator({
562
575
  configArrayFactory,
563
576
  cwd: options.cwd,
564
577
  extensions: options.extensions,
565
578
  globInputPaths: options.globInputPaths,
566
- ignore: options.ignore,
567
- ignoredPaths
579
+ ignore: options.ignore
568
580
  });
569
581
  const lintResultCache =
570
582
  options.cache ? new LintResultCache(cacheFilePath) : null;
571
- const linter = new Linter();
583
+ const linter = new Linter({ cwd: options.cwd });
572
584
 
573
585
  /** @type {ConfigArray[]} */
574
586
  const lastConfigArrays = [configArrayFactory.getConfigArrayForFile()];
@@ -578,8 +590,8 @@ class CLIEngine {
578
590
  additionalPluginPool,
579
591
  cacheFilePath,
580
592
  configArrayFactory,
593
+ defaultIgnores: IgnorePattern.createDefaultIgnore(options.cwd),
581
594
  fileEnumerator,
582
- ignoredPaths,
583
595
  lastConfigArrays,
584
596
  lintResultCache,
585
597
  linter,
@@ -668,11 +680,14 @@ class CLIEngine {
668
680
  addPlugin(name, pluginObject) {
669
681
  const {
670
682
  additionalPluginPool,
671
- configArrayFactory
683
+ configArrayFactory,
684
+ lastConfigArrays
672
685
  } = internalSlotsMap.get(this);
673
686
 
674
687
  additionalPluginPool.set(name, pluginObject);
675
688
  configArrayFactory.clearCache();
689
+ lastConfigArrays.length = 1;
690
+ lastConfigArrays[0] = configArrayFactory.getConfigArrayForFile();
676
691
  }
677
692
 
678
693
  /**
@@ -833,7 +848,6 @@ class CLIEngine {
833
848
  const {
834
849
  configArrayFactory,
835
850
  fileEnumerator,
836
- ignoredPaths,
837
851
  lastConfigArrays,
838
852
  linter,
839
853
  options: {
@@ -850,7 +864,7 @@ class CLIEngine {
850
864
  // Clear the last used config arrays.
851
865
  lastConfigArrays.length = 0;
852
866
 
853
- if (resolvedFilename && ignoredPaths.contains(resolvedFilename)) {
867
+ if (resolvedFilename && this.isPathIgnored(resolvedFilename)) {
854
868
  if (warnIgnored) {
855
869
  results.push(createIgnoreResult(resolvedFilename, cwd));
856
870
  }
@@ -924,9 +938,23 @@ class CLIEngine {
924
938
  * @returns {boolean} Whether or not the given path is ignored.
925
939
  */
926
940
  isPathIgnored(filePath) {
927
- const { ignoredPaths } = internalSlotsMap.get(this);
941
+ const {
942
+ configArrayFactory,
943
+ defaultIgnores,
944
+ options: { cwd, ignore }
945
+ } = internalSlotsMap.get(this);
946
+ const absolutePath = path.resolve(cwd, filePath);
947
+
948
+ if (ignore) {
949
+ const config = configArrayFactory
950
+ .getConfigArrayForFile(absolutePath)
951
+ .extractConfig(absolutePath);
952
+ const ignores = config.ignores || defaultIgnores;
953
+
954
+ return ignores(absolutePath);
955
+ }
928
956
 
929
- return ignoredPaths.contains(filePath);
957
+ return defaultIgnores(absolutePath);
930
958
  }
931
959
 
932
960
  /**