@alexlit/lint-kit 166.1.0 → 167.0.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 (602) hide show
  1. package/package.json +1 -1
  2. package/packages/config-commitlint/package.json +3 -3
  3. package/packages/config-eslint/package.json +2 -2
  4. package/packages/config-eslint/node_modules/@eslint/js/LICENSE +0 -19
  5. package/packages/config-eslint/node_modules/@eslint/js/README.md +0 -103
  6. package/packages/config-eslint/node_modules/@eslint/js/package.json +0 -36
  7. package/packages/config-eslint/node_modules/@eslint/js/src/configs/eslint-all.js +0 -217
  8. package/packages/config-eslint/node_modules/@eslint/js/src/configs/eslint-recommended.js +0 -79
  9. package/packages/config-eslint/node_modules/@eslint/js/src/index.js +0 -23
  10. package/packages/config-eslint/node_modules/@eslint/js/types/index.d.ts +0 -14
  11. package/packages/config-eslint/node_modules/ajv/.tonic_example.js +0 -20
  12. package/packages/config-eslint/node_modules/ajv/LICENSE +0 -22
  13. package/packages/config-eslint/node_modules/ajv/README.md +0 -1497
  14. package/packages/config-eslint/node_modules/ajv/dist/ajv.bundle.js +0 -7189
  15. package/packages/config-eslint/node_modules/ajv/dist/ajv.min.js +0 -3
  16. package/packages/config-eslint/node_modules/ajv/dist/ajv.min.js.map +0 -1
  17. package/packages/config-eslint/node_modules/ajv/lib/ajv.d.ts +0 -397
  18. package/packages/config-eslint/node_modules/ajv/lib/ajv.js +0 -506
  19. package/packages/config-eslint/node_modules/ajv/lib/cache.js +0 -26
  20. package/packages/config-eslint/node_modules/ajv/lib/compile/async.js +0 -90
  21. package/packages/config-eslint/node_modules/ajv/lib/compile/equal.js +0 -5
  22. package/packages/config-eslint/node_modules/ajv/lib/compile/error_classes.js +0 -34
  23. package/packages/config-eslint/node_modules/ajv/lib/compile/formats.js +0 -142
  24. package/packages/config-eslint/node_modules/ajv/lib/compile/index.js +0 -387
  25. package/packages/config-eslint/node_modules/ajv/lib/compile/resolve.js +0 -270
  26. package/packages/config-eslint/node_modules/ajv/lib/compile/rules.js +0 -66
  27. package/packages/config-eslint/node_modules/ajv/lib/compile/schema_obj.js +0 -9
  28. package/packages/config-eslint/node_modules/ajv/lib/compile/ucs2length.js +0 -20
  29. package/packages/config-eslint/node_modules/ajv/lib/compile/util.js +0 -239
  30. package/packages/config-eslint/node_modules/ajv/lib/data.js +0 -49
  31. package/packages/config-eslint/node_modules/ajv/lib/definition_schema.js +0 -37
  32. package/packages/config-eslint/node_modules/ajv/lib/dot/_limit.jst +0 -113
  33. package/packages/config-eslint/node_modules/ajv/lib/dot/_limitItems.jst +0 -12
  34. package/packages/config-eslint/node_modules/ajv/lib/dot/_limitLength.jst +0 -12
  35. package/packages/config-eslint/node_modules/ajv/lib/dot/_limitProperties.jst +0 -12
  36. package/packages/config-eslint/node_modules/ajv/lib/dot/allOf.jst +0 -32
  37. package/packages/config-eslint/node_modules/ajv/lib/dot/anyOf.jst +0 -46
  38. package/packages/config-eslint/node_modules/ajv/lib/dot/coerce.def +0 -51
  39. package/packages/config-eslint/node_modules/ajv/lib/dot/comment.jst +0 -9
  40. package/packages/config-eslint/node_modules/ajv/lib/dot/const.jst +0 -11
  41. package/packages/config-eslint/node_modules/ajv/lib/dot/contains.jst +0 -55
  42. package/packages/config-eslint/node_modules/ajv/lib/dot/custom.jst +0 -191
  43. package/packages/config-eslint/node_modules/ajv/lib/dot/defaults.def +0 -47
  44. package/packages/config-eslint/node_modules/ajv/lib/dot/definitions.def +0 -203
  45. package/packages/config-eslint/node_modules/ajv/lib/dot/dependencies.jst +0 -79
  46. package/packages/config-eslint/node_modules/ajv/lib/dot/enum.jst +0 -30
  47. package/packages/config-eslint/node_modules/ajv/lib/dot/errors.def +0 -194
  48. package/packages/config-eslint/node_modules/ajv/lib/dot/format.jst +0 -106
  49. package/packages/config-eslint/node_modules/ajv/lib/dot/if.jst +0 -73
  50. package/packages/config-eslint/node_modules/ajv/lib/dot/items.jst +0 -98
  51. package/packages/config-eslint/node_modules/ajv/lib/dot/missing.def +0 -39
  52. package/packages/config-eslint/node_modules/ajv/lib/dot/multipleOf.jst +0 -22
  53. package/packages/config-eslint/node_modules/ajv/lib/dot/not.jst +0 -43
  54. package/packages/config-eslint/node_modules/ajv/lib/dot/oneOf.jst +0 -54
  55. package/packages/config-eslint/node_modules/ajv/lib/dot/pattern.jst +0 -14
  56. package/packages/config-eslint/node_modules/ajv/lib/dot/properties.jst +0 -245
  57. package/packages/config-eslint/node_modules/ajv/lib/dot/propertyNames.jst +0 -52
  58. package/packages/config-eslint/node_modules/ajv/lib/dot/ref.jst +0 -85
  59. package/packages/config-eslint/node_modules/ajv/lib/dot/required.jst +0 -108
  60. package/packages/config-eslint/node_modules/ajv/lib/dot/uniqueItems.jst +0 -62
  61. package/packages/config-eslint/node_modules/ajv/lib/dot/validate.jst +0 -276
  62. package/packages/config-eslint/node_modules/ajv/lib/dotjs/README.md +0 -3
  63. package/packages/config-eslint/node_modules/ajv/lib/dotjs/_limit.js +0 -163
  64. package/packages/config-eslint/node_modules/ajv/lib/dotjs/_limitItems.js +0 -80
  65. package/packages/config-eslint/node_modules/ajv/lib/dotjs/_limitLength.js +0 -85
  66. package/packages/config-eslint/node_modules/ajv/lib/dotjs/_limitProperties.js +0 -80
  67. package/packages/config-eslint/node_modules/ajv/lib/dotjs/allOf.js +0 -42
  68. package/packages/config-eslint/node_modules/ajv/lib/dotjs/anyOf.js +0 -73
  69. package/packages/config-eslint/node_modules/ajv/lib/dotjs/comment.js +0 -14
  70. package/packages/config-eslint/node_modules/ajv/lib/dotjs/const.js +0 -56
  71. package/packages/config-eslint/node_modules/ajv/lib/dotjs/contains.js +0 -81
  72. package/packages/config-eslint/node_modules/ajv/lib/dotjs/custom.js +0 -228
  73. package/packages/config-eslint/node_modules/ajv/lib/dotjs/dependencies.js +0 -168
  74. package/packages/config-eslint/node_modules/ajv/lib/dotjs/enum.js +0 -66
  75. package/packages/config-eslint/node_modules/ajv/lib/dotjs/format.js +0 -150
  76. package/packages/config-eslint/node_modules/ajv/lib/dotjs/if.js +0 -103
  77. package/packages/config-eslint/node_modules/ajv/lib/dotjs/index.js +0 -33
  78. package/packages/config-eslint/node_modules/ajv/lib/dotjs/items.js +0 -140
  79. package/packages/config-eslint/node_modules/ajv/lib/dotjs/multipleOf.js +0 -80
  80. package/packages/config-eslint/node_modules/ajv/lib/dotjs/not.js +0 -84
  81. package/packages/config-eslint/node_modules/ajv/lib/dotjs/oneOf.js +0 -73
  82. package/packages/config-eslint/node_modules/ajv/lib/dotjs/pattern.js +0 -75
  83. package/packages/config-eslint/node_modules/ajv/lib/dotjs/properties.js +0 -335
  84. package/packages/config-eslint/node_modules/ajv/lib/dotjs/propertyNames.js +0 -81
  85. package/packages/config-eslint/node_modules/ajv/lib/dotjs/ref.js +0 -124
  86. package/packages/config-eslint/node_modules/ajv/lib/dotjs/required.js +0 -270
  87. package/packages/config-eslint/node_modules/ajv/lib/dotjs/uniqueItems.js +0 -86
  88. package/packages/config-eslint/node_modules/ajv/lib/dotjs/validate.js +0 -482
  89. package/packages/config-eslint/node_modules/ajv/lib/keyword.js +0 -146
  90. package/packages/config-eslint/node_modules/ajv/lib/refs/data.json +0 -17
  91. package/packages/config-eslint/node_modules/ajv/lib/refs/json-schema-draft-04.json +0 -149
  92. package/packages/config-eslint/node_modules/ajv/lib/refs/json-schema-draft-06.json +0 -154
  93. package/packages/config-eslint/node_modules/ajv/lib/refs/json-schema-draft-07.json +0 -168
  94. package/packages/config-eslint/node_modules/ajv/lib/refs/json-schema-secure.json +0 -94
  95. package/packages/config-eslint/node_modules/ajv/package.json +0 -106
  96. package/packages/config-eslint/node_modules/ajv/scripts/.eslintrc.yml +0 -3
  97. package/packages/config-eslint/node_modules/ajv/scripts/bundle.js +0 -61
  98. package/packages/config-eslint/node_modules/ajv/scripts/compile-dots.js +0 -73
  99. package/packages/config-eslint/node_modules/ajv/scripts/info +0 -10
  100. package/packages/config-eslint/node_modules/ajv/scripts/prepare-tests +0 -12
  101. package/packages/config-eslint/node_modules/ajv/scripts/publish-built-version +0 -32
  102. package/packages/config-eslint/node_modules/ajv/scripts/travis-gh-pages +0 -23
  103. package/packages/config-eslint/node_modules/ansi-styles/index.d.ts +0 -345
  104. package/packages/config-eslint/node_modules/ansi-styles/index.js +0 -163
  105. package/packages/config-eslint/node_modules/ansi-styles/license +0 -9
  106. package/packages/config-eslint/node_modules/ansi-styles/package.json +0 -56
  107. package/packages/config-eslint/node_modules/ansi-styles/readme.md +0 -152
  108. package/packages/config-eslint/node_modules/chalk/index.d.ts +0 -415
  109. package/packages/config-eslint/node_modules/chalk/license +0 -9
  110. package/packages/config-eslint/node_modules/chalk/package.json +0 -68
  111. package/packages/config-eslint/node_modules/chalk/readme.md +0 -341
  112. package/packages/config-eslint/node_modules/chalk/source/index.js +0 -229
  113. package/packages/config-eslint/node_modules/chalk/source/templates.js +0 -134
  114. package/packages/config-eslint/node_modules/chalk/source/util.js +0 -39
  115. package/packages/config-eslint/node_modules/color-convert/CHANGELOG.md +0 -54
  116. package/packages/config-eslint/node_modules/color-convert/LICENSE +0 -21
  117. package/packages/config-eslint/node_modules/color-convert/README.md +0 -68
  118. package/packages/config-eslint/node_modules/color-convert/conversions.js +0 -839
  119. package/packages/config-eslint/node_modules/color-convert/index.js +0 -81
  120. package/packages/config-eslint/node_modules/color-convert/package.json +0 -48
  121. package/packages/config-eslint/node_modules/color-convert/route.js +0 -97
  122. package/packages/config-eslint/node_modules/color-name/LICENSE +0 -8
  123. package/packages/config-eslint/node_modules/color-name/README.md +0 -11
  124. package/packages/config-eslint/node_modules/color-name/index.js +0 -152
  125. package/packages/config-eslint/node_modules/color-name/package.json +0 -28
  126. package/packages/config-eslint/node_modules/eslint/LICENSE +0 -19
  127. package/packages/config-eslint/node_modules/eslint/README.md +0 -354
  128. package/packages/config-eslint/node_modules/eslint/bin/eslint.js +0 -196
  129. package/packages/config-eslint/node_modules/eslint/conf/default-cli-options.js +0 -32
  130. package/packages/config-eslint/node_modules/eslint/conf/ecma-version.js +0 -16
  131. package/packages/config-eslint/node_modules/eslint/conf/globals.js +0 -169
  132. package/packages/config-eslint/node_modules/eslint/conf/replacements.json +0 -26
  133. package/packages/config-eslint/node_modules/eslint/conf/rule-type-list.json +0 -91
  134. package/packages/config-eslint/node_modules/eslint/lib/api.js +0 -50
  135. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/cli-engine.js +0 -1109
  136. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/file-enumerator.js +0 -541
  137. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/formatters/formatters-meta.json +0 -18
  138. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/formatters/html.js +0 -359
  139. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/formatters/json-with-metadata.js +0 -16
  140. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/formatters/json.js +0 -13
  141. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/formatters/stylish.js +0 -122
  142. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/hash.js +0 -35
  143. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/index.js +0 -7
  144. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/lint-result-cache.js +0 -220
  145. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/load-rules.js +0 -46
  146. package/packages/config-eslint/node_modules/eslint/lib/cli.js +0 -553
  147. package/packages/config-eslint/node_modules/eslint/lib/config/config-loader.js +0 -816
  148. package/packages/config-eslint/node_modules/eslint/lib/config/config.js +0 -674
  149. package/packages/config-eslint/node_modules/eslint/lib/config/default-config.js +0 -78
  150. package/packages/config-eslint/node_modules/eslint/lib/config/flat-config-array.js +0 -217
  151. package/packages/config-eslint/node_modules/eslint/lib/config/flat-config-schema.js +0 -598
  152. package/packages/config-eslint/node_modules/eslint/lib/config-api.js +0 -12
  153. package/packages/config-eslint/node_modules/eslint/lib/eslint/eslint-helpers.js +0 -1465
  154. package/packages/config-eslint/node_modules/eslint/lib/eslint/eslint.js +0 -1362
  155. package/packages/config-eslint/node_modules/eslint/lib/eslint/index.js +0 -9
  156. package/packages/config-eslint/node_modules/eslint/lib/eslint/legacy-eslint.js +0 -786
  157. package/packages/config-eslint/node_modules/eslint/lib/eslint/worker.js +0 -173
  158. package/packages/config-eslint/node_modules/eslint/lib/languages/js/index.js +0 -336
  159. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/index.js +0 -7
  160. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/source-code.js +0 -1364
  161. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/backward-token-comment-cursor.js +0 -61
  162. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/backward-token-cursor.js +0 -57
  163. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/cursor.js +0 -76
  164. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/cursors.js +0 -120
  165. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/decorative-cursor.js +0 -38
  166. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/filter-cursor.js +0 -42
  167. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/forward-token-comment-cursor.js +0 -65
  168. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/forward-token-cursor.js +0 -62
  169. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/index.js +0 -721
  170. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/limit-cursor.js +0 -39
  171. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/padded-token-cursor.js +0 -45
  172. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/skip-cursor.js +0 -41
  173. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/utils.js +0 -110
  174. package/packages/config-eslint/node_modules/eslint/lib/languages/js/validate-language-options.js +0 -196
  175. package/packages/config-eslint/node_modules/eslint/lib/linter/apply-disable-directives.js +0 -584
  176. package/packages/config-eslint/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js +0 -828
  177. package/packages/config-eslint/node_modules/eslint/lib/linter/code-path-analysis/code-path-segment.js +0 -262
  178. package/packages/config-eslint/node_modules/eslint/lib/linter/code-path-analysis/code-path-state.js +0 -2370
  179. package/packages/config-eslint/node_modules/eslint/lib/linter/code-path-analysis/code-path.js +0 -332
  180. package/packages/config-eslint/node_modules/eslint/lib/linter/code-path-analysis/debug-helpers.js +0 -223
  181. package/packages/config-eslint/node_modules/eslint/lib/linter/code-path-analysis/fork-context.js +0 -374
  182. package/packages/config-eslint/node_modules/eslint/lib/linter/code-path-analysis/id-generator.js +0 -44
  183. package/packages/config-eslint/node_modules/eslint/lib/linter/esquery.js +0 -332
  184. package/packages/config-eslint/node_modules/eslint/lib/linter/file-context.js +0 -144
  185. package/packages/config-eslint/node_modules/eslint/lib/linter/file-report.js +0 -608
  186. package/packages/config-eslint/node_modules/eslint/lib/linter/index.js +0 -11
  187. package/packages/config-eslint/node_modules/eslint/lib/linter/interpolate.js +0 -50
  188. package/packages/config-eslint/node_modules/eslint/lib/linter/linter.js +0 -2676
  189. package/packages/config-eslint/node_modules/eslint/lib/linter/rule-fixer.js +0 -169
  190. package/packages/config-eslint/node_modules/eslint/lib/linter/rules.js +0 -71
  191. package/packages/config-eslint/node_modules/eslint/lib/linter/source-code-fixer.js +0 -154
  192. package/packages/config-eslint/node_modules/eslint/lib/linter/source-code-traverser.js +0 -333
  193. package/packages/config-eslint/node_modules/eslint/lib/linter/source-code-visitor.js +0 -81
  194. package/packages/config-eslint/node_modules/eslint/lib/linter/timing.js +0 -209
  195. package/packages/config-eslint/node_modules/eslint/lib/linter/vfile.js +0 -115
  196. package/packages/config-eslint/node_modules/eslint/lib/options.js +0 -536
  197. package/packages/config-eslint/node_modules/eslint/lib/rule-tester/index.js +0 -7
  198. package/packages/config-eslint/node_modules/eslint/lib/rule-tester/rule-tester.js +0 -1579
  199. package/packages/config-eslint/node_modules/eslint/lib/rules/accessor-pairs.js +0 -420
  200. package/packages/config-eslint/node_modules/eslint/lib/rules/array-bracket-newline.js +0 -291
  201. package/packages/config-eslint/node_modules/eslint/lib/rules/array-bracket-spacing.js +0 -301
  202. package/packages/config-eslint/node_modules/eslint/lib/rules/array-callback-return.js +0 -493
  203. package/packages/config-eslint/node_modules/eslint/lib/rules/array-element-newline.js +0 -374
  204. package/packages/config-eslint/node_modules/eslint/lib/rules/arrow-body-style.js +0 -418
  205. package/packages/config-eslint/node_modules/eslint/lib/rules/arrow-parens.js +0 -237
  206. package/packages/config-eslint/node_modules/eslint/lib/rules/arrow-spacing.js +0 -188
  207. package/packages/config-eslint/node_modules/eslint/lib/rules/block-scoped-var.js +0 -137
  208. package/packages/config-eslint/node_modules/eslint/lib/rules/block-spacing.js +0 -202
  209. package/packages/config-eslint/node_modules/eslint/lib/rules/brace-style.js +0 -278
  210. package/packages/config-eslint/node_modules/eslint/lib/rules/callback-return.js +0 -216
  211. package/packages/config-eslint/node_modules/eslint/lib/rules/camelcase.js +0 -422
  212. package/packages/config-eslint/node_modules/eslint/lib/rules/capitalized-comments.js +0 -325
  213. package/packages/config-eslint/node_modules/eslint/lib/rules/class-methods-use-this.js +0 -250
  214. package/packages/config-eslint/node_modules/eslint/lib/rules/comma-dangle.js +0 -424
  215. package/packages/config-eslint/node_modules/eslint/lib/rules/comma-spacing.js +0 -208
  216. package/packages/config-eslint/node_modules/eslint/lib/rules/comma-style.js +0 -391
  217. package/packages/config-eslint/node_modules/eslint/lib/rules/complexity.js +0 -201
  218. package/packages/config-eslint/node_modules/eslint/lib/rules/computed-property-spacing.js +0 -251
  219. package/packages/config-eslint/node_modules/eslint/lib/rules/consistent-return.js +0 -221
  220. package/packages/config-eslint/node_modules/eslint/lib/rules/consistent-this.js +0 -179
  221. package/packages/config-eslint/node_modules/eslint/lib/rules/constructor-super.js +0 -453
  222. package/packages/config-eslint/node_modules/eslint/lib/rules/curly.js +0 -425
  223. package/packages/config-eslint/node_modules/eslint/lib/rules/default-case-last.js +0 -51
  224. package/packages/config-eslint/node_modules/eslint/lib/rules/default-case.js +0 -103
  225. package/packages/config-eslint/node_modules/eslint/lib/rules/default-param-last.js +0 -78
  226. package/packages/config-eslint/node_modules/eslint/lib/rules/dot-location.js +0 -138
  227. package/packages/config-eslint/node_modules/eslint/lib/rules/dot-notation.js +0 -216
  228. package/packages/config-eslint/node_modules/eslint/lib/rules/eol-last.js +0 -135
  229. package/packages/config-eslint/node_modules/eslint/lib/rules/eqeqeq.js +0 -210
  230. package/packages/config-eslint/node_modules/eslint/lib/rules/for-direction.js +0 -168
  231. package/packages/config-eslint/node_modules/eslint/lib/rules/func-call-spacing.js +0 -281
  232. package/packages/config-eslint/node_modules/eslint/lib/rules/func-name-matching.js +0 -338
  233. package/packages/config-eslint/node_modules/eslint/lib/rules/func-names.js +0 -192
  234. package/packages/config-eslint/node_modules/eslint/lib/rules/func-style.js +0 -221
  235. package/packages/config-eslint/node_modules/eslint/lib/rules/function-call-argument-newline.js +0 -166
  236. package/packages/config-eslint/node_modules/eslint/lib/rules/function-paren-newline.js +0 -368
  237. package/packages/config-eslint/node_modules/eslint/lib/rules/generator-star-spacing.js +0 -246
  238. package/packages/config-eslint/node_modules/eslint/lib/rules/getter-return.js +0 -242
  239. package/packages/config-eslint/node_modules/eslint/lib/rules/global-require.js +0 -117
  240. package/packages/config-eslint/node_modules/eslint/lib/rules/grouped-accessor-pairs.js +0 -268
  241. package/packages/config-eslint/node_modules/eslint/lib/rules/guard-for-in.js +0 -85
  242. package/packages/config-eslint/node_modules/eslint/lib/rules/handle-callback-err.js +0 -122
  243. package/packages/config-eslint/node_modules/eslint/lib/rules/id-blacklist.js +0 -241
  244. package/packages/config-eslint/node_modules/eslint/lib/rules/id-denylist.js +0 -223
  245. package/packages/config-eslint/node_modules/eslint/lib/rules/id-length.js +0 -217
  246. package/packages/config-eslint/node_modules/eslint/lib/rules/id-match.js +0 -363
  247. package/packages/config-eslint/node_modules/eslint/lib/rules/implicit-arrow-linebreak.js +0 -125
  248. package/packages/config-eslint/node_modules/eslint/lib/rules/indent-legacy.js +0 -1369
  249. package/packages/config-eslint/node_modules/eslint/lib/rules/indent.js +0 -2334
  250. package/packages/config-eslint/node_modules/eslint/lib/rules/index.js +0 -332
  251. package/packages/config-eslint/node_modules/eslint/lib/rules/init-declarations.js +0 -172
  252. package/packages/config-eslint/node_modules/eslint/lib/rules/jsx-quotes.js +0 -128
  253. package/packages/config-eslint/node_modules/eslint/lib/rules/key-spacing.js +0 -822
  254. package/packages/config-eslint/node_modules/eslint/lib/rules/keyword-spacing.js +0 -701
  255. package/packages/config-eslint/node_modules/eslint/lib/rules/line-comment-position.js +0 -157
  256. package/packages/config-eslint/node_modules/eslint/lib/rules/linebreak-style.js +0 -135
  257. package/packages/config-eslint/node_modules/eslint/lib/rules/lines-around-comment.js +0 -581
  258. package/packages/config-eslint/node_modules/eslint/lib/rules/lines-around-directive.js +0 -249
  259. package/packages/config-eslint/node_modules/eslint/lib/rules/lines-between-class-members.js +0 -358
  260. package/packages/config-eslint/node_modules/eslint/lib/rules/logical-assignment-operators.js +0 -688
  261. package/packages/config-eslint/node_modules/eslint/lib/rules/max-classes-per-file.js +0 -90
  262. package/packages/config-eslint/node_modules/eslint/lib/rules/max-depth.js +0 -159
  263. package/packages/config-eslint/node_modules/eslint/lib/rules/max-len.js +0 -497
  264. package/packages/config-eslint/node_modules/eslint/lib/rules/max-lines-per-function.js +0 -238
  265. package/packages/config-eslint/node_modules/eslint/lib/rules/max-lines.js +0 -189
  266. package/packages/config-eslint/node_modules/eslint/lib/rules/max-nested-callbacks.js +0 -115
  267. package/packages/config-eslint/node_modules/eslint/lib/rules/max-params.js +0 -129
  268. package/packages/config-eslint/node_modules/eslint/lib/rules/max-statements-per-line.js +0 -224
  269. package/packages/config-eslint/node_modules/eslint/lib/rules/max-statements.js +0 -188
  270. package/packages/config-eslint/node_modules/eslint/lib/rules/multiline-comment-style.js +0 -652
  271. package/packages/config-eslint/node_modules/eslint/lib/rules/multiline-ternary.js +0 -257
  272. package/packages/config-eslint/node_modules/eslint/lib/rules/new-cap.js +0 -277
  273. package/packages/config-eslint/node_modules/eslint/lib/rules/new-parens.js +0 -120
  274. package/packages/config-eslint/node_modules/eslint/lib/rules/newline-after-var.js +0 -307
  275. package/packages/config-eslint/node_modules/eslint/lib/rules/newline-before-return.js +0 -242
  276. package/packages/config-eslint/node_modules/eslint/lib/rules/newline-per-chained-call.js +0 -159
  277. package/packages/config-eslint/node_modules/eslint/lib/rules/no-alert.js +0 -149
  278. package/packages/config-eslint/node_modules/eslint/lib/rules/no-array-constructor.js +0 -195
  279. package/packages/config-eslint/node_modules/eslint/lib/rules/no-async-promise-executor.js +0 -45
  280. package/packages/config-eslint/node_modules/eslint/lib/rules/no-await-in-loop.js +0 -115
  281. package/packages/config-eslint/node_modules/eslint/lib/rules/no-bitwise.js +0 -145
  282. package/packages/config-eslint/node_modules/eslint/lib/rules/no-buffer-constructor.js +0 -74
  283. package/packages/config-eslint/node_modules/eslint/lib/rules/no-caller.js +0 -52
  284. package/packages/config-eslint/node_modules/eslint/lib/rules/no-case-declarations.js +0 -80
  285. package/packages/config-eslint/node_modules/eslint/lib/rules/no-catch-shadow.js +0 -96
  286. package/packages/config-eslint/node_modules/eslint/lib/rules/no-class-assign.js +0 -66
  287. package/packages/config-eslint/node_modules/eslint/lib/rules/no-compare-neg-zero.js +0 -74
  288. package/packages/config-eslint/node_modules/eslint/lib/rules/no-cond-assign.js +0 -175
  289. package/packages/config-eslint/node_modules/eslint/lib/rules/no-confusing-arrow.js +0 -127
  290. package/packages/config-eslint/node_modules/eslint/lib/rules/no-console.js +0 -221
  291. package/packages/config-eslint/node_modules/eslint/lib/rules/no-const-assign.js +0 -73
  292. package/packages/config-eslint/node_modules/eslint/lib/rules/no-constant-binary-expression.js +0 -603
  293. package/packages/config-eslint/node_modules/eslint/lib/rules/no-constant-condition.js +0 -177
  294. package/packages/config-eslint/node_modules/eslint/lib/rules/no-constructor-return.js +0 -62
  295. package/packages/config-eslint/node_modules/eslint/lib/rules/no-continue.js +0 -38
  296. package/packages/config-eslint/node_modules/eslint/lib/rules/no-control-regex.js +0 -142
  297. package/packages/config-eslint/node_modules/eslint/lib/rules/no-debugger.js +0 -41
  298. package/packages/config-eslint/node_modules/eslint/lib/rules/no-delete-var.js +0 -42
  299. package/packages/config-eslint/node_modules/eslint/lib/rules/no-div-regex.js +0 -60
  300. package/packages/config-eslint/node_modules/eslint/lib/rules/no-dupe-args.js +0 -92
  301. package/packages/config-eslint/node_modules/eslint/lib/rules/no-dupe-class-members.js +0 -117
  302. package/packages/config-eslint/node_modules/eslint/lib/rules/no-dupe-else-if.js +0 -145
  303. package/packages/config-eslint/node_modules/eslint/lib/rules/no-dupe-keys.js +0 -165
  304. package/packages/config-eslint/node_modules/eslint/lib/rules/no-duplicate-case.js +0 -78
  305. package/packages/config-eslint/node_modules/eslint/lib/rules/no-duplicate-imports.js +0 -368
  306. package/packages/config-eslint/node_modules/eslint/lib/rules/no-else-return.js +0 -450
  307. package/packages/config-eslint/node_modules/eslint/lib/rules/no-empty-character-class.js +0 -83
  308. package/packages/config-eslint/node_modules/eslint/lib/rules/no-empty-function.js +0 -236
  309. package/packages/config-eslint/node_modules/eslint/lib/rules/no-empty-pattern.js +0 -85
  310. package/packages/config-eslint/node_modules/eslint/lib/rules/no-empty-static-block.js +0 -73
  311. package/packages/config-eslint/node_modules/eslint/lib/rules/no-empty.js +0 -153
  312. package/packages/config-eslint/node_modules/eslint/lib/rules/no-eq-null.js +0 -51
  313. package/packages/config-eslint/node_modules/eslint/lib/rules/no-eval.js +0 -295
  314. package/packages/config-eslint/node_modules/eslint/lib/rules/no-ex-assign.js +0 -57
  315. package/packages/config-eslint/node_modules/eslint/lib/rules/no-extend-native.js +0 -180
  316. package/packages/config-eslint/node_modules/eslint/lib/rules/no-extra-bind.js +0 -224
  317. package/packages/config-eslint/node_modules/eslint/lib/rules/no-extra-boolean-cast.js +0 -420
  318. package/packages/config-eslint/node_modules/eslint/lib/rules/no-extra-label.js +0 -169
  319. package/packages/config-eslint/node_modules/eslint/lib/rules/no-extra-parens.js +0 -1669
  320. package/packages/config-eslint/node_modules/eslint/lib/rules/no-extra-semi.js +0 -167
  321. package/packages/config-eslint/node_modules/eslint/lib/rules/no-fallthrough.js +0 -260
  322. package/packages/config-eslint/node_modules/eslint/lib/rules/no-floating-decimal.js +0 -99
  323. package/packages/config-eslint/node_modules/eslint/lib/rules/no-func-assign.js +0 -77
  324. package/packages/config-eslint/node_modules/eslint/lib/rules/no-global-assign.js +0 -101
  325. package/packages/config-eslint/node_modules/eslint/lib/rules/no-implicit-coercion.js +0 -468
  326. package/packages/config-eslint/node_modules/eslint/lib/rules/no-implicit-globals.js +0 -187
  327. package/packages/config-eslint/node_modules/eslint/lib/rules/no-implied-eval.js +0 -170
  328. package/packages/config-eslint/node_modules/eslint/lib/rules/no-import-assign.js +0 -227
  329. package/packages/config-eslint/node_modules/eslint/lib/rules/no-inline-comments.js +0 -115
  330. package/packages/config-eslint/node_modules/eslint/lib/rules/no-inner-declarations.js +0 -147
  331. package/packages/config-eslint/node_modules/eslint/lib/rules/no-invalid-regexp.js +0 -243
  332. package/packages/config-eslint/node_modules/eslint/lib/rules/no-invalid-this.js +0 -178
  333. package/packages/config-eslint/node_modules/eslint/lib/rules/no-irregular-whitespace.js +0 -292
  334. package/packages/config-eslint/node_modules/eslint/lib/rules/no-iterator.js +0 -48
  335. package/packages/config-eslint/node_modules/eslint/lib/rules/no-label-var.js +0 -78
  336. package/packages/config-eslint/node_modules/eslint/lib/rules/no-labels.js +0 -156
  337. package/packages/config-eslint/node_modules/eslint/lib/rules/no-lone-blocks.js +0 -140
  338. package/packages/config-eslint/node_modules/eslint/lib/rules/no-lonely-if.js +0 -126
  339. package/packages/config-eslint/node_modules/eslint/lib/rules/no-loop-func.js +0 -267
  340. package/packages/config-eslint/node_modules/eslint/lib/rules/no-loss-of-precision.js +0 -249
  341. package/packages/config-eslint/node_modules/eslint/lib/rules/no-magic-numbers.js +0 -365
  342. package/packages/config-eslint/node_modules/eslint/lib/rules/no-misleading-character-class.js +0 -595
  343. package/packages/config-eslint/node_modules/eslint/lib/rules/no-mixed-operators.js +0 -253
  344. package/packages/config-eslint/node_modules/eslint/lib/rules/no-mixed-requires.js +0 -267
  345. package/packages/config-eslint/node_modules/eslint/lib/rules/no-mixed-spaces-and-tabs.js +0 -148
  346. package/packages/config-eslint/node_modules/eslint/lib/rules/no-multi-assign.js +0 -66
  347. package/packages/config-eslint/node_modules/eslint/lib/rules/no-multi-spaces.js +0 -179
  348. package/packages/config-eslint/node_modules/eslint/lib/rules/no-multi-str.js +0 -67
  349. package/packages/config-eslint/node_modules/eslint/lib/rules/no-multiple-empty-lines.js +0 -210
  350. package/packages/config-eslint/node_modules/eslint/lib/rules/no-native-reassign.js +0 -114
  351. package/packages/config-eslint/node_modules/eslint/lib/rules/no-negated-condition.js +0 -100
  352. package/packages/config-eslint/node_modules/eslint/lib/rules/no-negated-in-lhs.js +0 -59
  353. package/packages/config-eslint/node_modules/eslint/lib/rules/no-nested-ternary.js +0 -46
  354. package/packages/config-eslint/node_modules/eslint/lib/rules/no-new-func.js +0 -96
  355. package/packages/config-eslint/node_modules/eslint/lib/rules/no-new-native-nonconstructor.js +0 -70
  356. package/packages/config-eslint/node_modules/eslint/lib/rules/no-new-object.js +0 -76
  357. package/packages/config-eslint/node_modules/eslint/lib/rules/no-new-require.js +0 -67
  358. package/packages/config-eslint/node_modules/eslint/lib/rules/no-new-symbol.js +0 -74
  359. package/packages/config-eslint/node_modules/eslint/lib/rules/no-new-wrappers.js +0 -62
  360. package/packages/config-eslint/node_modules/eslint/lib/rules/no-new.js +0 -42
  361. package/packages/config-eslint/node_modules/eslint/lib/rules/no-nonoctal-decimal-escape.js +0 -176
  362. package/packages/config-eslint/node_modules/eslint/lib/rules/no-obj-calls.js +0 -99
  363. package/packages/config-eslint/node_modules/eslint/lib/rules/no-object-constructor.js +0 -124
  364. package/packages/config-eslint/node_modules/eslint/lib/rules/no-octal-escape.js +0 -53
  365. package/packages/config-eslint/node_modules/eslint/lib/rules/no-octal.js +0 -42
  366. package/packages/config-eslint/node_modules/eslint/lib/rules/no-param-reassign.js +0 -248
  367. package/packages/config-eslint/node_modules/eslint/lib/rules/no-path-concat.js +0 -79
  368. package/packages/config-eslint/node_modules/eslint/lib/rules/no-plusplus.js +0 -102
  369. package/packages/config-eslint/node_modules/eslint/lib/rules/no-process-env.js +0 -68
  370. package/packages/config-eslint/node_modules/eslint/lib/rules/no-process-exit.js +0 -67
  371. package/packages/config-eslint/node_modules/eslint/lib/rules/no-promise-executor-return.js +0 -264
  372. package/packages/config-eslint/node_modules/eslint/lib/rules/no-proto.js +0 -45
  373. package/packages/config-eslint/node_modules/eslint/lib/rules/no-prototype-builtins.js +0 -181
  374. package/packages/config-eslint/node_modules/eslint/lib/rules/no-redeclare.js +0 -173
  375. package/packages/config-eslint/node_modules/eslint/lib/rules/no-regex-spaces.js +0 -219
  376. package/packages/config-eslint/node_modules/eslint/lib/rules/no-restricted-exports.js +0 -227
  377. package/packages/config-eslint/node_modules/eslint/lib/rules/no-restricted-globals.js +0 -266
  378. package/packages/config-eslint/node_modules/eslint/lib/rules/no-restricted-imports.js +0 -850
  379. package/packages/config-eslint/node_modules/eslint/lib/rules/no-restricted-modules.js +0 -249
  380. package/packages/config-eslint/node_modules/eslint/lib/rules/no-restricted-properties.js +0 -233
  381. package/packages/config-eslint/node_modules/eslint/lib/rules/no-restricted-syntax.js +0 -74
  382. package/packages/config-eslint/node_modules/eslint/lib/rules/no-return-assign.js +0 -87
  383. package/packages/config-eslint/node_modules/eslint/lib/rules/no-return-await.js +0 -162
  384. package/packages/config-eslint/node_modules/eslint/lib/rules/no-script-url.js +0 -68
  385. package/packages/config-eslint/node_modules/eslint/lib/rules/no-self-assign.js +0 -186
  386. package/packages/config-eslint/node_modules/eslint/lib/rules/no-self-compare.js +0 -77
  387. package/packages/config-eslint/node_modules/eslint/lib/rules/no-sequences.js +0 -158
  388. package/packages/config-eslint/node_modules/eslint/lib/rules/no-setter-return.js +0 -224
  389. package/packages/config-eslint/node_modules/eslint/lib/rules/no-shadow-restricted-names.js +0 -113
  390. package/packages/config-eslint/node_modules/eslint/lib/rules/no-shadow.js +0 -624
  391. package/packages/config-eslint/node_modules/eslint/lib/rules/no-spaced-func.js +0 -105
  392. package/packages/config-eslint/node_modules/eslint/lib/rules/no-sparse-arrays.js +0 -68
  393. package/packages/config-eslint/node_modules/eslint/lib/rules/no-sync.js +0 -81
  394. package/packages/config-eslint/node_modules/eslint/lib/rules/no-tabs.js +0 -110
  395. package/packages/config-eslint/node_modules/eslint/lib/rules/no-template-curly-in-string.js +0 -45
  396. package/packages/config-eslint/node_modules/eslint/lib/rules/no-ternary.js +0 -38
  397. package/packages/config-eslint/node_modules/eslint/lib/rules/no-this-before-super.js +0 -365
  398. package/packages/config-eslint/node_modules/eslint/lib/rules/no-throw-literal.js +0 -46
  399. package/packages/config-eslint/node_modules/eslint/lib/rules/no-trailing-spaces.js +0 -227
  400. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unassigned-vars.js +0 -80
  401. package/packages/config-eslint/node_modules/eslint/lib/rules/no-undef-init.js +0 -101
  402. package/packages/config-eslint/node_modules/eslint/lib/rules/no-undef.js +0 -84
  403. package/packages/config-eslint/node_modules/eslint/lib/rules/no-undefined.js +0 -85
  404. package/packages/config-eslint/node_modules/eslint/lib/rules/no-underscore-dangle.js +0 -383
  405. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unexpected-multiline.js +0 -130
  406. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unmodified-loop-condition.js +0 -360
  407. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unneeded-ternary.js +0 -232
  408. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unreachable-loop.js +0 -190
  409. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unreachable.js +0 -300
  410. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unsafe-finally.js +0 -119
  411. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unsafe-negation.js +0 -152
  412. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unsafe-optional-chaining.js +0 -221
  413. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unused-expressions.js +0 -227
  414. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unused-labels.js +0 -158
  415. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unused-private-class-members.js +0 -219
  416. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unused-vars.js +0 -1739
  417. package/packages/config-eslint/node_modules/eslint/lib/rules/no-use-before-define.js +0 -446
  418. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-assignment.js +0 -654
  419. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-backreference.js +0 -263
  420. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-call.js +0 -95
  421. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-catch.js +0 -57
  422. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-computed-key.js +0 -204
  423. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-concat.js +0 -121
  424. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-constructor.js +0 -252
  425. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-escape.js +0 -406
  426. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-rename.js +0 -202
  427. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-return.js +0 -401
  428. package/packages/config-eslint/node_modules/eslint/lib/rules/no-var.js +0 -367
  429. package/packages/config-eslint/node_modules/eslint/lib/rules/no-void.js +0 -69
  430. package/packages/config-eslint/node_modules/eslint/lib/rules/no-warning-comments.js +0 -209
  431. package/packages/config-eslint/node_modules/eslint/lib/rules/no-whitespace-before-property.js +0 -150
  432. package/packages/config-eslint/node_modules/eslint/lib/rules/no-with.js +0 -37
  433. package/packages/config-eslint/node_modules/eslint/lib/rules/nonblock-statement-body-position.js +0 -164
  434. package/packages/config-eslint/node_modules/eslint/lib/rules/object-curly-newline.js +0 -383
  435. package/packages/config-eslint/node_modules/eslint/lib/rules/object-curly-spacing.js +0 -375
  436. package/packages/config-eslint/node_modules/eslint/lib/rules/object-property-newline.js +0 -151
  437. package/packages/config-eslint/node_modules/eslint/lib/rules/object-shorthand.js +0 -652
  438. package/packages/config-eslint/node_modules/eslint/lib/rules/one-var-declaration-per-line.js +0 -117
  439. package/packages/config-eslint/node_modules/eslint/lib/rules/one-var.js +0 -717
  440. package/packages/config-eslint/node_modules/eslint/lib/rules/operator-assignment.js +0 -270
  441. package/packages/config-eslint/node_modules/eslint/lib/rules/operator-linebreak.js +0 -315
  442. package/packages/config-eslint/node_modules/eslint/lib/rules/padded-blocks.js +0 -366
  443. package/packages/config-eslint/node_modules/eslint/lib/rules/padding-line-between-statements.js +0 -612
  444. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-arrow-callback.js +0 -437
  445. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-const.js +0 -546
  446. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-destructuring.js +0 -332
  447. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-exponentiation-operator.js +0 -235
  448. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-named-capture-group.js +0 -197
  449. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-numeric-literals.js +0 -157
  450. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-object-has-own.js +0 -148
  451. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-object-spread.js +0 -319
  452. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-promise-reject-errors.js +0 -154
  453. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-reflect.js +0 -150
  454. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-regex-literals.js +0 -605
  455. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-rest-params.js +0 -117
  456. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-spread.js +0 -91
  457. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-template.js +0 -347
  458. package/packages/config-eslint/node_modules/eslint/lib/rules/preserve-caught-error.js +0 -535
  459. package/packages/config-eslint/node_modules/eslint/lib/rules/quote-props.js +0 -394
  460. package/packages/config-eslint/node_modules/eslint/lib/rules/quotes.js +0 -416
  461. package/packages/config-eslint/node_modules/eslint/lib/rules/radix.js +0 -216
  462. package/packages/config-eslint/node_modules/eslint/lib/rules/require-atomic-updates.js +0 -365
  463. package/packages/config-eslint/node_modules/eslint/lib/rules/require-await.js +0 -184
  464. package/packages/config-eslint/node_modules/eslint/lib/rules/require-unicode-regexp.js +0 -317
  465. package/packages/config-eslint/node_modules/eslint/lib/rules/require-yield.js +0 -76
  466. package/packages/config-eslint/node_modules/eslint/lib/rules/rest-spread-spacing.js +0 -153
  467. package/packages/config-eslint/node_modules/eslint/lib/rules/semi-spacing.js +0 -297
  468. package/packages/config-eslint/node_modules/eslint/lib/rules/semi-style.js +0 -218
  469. package/packages/config-eslint/node_modules/eslint/lib/rules/semi.js +0 -476
  470. package/packages/config-eslint/node_modules/eslint/lib/rules/sort-imports.js +0 -319
  471. package/packages/config-eslint/node_modules/eslint/lib/rules/sort-keys.js +0 -268
  472. package/packages/config-eslint/node_modules/eslint/lib/rules/sort-vars.js +0 -140
  473. package/packages/config-eslint/node_modules/eslint/lib/rules/space-before-blocks.js +0 -232
  474. package/packages/config-eslint/node_modules/eslint/lib/rules/space-before-function-paren.js +0 -205
  475. package/packages/config-eslint/node_modules/eslint/lib/rules/space-in-parens.js +0 -374
  476. package/packages/config-eslint/node_modules/eslint/lib/rules/space-infix-ops.js +0 -252
  477. package/packages/config-eslint/node_modules/eslint/lib/rules/space-unary-ops.js +0 -400
  478. package/packages/config-eslint/node_modules/eslint/lib/rules/spaced-comment.js +0 -447
  479. package/packages/config-eslint/node_modules/eslint/lib/rules/strict.js +0 -314
  480. package/packages/config-eslint/node_modules/eslint/lib/rules/switch-colon-spacing.js +0 -158
  481. package/packages/config-eslint/node_modules/eslint/lib/rules/symbol-description.js +0 -70
  482. package/packages/config-eslint/node_modules/eslint/lib/rules/template-curly-spacing.js +0 -168
  483. package/packages/config-eslint/node_modules/eslint/lib/rules/template-tag-spacing.js +0 -121
  484. package/packages/config-eslint/node_modules/eslint/lib/rules/unicode-bom.js +0 -73
  485. package/packages/config-eslint/node_modules/eslint/lib/rules/use-isnan.js +0 -268
  486. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/ast-utils.js +0 -2733
  487. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/char-source.js +0 -247
  488. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/fix-tracker.js +0 -125
  489. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/keywords.js +0 -67
  490. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/lazy-loading-rule-map.js +0 -118
  491. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/regular-expressions.js +0 -58
  492. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/unicode/index.js +0 -16
  493. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/unicode/is-combining-character.js +0 -13
  494. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/unicode/is-emoji-modifier.js +0 -13
  495. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/unicode/is-regional-indicator-symbol.js +0 -13
  496. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/unicode/is-surrogate-pair.js +0 -14
  497. package/packages/config-eslint/node_modules/eslint/lib/rules/valid-typeof.js +0 -171
  498. package/packages/config-eslint/node_modules/eslint/lib/rules/vars-on-top.js +0 -165
  499. package/packages/config-eslint/node_modules/eslint/lib/rules/wrap-iife.js +0 -238
  500. package/packages/config-eslint/node_modules/eslint/lib/rules/wrap-regex.js +0 -91
  501. package/packages/config-eslint/node_modules/eslint/lib/rules/yield-star-spacing.js +0 -159
  502. package/packages/config-eslint/node_modules/eslint/lib/rules/yoda.js +0 -362
  503. package/packages/config-eslint/node_modules/eslint/lib/services/parser-service.js +0 -65
  504. package/packages/config-eslint/node_modules/eslint/lib/services/processor-service.js +0 -101
  505. package/packages/config-eslint/node_modules/eslint/lib/services/suppressions-service.js +0 -302
  506. package/packages/config-eslint/node_modules/eslint/lib/services/warning-service.js +0 -111
  507. package/packages/config-eslint/node_modules/eslint/lib/shared/ajv.js +0 -34
  508. package/packages/config-eslint/node_modules/eslint/lib/shared/assert.js +0 -21
  509. package/packages/config-eslint/node_modules/eslint/lib/shared/ast-utils.js +0 -30
  510. package/packages/config-eslint/node_modules/eslint/lib/shared/deep-merge-arrays.js +0 -62
  511. package/packages/config-eslint/node_modules/eslint/lib/shared/directives.js +0 -16
  512. package/packages/config-eslint/node_modules/eslint/lib/shared/flags.js +0 -108
  513. package/packages/config-eslint/node_modules/eslint/lib/shared/logging.js +0 -38
  514. package/packages/config-eslint/node_modules/eslint/lib/shared/naming.js +0 -109
  515. package/packages/config-eslint/node_modules/eslint/lib/shared/option-utils.js +0 -63
  516. package/packages/config-eslint/node_modules/eslint/lib/shared/relative-module-resolver.js +0 -28
  517. package/packages/config-eslint/node_modules/eslint/lib/shared/runtime-info.js +0 -177
  518. package/packages/config-eslint/node_modules/eslint/lib/shared/serialization.js +0 -78
  519. package/packages/config-eslint/node_modules/eslint/lib/shared/severity.js +0 -49
  520. package/packages/config-eslint/node_modules/eslint/lib/shared/stats.js +0 -30
  521. package/packages/config-eslint/node_modules/eslint/lib/shared/string-utils.js +0 -58
  522. package/packages/config-eslint/node_modules/eslint/lib/shared/text-table.js +0 -68
  523. package/packages/config-eslint/node_modules/eslint/lib/shared/translate-cli-options.js +0 -281
  524. package/packages/config-eslint/node_modules/eslint/lib/shared/traverser.js +0 -202
  525. package/packages/config-eslint/node_modules/eslint/lib/types/config-api.d.ts +0 -12
  526. package/packages/config-eslint/node_modules/eslint/lib/types/index.d.ts +0 -1473
  527. package/packages/config-eslint/node_modules/eslint/lib/types/rules.d.ts +0 -5589
  528. package/packages/config-eslint/node_modules/eslint/lib/types/universal.d.ts +0 -6
  529. package/packages/config-eslint/node_modules/eslint/lib/types/use-at-your-own-risk.d.ts +0 -87
  530. package/packages/config-eslint/node_modules/eslint/lib/universal.js +0 -10
  531. package/packages/config-eslint/node_modules/eslint/lib/unsupported-api.js +0 -29
  532. package/packages/config-eslint/node_modules/eslint/messages/all-files-ignored.js +0 -16
  533. package/packages/config-eslint/node_modules/eslint/messages/all-matched-files-ignored.js +0 -21
  534. package/packages/config-eslint/node_modules/eslint/messages/config-file-missing.js +0 -16
  535. package/packages/config-eslint/node_modules/eslint/messages/config-plugin-missing.js +0 -14
  536. package/packages/config-eslint/node_modules/eslint/messages/config-serialize-function.js +0 -30
  537. package/packages/config-eslint/node_modules/eslint/messages/eslintrc-incompat.js +0 -117
  538. package/packages/config-eslint/node_modules/eslint/messages/eslintrc-plugins.js +0 -27
  539. package/packages/config-eslint/node_modules/eslint/messages/extend-config-missing.js +0 -13
  540. package/packages/config-eslint/node_modules/eslint/messages/failed-to-read-json.js +0 -11
  541. package/packages/config-eslint/node_modules/eslint/messages/file-not-found.js +0 -10
  542. package/packages/config-eslint/node_modules/eslint/messages/invalid-rule-options.js +0 -17
  543. package/packages/config-eslint/node_modules/eslint/messages/invalid-rule-severity.js +0 -13
  544. package/packages/config-eslint/node_modules/eslint/messages/no-config-found.js +0 -15
  545. package/packages/config-eslint/node_modules/eslint/messages/plugin-conflict.js +0 -22
  546. package/packages/config-eslint/node_modules/eslint/messages/plugin-invalid.js +0 -16
  547. package/packages/config-eslint/node_modules/eslint/messages/plugin-missing.js +0 -19
  548. package/packages/config-eslint/node_modules/eslint/messages/print-config-with-directory-path.js +0 -8
  549. package/packages/config-eslint/node_modules/eslint/messages/shared.js +0 -23
  550. package/packages/config-eslint/node_modules/eslint/messages/whitespace-found.js +0 -11
  551. package/packages/config-eslint/node_modules/eslint/package.json +0 -226
  552. package/packages/config-eslint/node_modules/find-up/index.d.ts +0 -138
  553. package/packages/config-eslint/node_modules/find-up/index.js +0 -89
  554. package/packages/config-eslint/node_modules/find-up/license +0 -9
  555. package/packages/config-eslint/node_modules/find-up/package.json +0 -54
  556. package/packages/config-eslint/node_modules/find-up/readme.md +0 -151
  557. package/packages/config-eslint/node_modules/globals/globals.json +0 -3970
  558. package/packages/config-eslint/node_modules/globals/index.d.ts +0 -4087
  559. package/packages/config-eslint/node_modules/globals/index.js +0 -2
  560. package/packages/config-eslint/node_modules/globals/license +0 -9
  561. package/packages/config-eslint/node_modules/globals/package.json +0 -122
  562. package/packages/config-eslint/node_modules/globals/readme.md +0 -42
  563. package/packages/config-eslint/node_modules/ignore/LICENSE-MIT +0 -21
  564. package/packages/config-eslint/node_modules/ignore/README.md +0 -412
  565. package/packages/config-eslint/node_modules/ignore/index.d.ts +0 -61
  566. package/packages/config-eslint/node_modules/ignore/index.js +0 -636
  567. package/packages/config-eslint/node_modules/ignore/legacy.js +0 -559
  568. package/packages/config-eslint/node_modules/ignore/package.json +0 -74
  569. package/packages/config-eslint/node_modules/json-schema-traverse/.eslintrc.yml +0 -27
  570. package/packages/config-eslint/node_modules/json-schema-traverse/.travis.yml +0 -8
  571. package/packages/config-eslint/node_modules/json-schema-traverse/LICENSE +0 -21
  572. package/packages/config-eslint/node_modules/json-schema-traverse/README.md +0 -83
  573. package/packages/config-eslint/node_modules/json-schema-traverse/index.js +0 -89
  574. package/packages/config-eslint/node_modules/json-schema-traverse/package.json +0 -43
  575. package/packages/config-eslint/node_modules/json-schema-traverse/spec/.eslintrc.yml +0 -6
  576. package/packages/config-eslint/node_modules/json-schema-traverse/spec/fixtures/schema.js +0 -125
  577. package/packages/config-eslint/node_modules/json-schema-traverse/spec/index.spec.js +0 -171
  578. package/packages/config-eslint/node_modules/locate-path/index.d.ts +0 -83
  579. package/packages/config-eslint/node_modules/locate-path/index.js +0 -68
  580. package/packages/config-eslint/node_modules/locate-path/license +0 -9
  581. package/packages/config-eslint/node_modules/locate-path/package.json +0 -46
  582. package/packages/config-eslint/node_modules/locate-path/readme.md +0 -125
  583. package/packages/config-eslint/node_modules/p-limit/index.d.ts +0 -42
  584. package/packages/config-eslint/node_modules/p-limit/index.js +0 -71
  585. package/packages/config-eslint/node_modules/p-limit/license +0 -9
  586. package/packages/config-eslint/node_modules/p-limit/package.json +0 -52
  587. package/packages/config-eslint/node_modules/p-limit/readme.md +0 -101
  588. package/packages/config-eslint/node_modules/p-locate/index.d.ts +0 -53
  589. package/packages/config-eslint/node_modules/p-locate/index.js +0 -50
  590. package/packages/config-eslint/node_modules/p-locate/license +0 -9
  591. package/packages/config-eslint/node_modules/p-locate/package.json +0 -54
  592. package/packages/config-eslint/node_modules/p-locate/readme.md +0 -93
  593. package/packages/config-eslint/node_modules/path-exists/index.d.ts +0 -28
  594. package/packages/config-eslint/node_modules/path-exists/index.js +0 -23
  595. package/packages/config-eslint/node_modules/path-exists/license +0 -9
  596. package/packages/config-eslint/node_modules/path-exists/package.json +0 -39
  597. package/packages/config-eslint/node_modules/path-exists/readme.md +0 -52
  598. package/packages/config-eslint/node_modules/yocto-queue/index.d.ts +0 -56
  599. package/packages/config-eslint/node_modules/yocto-queue/index.js +0 -68
  600. package/packages/config-eslint/node_modules/yocto-queue/license +0 -9
  601. package/packages/config-eslint/node_modules/yocto-queue/package.json +0 -43
  602. package/packages/config-eslint/node_modules/yocto-queue/readme.md +0 -64
@@ -1,1465 +0,0 @@
1
- /**
2
- * @fileoverview Helper functions for ESLint class
3
- * @author Nicholas C. Zakas
4
- */
5
-
6
- "use strict";
7
-
8
- //-----------------------------------------------------------------------------
9
- // Requirements
10
- //-----------------------------------------------------------------------------
11
-
12
- const path = require("node:path");
13
- const fs = require("node:fs");
14
- const { isMainThread, threadId } = require("node:worker_threads");
15
- const fsp = fs.promises;
16
- const isGlob = require("is-glob");
17
- const hash = require("../cli-engine/hash");
18
- const minimatch = require("minimatch");
19
- const globParent = require("glob-parent");
20
- const { Linter } = require("../linter");
21
- const { getShorthandName } = require("../shared/naming");
22
- const LintResultCache = require("../cli-engine/lint-result-cache");
23
- const { ConfigLoader, LegacyConfigLoader } = require("../config/config-loader");
24
- const createDebug = require("debug");
25
-
26
- //-----------------------------------------------------------------------------
27
- // Fixup references
28
- //-----------------------------------------------------------------------------
29
-
30
- const Minimatch = minimatch.Minimatch;
31
- const MINIMATCH_OPTIONS = { dot: true };
32
- const hrtimeBigint = process.hrtime.bigint;
33
-
34
- //-----------------------------------------------------------------------------
35
- // Types
36
- //-----------------------------------------------------------------------------
37
-
38
- /**
39
- * @import { ESLintOptions } from "./eslint.js";
40
- * @import { Config as CalculatedConfig } from "../config/config.js";
41
- * @import { FlatConfigArray } from "../config/flat-config-array.js";
42
- * @import { WarningService } from "../services/warning-service.js";
43
- * @import { Retrier } from "@humanwhocodes/retry";
44
- */
45
-
46
- /** @typedef {import("../types").Linter.Config} Config */
47
- /** @typedef {import("../types").Linter.LintMessage} LintMessage */
48
- /** @typedef {import("../types").ESLint.LintResult} LintResult */
49
- /** @typedef {import("../types").ESLint.Plugin} Plugin */
50
-
51
- /**
52
- * @typedef {Object} GlobSearch
53
- * @property {Array<string>} patterns The normalized patterns to use for a search.
54
- * @property {Array<string>} rawPatterns The patterns as entered by the user
55
- * before doing any normalization.
56
- */
57
-
58
- //------------------------------------------------------------------------------
59
- // Debug Helpers
60
- //------------------------------------------------------------------------------
61
-
62
- // Add %t formatter to print bigint nanosecond times in milliseconds.
63
- createDebug.formatters.t = timeDiff =>
64
- `${(timeDiff + 500_000n) / 1_000_000n} ms`;
65
-
66
- const debug = createDebug(
67
- `eslint:eslint-helpers${isMainThread ? "" : `:thread-${threadId}`}`,
68
- );
69
-
70
- //-----------------------------------------------------------------------------
71
- // Errors
72
- //-----------------------------------------------------------------------------
73
-
74
- /**
75
- * The error type when no files match a glob.
76
- */
77
- class NoFilesFoundError extends Error {
78
- /**
79
- * @param {string} pattern The glob pattern which was not found.
80
- * @param {boolean} globEnabled If `false` then the pattern was a glob pattern, but glob was disabled.
81
- */
82
- constructor(pattern, globEnabled) {
83
- super(
84
- `No files matching '${pattern}' were found${!globEnabled ? " (glob was disabled)" : ""}.`,
85
- );
86
- this.messageTemplate = "file-not-found";
87
- this.messageData = { pattern, globDisabled: !globEnabled };
88
- }
89
- }
90
-
91
- /**
92
- * The error type when a search fails to match multiple patterns.
93
- */
94
- class UnmatchedSearchPatternsError extends Error {
95
- /**
96
- * @param {Object} options The options for the error.
97
- * @param {string} options.basePath The directory that was searched.
98
- * @param {Array<string>} options.unmatchedPatterns The glob patterns
99
- * which were not found.
100
- * @param {Array<string>} options.patterns The glob patterns that were
101
- * searched.
102
- * @param {Array<string>} options.rawPatterns The raw glob patterns that
103
- * were searched.
104
- */
105
- constructor({ basePath, unmatchedPatterns, patterns, rawPatterns }) {
106
- super(
107
- `No files matching '${rawPatterns}' in '${basePath}' were found.`,
108
- );
109
- this.basePath = basePath;
110
- this.unmatchedPatterns = unmatchedPatterns;
111
- this.patterns = patterns;
112
- this.rawPatterns = rawPatterns;
113
- }
114
- }
115
-
116
- /**
117
- * The error type when there are files matched by a glob, but all of them have been ignored.
118
- */
119
- class AllFilesIgnoredError extends Error {
120
- /**
121
- * @param {string} pattern The glob pattern which was not found.
122
- */
123
- constructor(pattern) {
124
- super(`All files matched by '${pattern}' are ignored.`);
125
- this.messageTemplate = "all-matched-files-ignored";
126
- this.messageData = { pattern };
127
- }
128
- }
129
-
130
- //-----------------------------------------------------------------------------
131
- // General Helpers
132
- //-----------------------------------------------------------------------------
133
-
134
- /**
135
- * Check if a given value is a non-empty string or not.
136
- * @param {any} value The value to check.
137
- * @returns {boolean} `true` if `value` is a non-empty string.
138
- */
139
- function isNonEmptyString(value) {
140
- return typeof value === "string" && value.trim() !== "";
141
- }
142
-
143
- /**
144
- * Check if a given value is an array of non-empty strings or not.
145
- * @param {any} value The value to check.
146
- * @returns {boolean} `true` if `value` is an array of non-empty strings.
147
- */
148
- function isArrayOfNonEmptyString(value) {
149
- return (
150
- Array.isArray(value) && !!value.length && value.every(isNonEmptyString)
151
- );
152
- }
153
-
154
- /**
155
- * Check if a given value is an empty array or an array of non-empty strings.
156
- * @param {any} value The value to check.
157
- * @returns {boolean} `true` if `value` is an empty array or an array of non-empty
158
- * strings.
159
- */
160
- function isEmptyArrayOrArrayOfNonEmptyString(value) {
161
- return Array.isArray(value) && value.every(isNonEmptyString);
162
- }
163
-
164
- /**
165
- * Check if a given value is a positive integer.
166
- * @param {unknown} value The value to check.
167
- * @returns {boolean} `true` if `value` is a positive integer.
168
- */
169
- function isPositiveInteger(value) {
170
- return Number.isInteger(value) && value > 0;
171
- }
172
-
173
- //-----------------------------------------------------------------------------
174
- // File-related Helpers
175
- //-----------------------------------------------------------------------------
176
-
177
- /**
178
- * Normalizes slashes in a file pattern to posix-style.
179
- * @param {string} pattern The pattern to replace slashes in.
180
- * @returns {string} The pattern with slashes normalized.
181
- */
182
- function normalizeToPosix(pattern) {
183
- return pattern.replace(/\\/gu, "/");
184
- }
185
-
186
- /**
187
- * Check if a string is a glob pattern or not.
188
- * @param {string} pattern A glob pattern.
189
- * @returns {boolean} `true` if the string is a glob pattern.
190
- */
191
- function isGlobPattern(pattern) {
192
- return isGlob(path.sep === "\\" ? normalizeToPosix(pattern) : pattern);
193
- }
194
-
195
- /**
196
- * Determines if a given glob pattern will return any results.
197
- * Used primarily to help with useful error messages.
198
- * @param {Object} options The options for the function.
199
- * @param {string} options.basePath The directory to search.
200
- * @param {string} options.pattern An absolute path glob pattern to match.
201
- * @returns {Promise<boolean>} True if there is a glob match, false if not.
202
- */
203
- async function globMatch({ basePath, pattern }) {
204
- let found = false;
205
- const { hfs } = await import("@humanfs/node");
206
- const patternToUse = normalizeToPosix(path.relative(basePath, pattern));
207
-
208
- const matcher = new Minimatch(patternToUse, MINIMATCH_OPTIONS);
209
-
210
- const walkSettings = {
211
- directoryFilter(entry) {
212
- return !found && matcher.match(entry.path, true);
213
- },
214
-
215
- entryFilter(entry) {
216
- if (found || entry.isDirectory) {
217
- return false;
218
- }
219
-
220
- if (matcher.match(entry.path)) {
221
- found = true;
222
- return true;
223
- }
224
-
225
- return false;
226
- },
227
- };
228
-
229
- if (await hfs.isDirectory(basePath)) {
230
- return hfs
231
- .walk(basePath, walkSettings)
232
- .next()
233
- .then(() => found);
234
- }
235
-
236
- return found;
237
- }
238
-
239
- /**
240
- * Searches a directory looking for matching glob patterns. This uses
241
- * the config array's logic to determine if a directory or file should
242
- * be ignored, so it is consistent with how ignoring works throughout
243
- * ESLint.
244
- * @param {Object} options The options for this function.
245
- * @param {string} options.basePath The directory to search.
246
- * @param {Array<string>} options.patterns An array of absolute path glob patterns
247
- * to match.
248
- * @param {Array<string>} options.rawPatterns An array of glob patterns
249
- * as the user inputted them. Used for errors.
250
- * @param {ConfigLoader|LegacyConfigLoader} options.configLoader The config array to use for
251
- * determining what to ignore.
252
- * @param {boolean} options.errorOnUnmatchedPattern Determines if an error
253
- * should be thrown when a pattern is unmatched.
254
- * @returns {Promise<Array<string>>} An array of matching file paths
255
- * or an empty array if there are no matches.
256
- * @throws {UnmatchedSearchPatternsError} If there is a pattern that doesn't
257
- * match any files.
258
- */
259
- async function globSearch({
260
- basePath,
261
- patterns,
262
- rawPatterns,
263
- configLoader,
264
- errorOnUnmatchedPattern,
265
- }) {
266
- if (patterns.length === 0) {
267
- return [];
268
- }
269
-
270
- /*
271
- * In this section we are converting the patterns into Minimatch
272
- * instances for performance reasons. Because we are doing the same
273
- * matches repeatedly, it's best to compile those patterns once and
274
- * reuse them multiple times.
275
- *
276
- * To do that, we convert any patterns with an absolute path into a
277
- * relative path and normalize it to Posix-style slashes. We also keep
278
- * track of the relative patterns to map them back to the original
279
- * patterns, which we need in order to throw an error if there are any
280
- * unmatched patterns.
281
- */
282
- const relativeToPatterns = new Map();
283
- const matchers = patterns.map((pattern, i) => {
284
- const patternToUse = normalizeToPosix(path.relative(basePath, pattern));
285
-
286
- relativeToPatterns.set(patternToUse, patterns[i]);
287
-
288
- return new Minimatch(patternToUse, MINIMATCH_OPTIONS);
289
- });
290
-
291
- /*
292
- * We track unmatched patterns because we may want to throw an error when
293
- * they occur. To start, this set is initialized with all of the patterns.
294
- * Every time a match occurs, the pattern is removed from the set, making
295
- * it easy to tell if we have any unmatched patterns left at the end of
296
- * search.
297
- */
298
- const unmatchedPatterns = new Set([...relativeToPatterns.keys()]);
299
- const { hfs } = await import("@humanfs/node");
300
-
301
- const walk = hfs.walk(basePath, {
302
- async directoryFilter(entry) {
303
- if (!matchers.some(matcher => matcher.match(entry.path, true))) {
304
- return false;
305
- }
306
-
307
- const absolutePath = path.resolve(basePath, entry.path);
308
- const configs =
309
- await configLoader.loadConfigArrayForDirectory(absolutePath);
310
-
311
- return !configs.isDirectoryIgnored(absolutePath);
312
- },
313
- async entryFilter(entry) {
314
- const absolutePath = path.resolve(basePath, entry.path);
315
-
316
- // entries may be directories or files so filter out directories
317
- if (entry.isDirectory) {
318
- return false;
319
- }
320
-
321
- const configs =
322
- await configLoader.loadConfigArrayForFile(absolutePath);
323
- const config = configs.getConfig(absolutePath);
324
-
325
- /*
326
- * Optimization: We need to track when patterns are left unmatched
327
- * and so we use `unmatchedPatterns` to do that. There is a bit of
328
- * complexity here because the same file can be matched by more than
329
- * one pattern. So, when we start, we actually need to test every
330
- * pattern against every file. Once we know there are no remaining
331
- * unmatched patterns, then we can switch to just looking for the
332
- * first matching pattern for improved speed.
333
- */
334
- const matchesPattern =
335
- unmatchedPatterns.size > 0
336
- ? matchers.reduce((previousValue, matcher) => {
337
- const pathMatches = matcher.match(entry.path);
338
-
339
- /*
340
- * We updated the unmatched patterns set only if the path
341
- * matches and the file has a config. If the file has no
342
- * config, that means there wasn't a match for the
343
- * pattern so it should not be removed.
344
- *
345
- * Performance note: `getConfig()` aggressively caches
346
- * results so there is no performance penalty for calling
347
- * it multiple times with the same argument.
348
- */
349
- if (pathMatches && config) {
350
- unmatchedPatterns.delete(matcher.pattern);
351
- }
352
-
353
- return pathMatches || previousValue;
354
- }, false)
355
- : matchers.some(matcher => matcher.match(entry.path));
356
-
357
- return matchesPattern && config !== void 0;
358
- },
359
- });
360
-
361
- const filePaths = [];
362
-
363
- if (await hfs.isDirectory(basePath)) {
364
- for await (const entry of walk) {
365
- filePaths.push(path.resolve(basePath, entry.path));
366
- }
367
- }
368
-
369
- // now check to see if we have any unmatched patterns
370
- if (errorOnUnmatchedPattern && unmatchedPatterns.size > 0) {
371
- throw new UnmatchedSearchPatternsError({
372
- basePath,
373
- unmatchedPatterns: [...unmatchedPatterns].map(pattern =>
374
- relativeToPatterns.get(pattern),
375
- ),
376
- patterns,
377
- rawPatterns,
378
- });
379
- }
380
-
381
- return filePaths;
382
- }
383
-
384
- /**
385
- * Throws an error for unmatched patterns. The error will only contain information about the first one.
386
- * Checks to see if there are any ignored results for a given search.
387
- * @param {Object} options The options for this function.
388
- * @param {string} options.basePath The directory to search.
389
- * @param {Array<string>} options.patterns An array of glob patterns
390
- * that were used in the original search.
391
- * @param {Array<string>} options.rawPatterns An array of glob patterns
392
- * as the user inputted them. Used for errors.
393
- * @param {Array<string>} options.unmatchedPatterns A non-empty array of absolute path glob patterns
394
- * that were unmatched in the original search.
395
- * @returns {Promise<never>} Always throws an error.
396
- * @throws {NoFilesFoundError} If the first unmatched pattern
397
- * doesn't match any files even when there are no ignores.
398
- * @throws {AllFilesIgnoredError} If the first unmatched pattern
399
- * matches some files when there are no ignores.
400
- */
401
- async function throwErrorForUnmatchedPatterns({
402
- basePath,
403
- patterns,
404
- rawPatterns,
405
- unmatchedPatterns,
406
- }) {
407
- const pattern = unmatchedPatterns[0];
408
- const rawPattern = rawPatterns[patterns.indexOf(pattern)];
409
-
410
- const patternHasMatch = await globMatch({
411
- basePath,
412
- pattern,
413
- });
414
-
415
- if (patternHasMatch) {
416
- throw new AllFilesIgnoredError(rawPattern);
417
- }
418
-
419
- // if we get here there are truly no matches
420
- throw new NoFilesFoundError(rawPattern, true);
421
- }
422
-
423
- /**
424
- * Performs multiple glob searches in parallel.
425
- * @param {Object} options The options for this function.
426
- * @param {Map<string,GlobSearch>} options.searches
427
- * A map of absolute path glob patterns to match.
428
- * @param {ConfigLoader|LegacyConfigLoader} options.configLoader The config loader to use for
429
- * determining what to ignore.
430
- * @param {boolean} options.errorOnUnmatchedPattern Determines if an
431
- * unmatched glob pattern should throw an error.
432
- * @returns {Promise<Array<string>>} An array of matching file paths
433
- * or an empty array if there are no matches.
434
- */
435
- async function globMultiSearch({
436
- searches,
437
- configLoader,
438
- errorOnUnmatchedPattern,
439
- }) {
440
- /*
441
- * For convenience, we normalized the search map into an array of objects.
442
- * Next, we filter out all searches that have no patterns. This happens
443
- * primarily for the cwd, which is prepopulated in the searches map as an
444
- * optimization. However, if it has no patterns, it means all patterns
445
- * occur outside of the cwd and we can safely filter out that search.
446
- */
447
- const normalizedSearches = [...searches]
448
- .map(([basePath, { patterns, rawPatterns }]) => ({
449
- basePath,
450
- patterns,
451
- rawPatterns,
452
- }))
453
- .filter(({ patterns }) => patterns.length > 0);
454
-
455
- const results = await Promise.allSettled(
456
- normalizedSearches.map(({ basePath, patterns, rawPatterns }) =>
457
- globSearch({
458
- basePath,
459
- patterns,
460
- rawPatterns,
461
- configLoader,
462
- errorOnUnmatchedPattern,
463
- }),
464
- ),
465
- );
466
-
467
- /*
468
- * The first loop handles errors from the glob searches. Since we can't
469
- * use `await` inside `flatMap`, we process errors separately in this loop.
470
- * This results in two iterations over `results`, but since the length is
471
- * less than or equal to the number of globs and directories passed on the
472
- * command line, the performance impact should be minimal.
473
- */
474
- for (let i = 0; i < results.length; i++) {
475
- const result = results[i];
476
- const currentSearch = normalizedSearches[i];
477
-
478
- if (result.status === "fulfilled") {
479
- continue;
480
- }
481
-
482
- // if we make it here then there was an error
483
- const error = result.reason;
484
-
485
- // unexpected errors should be re-thrown
486
- if (!error.basePath) {
487
- throw error;
488
- }
489
-
490
- if (errorOnUnmatchedPattern) {
491
- await throwErrorForUnmatchedPatterns({
492
- ...currentSearch,
493
- unmatchedPatterns: error.unmatchedPatterns,
494
- });
495
- }
496
- }
497
-
498
- // second loop for `fulfilled` results
499
- return results.flatMap(result => result.value);
500
- }
501
-
502
- /**
503
- * Finds all files matching the options specified.
504
- * @param {Object} args The arguments objects.
505
- * @param {Array<string>} args.patterns An array of glob patterns.
506
- * @param {boolean} args.globInputPaths true to interpret glob patterns,
507
- * false to not interpret glob patterns.
508
- * @param {string} args.cwd The current working directory to find from.
509
- * @param {ConfigLoader|LegacyConfigLoader} args.configLoader The config loader for the current run.
510
- * @param {boolean} args.errorOnUnmatchedPattern Determines if an unmatched pattern
511
- * should throw an error.
512
- * @returns {Promise<Array<string>>} The fully resolved file paths.
513
- * @throws {AllFilesIgnoredError} If there are no results due to an ignore pattern.
514
- * @throws {NoFilesFoundError} If no files matched the given patterns.
515
- */
516
- async function findFiles({
517
- patterns,
518
- globInputPaths,
519
- cwd,
520
- configLoader,
521
- errorOnUnmatchedPattern,
522
- }) {
523
- const results = [];
524
- const missingPatterns = [];
525
- let globbyPatterns = [];
526
- let rawPatterns = [];
527
- const searches = new Map([
528
- [cwd, { patterns: globbyPatterns, rawPatterns: [] }],
529
- ]);
530
-
531
- /*
532
- * This part is a bit involved because we need to account for
533
- * the different ways that the patterns can match directories.
534
- * For each different way, we need to decide if we should look
535
- * for a config file or just use the default config. (Directories
536
- * without a config file always use the default config.)
537
- *
538
- * Here are the cases:
539
- *
540
- * 1. A directory is passed directly (e.g., "subdir"). In this case, we
541
- * can assume that the user intends to lint this directory and we should
542
- * not look for a config file in the parent directory, because the only
543
- * reason to do that would be to ignore this directory (which we already
544
- * know we don't want to do). Instead, we use the default config until we
545
- * get to the directory that was passed, at which point we start looking
546
- * for config files again.
547
- *
548
- * 2. A dot (".") or star ("*"). In this case, we want to read
549
- * the config file in the current directory because the user is
550
- * explicitly asking to lint the current directory. Note that "."
551
- * will traverse into subdirectories while "*" will not.
552
- *
553
- * 3. A directory is passed in the form of "subdir/subsubdir".
554
- * In this case, we don't want to look for a config file in the
555
- * parent directory ("subdir"). We can skip looking for a config
556
- * file until `entry.depth` is greater than 1 because there's no
557
- * way that the pattern can match `entry.path` yet.
558
- *
559
- * 4. A directory glob pattern is passed (e.g., "subd*"). We want
560
- * this case to act like case 2 because it's unclear whether or not
561
- * any particular directory is meant to be traversed.
562
- *
563
- * 5. A recursive glob pattern is passed (e.g., "**"). We want this
564
- * case to act like case 2.
565
- */
566
-
567
- // check to see if we have explicit files and directories
568
- const filePaths = patterns.map(filePath => path.resolve(cwd, filePath));
569
- const stats = await Promise.all(
570
- filePaths.map(filePath => fsp.stat(filePath).catch(() => {})),
571
- );
572
-
573
- const promises = [];
574
- stats.forEach((stat, index) => {
575
- const filePath = filePaths[index];
576
- const pattern = normalizeToPosix(patterns[index]);
577
-
578
- if (stat) {
579
- // files are added directly to the list
580
- if (stat.isFile()) {
581
- results.push(filePath);
582
- promises.push(configLoader.loadConfigArrayForFile(filePath));
583
- }
584
-
585
- // directories need extensions attached
586
- if (stat.isDirectory()) {
587
- if (!searches.has(filePath)) {
588
- searches.set(filePath, { patterns: [], rawPatterns: [] });
589
- }
590
- ({ patterns: globbyPatterns, rawPatterns } =
591
- searches.get(filePath));
592
-
593
- globbyPatterns.push(`${normalizeToPosix(filePath)}/**`);
594
- rawPatterns.push(pattern);
595
- }
596
-
597
- return;
598
- }
599
-
600
- // save patterns for later use based on whether globs are enabled
601
- if (globInputPaths && isGlobPattern(pattern)) {
602
- /*
603
- * We are grouping patterns by their glob parent. This is done to
604
- * make it easier to determine when a config file should be loaded.
605
- */
606
-
607
- const basePath = path.resolve(cwd, globParent(pattern));
608
-
609
- if (!searches.has(basePath)) {
610
- searches.set(basePath, { patterns: [], rawPatterns: [] });
611
- }
612
- ({ patterns: globbyPatterns, rawPatterns } =
613
- searches.get(basePath));
614
-
615
- globbyPatterns.push(filePath);
616
- rawPatterns.push(pattern);
617
- } else {
618
- missingPatterns.push(pattern);
619
- }
620
- });
621
-
622
- // there were patterns that didn't match anything, tell the user
623
- if (errorOnUnmatchedPattern && missingPatterns.length) {
624
- throw new NoFilesFoundError(missingPatterns[0], globInputPaths);
625
- }
626
-
627
- // now we are safe to do the search
628
- promises.push(
629
- globMultiSearch({
630
- searches,
631
- configLoader,
632
- errorOnUnmatchedPattern,
633
- }),
634
- );
635
- const globbyResults = (await Promise.all(promises)).at(-1);
636
-
637
- return [...new Set([...results, ...globbyResults])];
638
- }
639
-
640
- /**
641
- * Return the absolute path of a file named `"__placeholder__.js"` in a given directory.
642
- * This is used as a replacement for a missing file path.
643
- * @param {string} cwd An absolute directory path.
644
- * @returns {string} The absolute path of a file named `"__placeholder__.js"` in the given directory.
645
- */
646
- function getPlaceholderPath(cwd) {
647
- return path.join(cwd, "__placeholder__.js");
648
- }
649
-
650
- //-----------------------------------------------------------------------------
651
- // Results-related Helpers
652
- //-----------------------------------------------------------------------------
653
-
654
- /**
655
- * Checks if the given message is an error message.
656
- * @param {LintMessage} message The message to check.
657
- * @returns {boolean} Whether or not the message is an error message.
658
- * @private
659
- */
660
- function isErrorMessage(message) {
661
- return message.severity === 2;
662
- }
663
-
664
- /**
665
- * Returns result with warning by ignore settings
666
- * @param {string} filePath Absolute file path of checked code
667
- * @param {string} baseDir Absolute path of base directory
668
- * @param {"ignored"|"external"|"unconfigured"} configStatus A status that determines why the file is ignored
669
- * @returns {LintResult} Result with single warning
670
- * @private
671
- */
672
- function createIgnoreResult(filePath, baseDir, configStatus) {
673
- let message;
674
-
675
- switch (configStatus) {
676
- case "external":
677
- message = "File ignored because outside of base path.";
678
- break;
679
- case "unconfigured":
680
- message =
681
- "File ignored because no matching configuration was supplied.";
682
- break;
683
- default:
684
- {
685
- const isInNodeModules =
686
- baseDir &&
687
- path
688
- .dirname(path.relative(baseDir, filePath))
689
- .split(path.sep)
690
- .includes("node_modules");
691
-
692
- if (isInNodeModules) {
693
- message =
694
- 'File ignored by default because it is located under the node_modules directory. Use ignore pattern "!**/node_modules/" to disable file ignore settings or use "--no-warn-ignored" to suppress this warning.';
695
- } else {
696
- message =
697
- 'File ignored because of a matching ignore pattern. Use "--no-ignore" to disable file ignore settings or use "--no-warn-ignored" to suppress this warning.';
698
- }
699
- }
700
- break;
701
- }
702
-
703
- return {
704
- filePath,
705
- messages: [
706
- {
707
- ruleId: null,
708
- fatal: false,
709
- severity: 1,
710
- message,
711
- nodeType: null,
712
- },
713
- ],
714
- suppressedMessages: [],
715
- errorCount: 0,
716
- warningCount: 1,
717
- fatalErrorCount: 0,
718
- fixableErrorCount: 0,
719
- fixableWarningCount: 0,
720
- };
721
- }
722
-
723
- /**
724
- * It will calculate the error and warning count for collection of messages per file
725
- * @param {LintMessage[]} messages Collection of messages
726
- * @returns {Object} Contains the stats
727
- * @private
728
- */
729
- function calculateStatsPerFile(messages) {
730
- const stat = {
731
- errorCount: 0,
732
- fatalErrorCount: 0,
733
- warningCount: 0,
734
- fixableErrorCount: 0,
735
- fixableWarningCount: 0,
736
- };
737
-
738
- for (let i = 0; i < messages.length; i++) {
739
- const message = messages[i];
740
-
741
- if (message.fatal || message.severity === 2) {
742
- stat.errorCount++;
743
- if (message.fatal) {
744
- stat.fatalErrorCount++;
745
- }
746
- if (message.fix) {
747
- stat.fixableErrorCount++;
748
- }
749
- } else {
750
- stat.warningCount++;
751
- if (message.fix) {
752
- stat.fixableWarningCount++;
753
- }
754
- }
755
- }
756
- return stat;
757
- }
758
-
759
- //-----------------------------------------------------------------------------
760
- // Options-related Helpers
761
- //-----------------------------------------------------------------------------
762
-
763
- /**
764
- * Check if a given value is a valid fix type or not.
765
- * @param {any} x The value to check.
766
- * @returns {boolean} `true` if `x` is valid fix type.
767
- */
768
- function isFixType(x) {
769
- return (
770
- x === "directive" ||
771
- x === "problem" ||
772
- x === "suggestion" ||
773
- x === "layout"
774
- );
775
- }
776
-
777
- /**
778
- * Check if a given value is an array of fix types or not.
779
- * @param {any} x The value to check.
780
- * @returns {boolean} `true` if `x` is an array of fix types.
781
- */
782
- function isFixTypeArray(x) {
783
- return Array.isArray(x) && x.every(isFixType);
784
- }
785
-
786
- /**
787
- * The error for invalid options.
788
- */
789
- class ESLintInvalidOptionsError extends Error {
790
- constructor(messages) {
791
- super(`Invalid Options:\n- ${messages.join("\n- ")}`);
792
- this.code = "ESLINT_INVALID_OPTIONS";
793
- Error.captureStackTrace(this, ESLintInvalidOptionsError);
794
- }
795
- }
796
-
797
- /**
798
- * Validates and normalizes options for the wrapped CLIEngine instance.
799
- * @param {ESLintOptions} options The options to process.
800
- * @throws {ESLintInvalidOptionsError} If of any of a variety of type errors.
801
- * @returns {ESLintOptions} The normalized options.
802
- */
803
- function processOptions({
804
- allowInlineConfig = true, // ← we cannot use `overrideConfig.noInlineConfig` instead because `allowInlineConfig` has side-effect that suppress warnings that show inline configs are ignored.
805
- baseConfig = null,
806
- cache = false,
807
- cacheLocation = ".eslintcache",
808
- cacheStrategy = "metadata",
809
- concurrency = "off",
810
- cwd = process.cwd(),
811
- errorOnUnmatchedPattern = true,
812
- fix = false,
813
- fixTypes = null, // ← should be null by default because if it's an array then it suppresses rules that don't have the `meta.type` property.
814
- flags = [],
815
- globInputPaths = true,
816
- ignore = true,
817
- ignorePatterns = null,
818
- overrideConfig = null,
819
- overrideConfigFile = null,
820
- plugins = {},
821
- stats = false,
822
- warnIgnored = true,
823
- passOnNoPatterns = false,
824
- ruleFilter = () => true,
825
- ...unknownOptions
826
- }) {
827
- const errors = [];
828
- const unknownOptionKeys = Object.keys(unknownOptions);
829
-
830
- if (unknownOptionKeys.length >= 1) {
831
- errors.push(`Unknown options: ${unknownOptionKeys.join(", ")}`);
832
- if (unknownOptionKeys.includes("cacheFile")) {
833
- errors.push(
834
- "'cacheFile' has been removed. Please use the 'cacheLocation' option instead.",
835
- );
836
- }
837
- if (unknownOptionKeys.includes("configFile")) {
838
- errors.push(
839
- "'configFile' has been removed. Please use the 'overrideConfigFile' option instead.",
840
- );
841
- }
842
- if (unknownOptionKeys.includes("envs")) {
843
- errors.push("'envs' has been removed.");
844
- }
845
- if (unknownOptionKeys.includes("extensions")) {
846
- errors.push("'extensions' has been removed.");
847
- }
848
- if (unknownOptionKeys.includes("resolvePluginsRelativeTo")) {
849
- errors.push("'resolvePluginsRelativeTo' has been removed.");
850
- }
851
- if (unknownOptionKeys.includes("globals")) {
852
- errors.push(
853
- "'globals' has been removed. Please use the 'overrideConfig.languageOptions.globals' option instead.",
854
- );
855
- }
856
- if (unknownOptionKeys.includes("ignorePath")) {
857
- errors.push("'ignorePath' has been removed.");
858
- }
859
- if (unknownOptionKeys.includes("ignorePattern")) {
860
- errors.push(
861
- "'ignorePattern' has been removed. Please use the 'overrideConfig.ignorePatterns' option instead.",
862
- );
863
- }
864
- if (unknownOptionKeys.includes("parser")) {
865
- errors.push(
866
- "'parser' has been removed. Please use the 'overrideConfig.languageOptions.parser' option instead.",
867
- );
868
- }
869
- if (unknownOptionKeys.includes("parserOptions")) {
870
- errors.push(
871
- "'parserOptions' has been removed. Please use the 'overrideConfig.languageOptions.parserOptions' option instead.",
872
- );
873
- }
874
- if (unknownOptionKeys.includes("rules")) {
875
- errors.push(
876
- "'rules' has been removed. Please use the 'overrideConfig.rules' option instead.",
877
- );
878
- }
879
- if (unknownOptionKeys.includes("rulePaths")) {
880
- errors.push(
881
- "'rulePaths' has been removed. Please define your rules using plugins.",
882
- );
883
- }
884
- if (unknownOptionKeys.includes("reportUnusedDisableDirectives")) {
885
- errors.push(
886
- "'reportUnusedDisableDirectives' has been removed. Please use the 'overrideConfig.linterOptions.reportUnusedDisableDirectives' option instead.",
887
- );
888
- }
889
- }
890
- if (typeof allowInlineConfig !== "boolean") {
891
- errors.push("'allowInlineConfig' must be a boolean.");
892
- }
893
- if (typeof baseConfig !== "object") {
894
- errors.push("'baseConfig' must be an object or null.");
895
- }
896
- if (typeof cache !== "boolean") {
897
- errors.push("'cache' must be a boolean.");
898
- }
899
- if (!isNonEmptyString(cacheLocation)) {
900
- errors.push("'cacheLocation' must be a non-empty string.");
901
- }
902
- if (cacheStrategy !== "metadata" && cacheStrategy !== "content") {
903
- errors.push('\'cacheStrategy\' must be any of "metadata", "content".');
904
- }
905
- if (
906
- concurrency !== "off" &&
907
- concurrency !== "auto" &&
908
- !isPositiveInteger(concurrency)
909
- ) {
910
- errors.push(
911
- '\'concurrency\' must be a positive integer, "auto", or "off".',
912
- );
913
- }
914
- if (!isNonEmptyString(cwd) || !path.isAbsolute(cwd)) {
915
- errors.push("'cwd' must be an absolute path.");
916
- }
917
- if (typeof errorOnUnmatchedPattern !== "boolean") {
918
- errors.push("'errorOnUnmatchedPattern' must be a boolean.");
919
- }
920
- if (typeof fix !== "boolean" && typeof fix !== "function") {
921
- errors.push("'fix' must be a boolean or a function.");
922
- }
923
- if (fixTypes !== null && !isFixTypeArray(fixTypes)) {
924
- errors.push(
925
- '\'fixTypes\' must be an array of any of "directive", "problem", "suggestion", and "layout".',
926
- );
927
- }
928
- if (!isEmptyArrayOrArrayOfNonEmptyString(flags)) {
929
- errors.push("'flags' must be an array of non-empty strings.");
930
- }
931
- if (typeof globInputPaths !== "boolean") {
932
- errors.push("'globInputPaths' must be a boolean.");
933
- }
934
- if (typeof ignore !== "boolean") {
935
- errors.push("'ignore' must be a boolean.");
936
- }
937
- if (
938
- !isEmptyArrayOrArrayOfNonEmptyString(ignorePatterns) &&
939
- ignorePatterns !== null
940
- ) {
941
- errors.push(
942
- "'ignorePatterns' must be an array of non-empty strings or null.",
943
- );
944
- }
945
- if (typeof overrideConfig !== "object") {
946
- errors.push("'overrideConfig' must be an object or null.");
947
- }
948
- if (
949
- !isNonEmptyString(overrideConfigFile) &&
950
- overrideConfigFile !== null &&
951
- overrideConfigFile !== true
952
- ) {
953
- errors.push(
954
- "'overrideConfigFile' must be a non-empty string, null, or true.",
955
- );
956
- }
957
- if (typeof passOnNoPatterns !== "boolean") {
958
- errors.push("'passOnNoPatterns' must be a boolean.");
959
- }
960
- if (typeof plugins !== "object") {
961
- errors.push("'plugins' must be an object or null.");
962
- } else if (plugins !== null && Object.keys(plugins).includes("")) {
963
- errors.push("'plugins' must not include an empty string.");
964
- }
965
- if (Array.isArray(plugins)) {
966
- errors.push(
967
- "'plugins' doesn't add plugins to configuration to load. Please use the 'overrideConfig.plugins' option instead.",
968
- );
969
- }
970
- if (typeof stats !== "boolean") {
971
- errors.push("'stats' must be a boolean.");
972
- }
973
- if (typeof warnIgnored !== "boolean") {
974
- errors.push("'warnIgnored' must be a boolean.");
975
- }
976
- if (typeof ruleFilter !== "function") {
977
- errors.push("'ruleFilter' must be a function.");
978
- }
979
- if (errors.length > 0) {
980
- throw new ESLintInvalidOptionsError(errors);
981
- }
982
-
983
- return {
984
- allowInlineConfig,
985
- baseConfig,
986
- cache,
987
- cacheLocation,
988
- cacheStrategy,
989
- concurrency,
990
-
991
- // when overrideConfigFile is true that means don't do config file lookup
992
- configFile: overrideConfigFile === true ? false : overrideConfigFile,
993
- overrideConfig,
994
- cwd: path.normalize(cwd),
995
- errorOnUnmatchedPattern,
996
- fix,
997
- fixTypes,
998
- flags: [...flags],
999
- globInputPaths,
1000
- ignore,
1001
- ignorePatterns,
1002
- stats,
1003
- passOnNoPatterns,
1004
- warnIgnored,
1005
- ruleFilter,
1006
- };
1007
- }
1008
-
1009
- /**
1010
- * Loads ESLint constructor options from an options module.
1011
- * @param {string} optionsURL The URL string of the options module to load.
1012
- * @returns {Promise<ESLintOptions>} ESLint constructor options.
1013
- */
1014
- async function loadOptionsFromModule(optionsURL) {
1015
- return (await import(optionsURL)).default;
1016
- }
1017
-
1018
- //-----------------------------------------------------------------------------
1019
- // Cache-related helpers
1020
- //-----------------------------------------------------------------------------
1021
-
1022
- /**
1023
- * return the cacheFile to be used by eslint, based on whether the provided parameter is
1024
- * a directory or looks like a directory (ends in `path.sep`), in which case the file
1025
- * name will be the `cacheFile/.cache_hashOfCWD`
1026
- *
1027
- * if cacheFile points to a file or looks like a file then in will just use that file
1028
- * @param {string} cacheFile The name of file to be used to store the cache
1029
- * @param {string} cwd Current working directory
1030
- * @param {Object} options The options
1031
- * @param {string} [options.prefix] The prefix to use for the cache file
1032
- * @returns {string} the resolved path to the cache file
1033
- */
1034
- function getCacheFile(cacheFile, cwd, { prefix = ".cache_" } = {}) {
1035
- /*
1036
- * make sure the path separators are normalized for the environment/os
1037
- * keeping the trailing path separator if present
1038
- */
1039
- const normalizedCacheFile = path.normalize(cacheFile);
1040
-
1041
- const resolvedCacheFile = path.resolve(cwd, normalizedCacheFile);
1042
- const looksLikeADirectory = normalizedCacheFile.slice(-1) === path.sep;
1043
-
1044
- /**
1045
- * return the name for the cache file in case the provided parameter is a directory
1046
- * @returns {string} the resolved path to the cacheFile
1047
- */
1048
- function getCacheFileForDirectory() {
1049
- return path.join(resolvedCacheFile, `${prefix}${hash(cwd)}`);
1050
- }
1051
-
1052
- let fileStats;
1053
-
1054
- try {
1055
- fileStats = fs.lstatSync(resolvedCacheFile);
1056
- } catch {
1057
- fileStats = null;
1058
- }
1059
-
1060
- /*
1061
- * in case the file exists we need to verify if the provided path
1062
- * is a directory or a file. If it is a directory we want to create a file
1063
- * inside that directory
1064
- */
1065
- if (fileStats) {
1066
- /*
1067
- * is a directory or is a file, but the original file the user provided
1068
- * looks like a directory but `path.resolve` removed the `last path.sep`
1069
- * so we need to still treat this like a directory
1070
- */
1071
- if (fileStats.isDirectory() || looksLikeADirectory) {
1072
- return getCacheFileForDirectory();
1073
- }
1074
-
1075
- // is file so just use that file
1076
- return resolvedCacheFile;
1077
- }
1078
-
1079
- /*
1080
- * here we known the file or directory doesn't exist,
1081
- * so we will try to infer if its a directory if it looks like a directory
1082
- * for the current operating system.
1083
- */
1084
-
1085
- // if the last character passed is a path separator we assume is a directory
1086
- if (looksLikeADirectory) {
1087
- return getCacheFileForDirectory();
1088
- }
1089
-
1090
- return resolvedCacheFile;
1091
- }
1092
-
1093
- /**
1094
- * Creates a new lint result cache.
1095
- * @param {ESLintOptions} eslintOptions The processed ESLint options.
1096
- * @param {string} cacheFilePath The path to the cache file.
1097
- * @returns {?LintResultCache} A new lint result cache or `null`.
1098
- */
1099
- function createLintResultCache({ cache, cacheStrategy }, cacheFilePath) {
1100
- return cache ? new LintResultCache(cacheFilePath, cacheStrategy) : null;
1101
- }
1102
-
1103
- //-----------------------------------------------------------------------------
1104
- // Lint helpers
1105
- //-----------------------------------------------------------------------------
1106
-
1107
- /**
1108
- * Checks whether a message's rule type should be fixed.
1109
- * @param {LintMessage} message The message to check.
1110
- * @param {CalculatedConfig} config The config for the file that generated the message.
1111
- * @param {string[]} fixTypes An array of fix types to check.
1112
- * @returns {boolean} Whether the message should be fixed.
1113
- */
1114
- function shouldMessageBeFixed(message, config, fixTypes) {
1115
- if (!message.ruleId) {
1116
- return fixTypes.has("directive");
1117
- }
1118
-
1119
- const rule = message.ruleId && config.getRuleDefinition(message.ruleId);
1120
-
1121
- return Boolean(rule && rule.meta && fixTypes.has(rule.meta.type));
1122
- }
1123
-
1124
- /**
1125
- * Creates a fixer function based on the provided fix, fixTypesSet, and config.
1126
- * @param {Function|boolean} fix The original fix option.
1127
- * @param {Set<string>} fixTypesSet A set of fix types to filter messages for fixing.
1128
- * @param {CalculatedConfig} config The config for the file that generated the message.
1129
- * @returns {Function|boolean} The fixer function or the original fix value.
1130
- */
1131
- function getFixerForFixTypes(fix, fixTypesSet, config) {
1132
- if (!fix || !fixTypesSet) {
1133
- return fix;
1134
- }
1135
-
1136
- const originalFix = typeof fix === "function" ? fix : () => true;
1137
-
1138
- return message =>
1139
- shouldMessageBeFixed(message, config, fixTypesSet) &&
1140
- originalFix(message);
1141
- }
1142
-
1143
- /**
1144
- * Processes a source code using ESLint.
1145
- * @param {Object} config The config object.
1146
- * @param {string} config.text The source code to verify.
1147
- * @param {string} config.cwd The path to the current working directory.
1148
- * @param {string|undefined} config.filePath The path to the file of `text`. If this is undefined, it uses `<text>`.
1149
- * @param {FlatConfigArray} config.configs The config.
1150
- * @param {boolean} config.fix If `true` then it does fix.
1151
- * @param {boolean} config.allowInlineConfig If `true` then it uses directive comments.
1152
- * @param {Function} config.ruleFilter A predicate function to filter which rules should be run.
1153
- * @param {boolean} config.stats If `true`, then if reports extra statistics with the lint results.
1154
- * @param {Linter} config.linter The linter instance to verify.
1155
- * @returns {LintResult} The result of linting.
1156
- * @private
1157
- */
1158
- function verifyText({
1159
- text,
1160
- cwd,
1161
- filePath: providedFilePath,
1162
- configs,
1163
- fix,
1164
- allowInlineConfig,
1165
- ruleFilter,
1166
- stats,
1167
- linter,
1168
- }) {
1169
- const startTime = hrtimeBigint();
1170
-
1171
- const filePath = providedFilePath || "<text>";
1172
-
1173
- /*
1174
- * Verify.
1175
- * `config.extractConfig(filePath)` requires an absolute path, but `linter`
1176
- * doesn't know CWD, so it gives `linter` an absolute path always.
1177
- */
1178
- const filePathToVerify =
1179
- filePath === "<text>" ? getPlaceholderPath(cwd) : filePath;
1180
- const { fixed, messages, output } = linter.verifyAndFix(text, configs, {
1181
- allowInlineConfig,
1182
- filename: filePathToVerify,
1183
- fix,
1184
- ruleFilter,
1185
- stats,
1186
-
1187
- /**
1188
- * Check if the linter should adopt a given code block or not.
1189
- * @param {string} blockFilename The virtual filename of a code block.
1190
- * @returns {boolean} `true` if the linter should adopt the code block.
1191
- */
1192
- filterCodeBlock(blockFilename) {
1193
- return configs.getConfig(blockFilename) !== void 0;
1194
- },
1195
- });
1196
-
1197
- // Tweak and return.
1198
- const result = {
1199
- filePath: filePath === "<text>" ? filePath : path.resolve(filePath),
1200
- messages,
1201
- suppressedMessages: linter.getSuppressedMessages(),
1202
- ...calculateStatsPerFile(messages),
1203
- };
1204
-
1205
- if (fixed) {
1206
- result.output = output;
1207
- }
1208
-
1209
- if (
1210
- result.errorCount + result.warningCount > 0 &&
1211
- typeof result.output === "undefined"
1212
- ) {
1213
- result.source = text;
1214
- }
1215
-
1216
- if (stats) {
1217
- result.stats = {
1218
- times: linter.getTimes(),
1219
- fixPasses: linter.getFixPassCount(),
1220
- };
1221
- }
1222
-
1223
- const endTime = hrtimeBigint();
1224
- debug('File "%s" linted in %t', filePath, endTime - startTime);
1225
-
1226
- return result;
1227
- }
1228
-
1229
- /**
1230
- * Lints a single file.
1231
- * @param {string} filePath File path to lint.
1232
- * @param {FlatConfigArray} configs The config array for the file.
1233
- * @param {ESLintOptions} eslintOptions The processed ESLint options.
1234
- * @param {Linter} linter The linter instance to use.
1235
- * @param {?LintResultCache} lintResultCache The result cache or `null`.
1236
- * @param {?{ duration: bigint; }} readFileCounter Used to keep track of the time spent reading files.
1237
- * @param {Retrier} [retrier] Used to retry linting on certain errors.
1238
- * @param {AbortController} [controller] Used to stop linting when an error occurs.
1239
- * @returns {Promise<LintResult>} The lint result.
1240
- */
1241
- async function lintFile(
1242
- filePath,
1243
- configs,
1244
- eslintOptions,
1245
- linter,
1246
- lintResultCache,
1247
- readFileCounter,
1248
- retrier,
1249
- controller,
1250
- ) {
1251
- const config = configs.getConfig(filePath);
1252
- const {
1253
- allowInlineConfig,
1254
- cwd,
1255
- fix,
1256
- fixTypes,
1257
- ruleFilter,
1258
- stats,
1259
- warnIgnored,
1260
- } = eslintOptions;
1261
- const fixTypesSet = fixTypes ? new Set(fixTypes) : null;
1262
-
1263
- /*
1264
- * If a filename was entered that cannot be matched
1265
- * to a config, then notify the user.
1266
- */
1267
- if (!config) {
1268
- if (warnIgnored) {
1269
- const configStatus = configs.getConfigStatus(filePath);
1270
-
1271
- return createIgnoreResult(filePath, cwd, configStatus);
1272
- }
1273
-
1274
- return void 0;
1275
- }
1276
-
1277
- // Skip if there is cached result.
1278
- if (lintResultCache) {
1279
- const cachedResult = lintResultCache.getCachedLintResults(
1280
- filePath,
1281
- config,
1282
- );
1283
-
1284
- if (cachedResult) {
1285
- const hadMessages =
1286
- cachedResult.messages && cachedResult.messages.length > 0;
1287
-
1288
- if (hadMessages && fix) {
1289
- debug(`Reprocessing cached file to allow autofix: ${filePath}`);
1290
- } else {
1291
- debug(`Skipping file since it hasn't changed: ${filePath}`);
1292
- return cachedResult;
1293
- }
1294
- }
1295
- }
1296
-
1297
- // set up fixer for fixTypes if necessary
1298
- const fixer = getFixerForFixTypes(fix, fixTypesSet, config);
1299
-
1300
- /**
1301
- * Reads the file and lints its content.
1302
- * @returns {Promise<LintResult>} A lint result.
1303
- */
1304
- async function readAndVerifyFile() {
1305
- const readFileEnterTime = hrtimeBigint();
1306
- const text = await fsp.readFile(filePath, {
1307
- encoding: "utf8",
1308
- signal: controller?.signal,
1309
- });
1310
- const readFileExitTime = hrtimeBigint();
1311
- const readFileDuration = readFileExitTime - readFileEnterTime;
1312
- debug('File "%s" read in %t', filePath, readFileDuration);
1313
- if (readFileCounter) {
1314
- readFileCounter.duration += readFileDuration;
1315
- }
1316
-
1317
- // fail immediately if an error occurred in another file
1318
- controller?.signal.throwIfAborted();
1319
-
1320
- // do the linting
1321
- return verifyText({
1322
- text,
1323
- filePath,
1324
- configs,
1325
- cwd,
1326
- fix: fixer,
1327
- allowInlineConfig,
1328
- ruleFilter,
1329
- stats,
1330
- linter,
1331
- });
1332
- }
1333
-
1334
- // Use the retrier if provided, otherwise just call the function.
1335
- const readAndVerifyFilePromise = retrier
1336
- ? retrier.retry(readAndVerifyFile, { signal: controller?.signal })
1337
- : readAndVerifyFile();
1338
-
1339
- return readAndVerifyFilePromise.catch(error => {
1340
- controller?.abort(error);
1341
- throw error;
1342
- });
1343
- }
1344
-
1345
- /**
1346
- * Retrieves flags from the environment variable ESLINT_FLAGS.
1347
- * @param {string[]} flags The flags defined via the API.
1348
- * @returns {string[]} The merged flags to use.
1349
- */
1350
- function mergeEnvironmentFlags(flags) {
1351
- if (!process.env.ESLINT_FLAGS) {
1352
- return flags;
1353
- }
1354
-
1355
- const envFlags = process.env.ESLINT_FLAGS.trim().split(/\s*,\s*/gu);
1356
- return Array.from(new Set([...envFlags, ...flags]));
1357
- }
1358
-
1359
- /**
1360
- * Creates a new linter instance.
1361
- * @param {ESLintOptions} eslintOptions The processed ESLint options.
1362
- * @param {WarningService} warningService The warning service to use.
1363
- * @returns {Linter} The linter instance.
1364
- */
1365
- function createLinter({ cwd, flags }, warningService) {
1366
- return new Linter({
1367
- configType: "flat",
1368
- cwd,
1369
- flags: mergeEnvironmentFlags(flags),
1370
- warningService,
1371
- });
1372
- }
1373
-
1374
- /**
1375
- * Creates default configs with the specified plugins.
1376
- * @param {Record<string, Plugin> | undefined} optionPlugins The plugins specified in the ESLint options.
1377
- * @returns {Config[]} The default configs.
1378
- */
1379
- function createDefaultConfigs(optionPlugins) {
1380
- const defaultConfigs = [];
1381
-
1382
- // Add plugins
1383
- if (optionPlugins) {
1384
- const plugins = {};
1385
-
1386
- for (const [pluginName, plugin] of Object.entries(optionPlugins)) {
1387
- plugins[getShorthandName(pluginName, "eslint-plugin")] = plugin;
1388
- }
1389
-
1390
- defaultConfigs.push({ plugins });
1391
- }
1392
-
1393
- return defaultConfigs;
1394
- }
1395
-
1396
- /**
1397
- * Creates a config loader.
1398
- * @param {ESLintOptions} eslintOptions The processed ESLint options.
1399
- * @param {Config[]} defaultConfigs The default configs.
1400
- * @param {Linter} linter The linter instance.
1401
- * @param {WarningService} warningService The warning service to use.
1402
- * @returns {ConfigLoader} The config loader.
1403
- */
1404
- function createConfigLoader(
1405
- {
1406
- cwd,
1407
- baseConfig,
1408
- overrideConfig,
1409
- configFile,
1410
- ignore: ignoreEnabled,
1411
- ignorePatterns,
1412
- },
1413
- defaultConfigs,
1414
- linter,
1415
- warningService,
1416
- ) {
1417
- const configLoaderOptions = {
1418
- cwd,
1419
- baseConfig,
1420
- overrideConfig,
1421
- configFile,
1422
- ignoreEnabled,
1423
- ignorePatterns,
1424
- defaultConfigs,
1425
- hasUnstableNativeNodeJsTSConfigFlag: linter.hasFlag(
1426
- "unstable_native_nodejs_ts_config",
1427
- ),
1428
- warningService,
1429
- };
1430
-
1431
- return linter.hasFlag("v10_config_lookup_from_file")
1432
- ? new ConfigLoader(configLoaderOptions)
1433
- : new LegacyConfigLoader(configLoaderOptions);
1434
- }
1435
-
1436
- //-----------------------------------------------------------------------------
1437
- // Exports
1438
- //-----------------------------------------------------------------------------
1439
-
1440
- module.exports = {
1441
- createDebug,
1442
-
1443
- findFiles,
1444
-
1445
- isNonEmptyString,
1446
- isArrayOfNonEmptyString,
1447
-
1448
- createIgnoreResult,
1449
- isErrorMessage,
1450
- calculateStatsPerFile,
1451
- getPlaceholderPath,
1452
-
1453
- processOptions,
1454
- loadOptionsFromModule,
1455
-
1456
- getCacheFile,
1457
- createLintResultCache,
1458
-
1459
- getFixerForFixTypes,
1460
- verifyText,
1461
- lintFile,
1462
- createLinter,
1463
- createDefaultConfigs,
1464
- createConfigLoader,
1465
- };