@alexlit/lint-kit 183.1.0 → 183.2.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 (629) hide show
  1. package/package.json +1 -1
  2. package/packages/config-stylelint/index.js +1 -1
  3. package/packages/config-stylelint/package.json +2 -2
  4. package/packages/config-stylelint/plugins/bem.js +1 -5
  5. package/packages/config-eslint/node_modules/ajv/.tonic_example.js +0 -20
  6. package/packages/config-eslint/node_modules/ajv/LICENSE +0 -22
  7. package/packages/config-eslint/node_modules/ajv/README.md +0 -1505
  8. package/packages/config-eslint/node_modules/ajv/dist/ajv.bundle.js +0 -7201
  9. package/packages/config-eslint/node_modules/ajv/dist/ajv.min.js +0 -3
  10. package/packages/config-eslint/node_modules/ajv/dist/ajv.min.js.map +0 -1
  11. package/packages/config-eslint/node_modules/ajv/lib/ajv.d.ts +0 -402
  12. package/packages/config-eslint/node_modules/ajv/lib/ajv.js +0 -506
  13. package/packages/config-eslint/node_modules/ajv/lib/cache.js +0 -26
  14. package/packages/config-eslint/node_modules/ajv/lib/compile/async.js +0 -90
  15. package/packages/config-eslint/node_modules/ajv/lib/compile/equal.js +0 -5
  16. package/packages/config-eslint/node_modules/ajv/lib/compile/error_classes.js +0 -34
  17. package/packages/config-eslint/node_modules/ajv/lib/compile/formats.js +0 -142
  18. package/packages/config-eslint/node_modules/ajv/lib/compile/index.js +0 -389
  19. package/packages/config-eslint/node_modules/ajv/lib/compile/resolve.js +0 -270
  20. package/packages/config-eslint/node_modules/ajv/lib/compile/rules.js +0 -66
  21. package/packages/config-eslint/node_modules/ajv/lib/compile/schema_obj.js +0 -9
  22. package/packages/config-eslint/node_modules/ajv/lib/compile/ucs2length.js +0 -20
  23. package/packages/config-eslint/node_modules/ajv/lib/compile/util.js +0 -239
  24. package/packages/config-eslint/node_modules/ajv/lib/data.js +0 -49
  25. package/packages/config-eslint/node_modules/ajv/lib/definition_schema.js +0 -37
  26. package/packages/config-eslint/node_modules/ajv/lib/dot/_limit.jst +0 -113
  27. package/packages/config-eslint/node_modules/ajv/lib/dot/_limitItems.jst +0 -12
  28. package/packages/config-eslint/node_modules/ajv/lib/dot/_limitLength.jst +0 -12
  29. package/packages/config-eslint/node_modules/ajv/lib/dot/_limitProperties.jst +0 -12
  30. package/packages/config-eslint/node_modules/ajv/lib/dot/allOf.jst +0 -32
  31. package/packages/config-eslint/node_modules/ajv/lib/dot/anyOf.jst +0 -46
  32. package/packages/config-eslint/node_modules/ajv/lib/dot/coerce.def +0 -51
  33. package/packages/config-eslint/node_modules/ajv/lib/dot/comment.jst +0 -9
  34. package/packages/config-eslint/node_modules/ajv/lib/dot/const.jst +0 -11
  35. package/packages/config-eslint/node_modules/ajv/lib/dot/contains.jst +0 -55
  36. package/packages/config-eslint/node_modules/ajv/lib/dot/custom.jst +0 -191
  37. package/packages/config-eslint/node_modules/ajv/lib/dot/defaults.def +0 -47
  38. package/packages/config-eslint/node_modules/ajv/lib/dot/definitions.def +0 -203
  39. package/packages/config-eslint/node_modules/ajv/lib/dot/dependencies.jst +0 -79
  40. package/packages/config-eslint/node_modules/ajv/lib/dot/enum.jst +0 -30
  41. package/packages/config-eslint/node_modules/ajv/lib/dot/errors.def +0 -194
  42. package/packages/config-eslint/node_modules/ajv/lib/dot/format.jst +0 -106
  43. package/packages/config-eslint/node_modules/ajv/lib/dot/if.jst +0 -73
  44. package/packages/config-eslint/node_modules/ajv/lib/dot/items.jst +0 -98
  45. package/packages/config-eslint/node_modules/ajv/lib/dot/missing.def +0 -39
  46. package/packages/config-eslint/node_modules/ajv/lib/dot/multipleOf.jst +0 -22
  47. package/packages/config-eslint/node_modules/ajv/lib/dot/not.jst +0 -43
  48. package/packages/config-eslint/node_modules/ajv/lib/dot/oneOf.jst +0 -54
  49. package/packages/config-eslint/node_modules/ajv/lib/dot/pattern.jst +0 -25
  50. package/packages/config-eslint/node_modules/ajv/lib/dot/properties.jst +0 -245
  51. package/packages/config-eslint/node_modules/ajv/lib/dot/propertyNames.jst +0 -52
  52. package/packages/config-eslint/node_modules/ajv/lib/dot/ref.jst +0 -85
  53. package/packages/config-eslint/node_modules/ajv/lib/dot/required.jst +0 -108
  54. package/packages/config-eslint/node_modules/ajv/lib/dot/uniqueItems.jst +0 -62
  55. package/packages/config-eslint/node_modules/ajv/lib/dot/validate.jst +0 -276
  56. package/packages/config-eslint/node_modules/ajv/lib/dotjs/README.md +0 -3
  57. package/packages/config-eslint/node_modules/ajv/lib/dotjs/_limit.js +0 -163
  58. package/packages/config-eslint/node_modules/ajv/lib/dotjs/_limitItems.js +0 -80
  59. package/packages/config-eslint/node_modules/ajv/lib/dotjs/_limitLength.js +0 -85
  60. package/packages/config-eslint/node_modules/ajv/lib/dotjs/_limitProperties.js +0 -80
  61. package/packages/config-eslint/node_modules/ajv/lib/dotjs/allOf.js +0 -42
  62. package/packages/config-eslint/node_modules/ajv/lib/dotjs/anyOf.js +0 -73
  63. package/packages/config-eslint/node_modules/ajv/lib/dotjs/comment.js +0 -14
  64. package/packages/config-eslint/node_modules/ajv/lib/dotjs/const.js +0 -56
  65. package/packages/config-eslint/node_modules/ajv/lib/dotjs/contains.js +0 -81
  66. package/packages/config-eslint/node_modules/ajv/lib/dotjs/custom.js +0 -228
  67. package/packages/config-eslint/node_modules/ajv/lib/dotjs/dependencies.js +0 -168
  68. package/packages/config-eslint/node_modules/ajv/lib/dotjs/enum.js +0 -66
  69. package/packages/config-eslint/node_modules/ajv/lib/dotjs/format.js +0 -150
  70. package/packages/config-eslint/node_modules/ajv/lib/dotjs/if.js +0 -103
  71. package/packages/config-eslint/node_modules/ajv/lib/dotjs/index.js +0 -33
  72. package/packages/config-eslint/node_modules/ajv/lib/dotjs/items.js +0 -140
  73. package/packages/config-eslint/node_modules/ajv/lib/dotjs/multipleOf.js +0 -80
  74. package/packages/config-eslint/node_modules/ajv/lib/dotjs/not.js +0 -84
  75. package/packages/config-eslint/node_modules/ajv/lib/dotjs/oneOf.js +0 -73
  76. package/packages/config-eslint/node_modules/ajv/lib/dotjs/pattern.js +0 -85
  77. package/packages/config-eslint/node_modules/ajv/lib/dotjs/properties.js +0 -335
  78. package/packages/config-eslint/node_modules/ajv/lib/dotjs/propertyNames.js +0 -81
  79. package/packages/config-eslint/node_modules/ajv/lib/dotjs/ref.js +0 -124
  80. package/packages/config-eslint/node_modules/ajv/lib/dotjs/required.js +0 -270
  81. package/packages/config-eslint/node_modules/ajv/lib/dotjs/uniqueItems.js +0 -86
  82. package/packages/config-eslint/node_modules/ajv/lib/dotjs/validate.js +0 -482
  83. package/packages/config-eslint/node_modules/ajv/lib/keyword.js +0 -146
  84. package/packages/config-eslint/node_modules/ajv/lib/refs/data.json +0 -17
  85. package/packages/config-eslint/node_modules/ajv/lib/refs/json-schema-draft-04.json +0 -149
  86. package/packages/config-eslint/node_modules/ajv/lib/refs/json-schema-draft-06.json +0 -154
  87. package/packages/config-eslint/node_modules/ajv/lib/refs/json-schema-draft-07.json +0 -168
  88. package/packages/config-eslint/node_modules/ajv/lib/refs/json-schema-secure.json +0 -94
  89. package/packages/config-eslint/node_modules/ajv/package.json +0 -107
  90. package/packages/config-eslint/node_modules/ajv/scripts/.eslintrc.yml +0 -3
  91. package/packages/config-eslint/node_modules/ajv/scripts/bundle.js +0 -61
  92. package/packages/config-eslint/node_modules/ajv/scripts/compile-dots.js +0 -73
  93. package/packages/config-eslint/node_modules/ajv/scripts/info +0 -10
  94. package/packages/config-eslint/node_modules/ajv/scripts/prepare-tests +0 -12
  95. package/packages/config-eslint/node_modules/ajv/scripts/publish-built-version +0 -32
  96. package/packages/config-eslint/node_modules/ajv/scripts/travis-gh-pages +0 -23
  97. package/packages/config-eslint/node_modules/balanced-match/LICENSE.md +0 -23
  98. package/packages/config-eslint/node_modules/balanced-match/README.md +0 -57
  99. package/packages/config-eslint/node_modules/balanced-match/dist/commonjs/index.d.ts +0 -9
  100. package/packages/config-eslint/node_modules/balanced-match/dist/commonjs/index.d.ts.map +0 -1
  101. package/packages/config-eslint/node_modules/balanced-match/dist/commonjs/index.js +0 -59
  102. package/packages/config-eslint/node_modules/balanced-match/dist/commonjs/index.js.map +0 -1
  103. package/packages/config-eslint/node_modules/balanced-match/dist/commonjs/package.json +0 -3
  104. package/packages/config-eslint/node_modules/balanced-match/dist/esm/index.d.ts +0 -9
  105. package/packages/config-eslint/node_modules/balanced-match/dist/esm/index.d.ts.map +0 -1
  106. package/packages/config-eslint/node_modules/balanced-match/dist/esm/index.js +0 -54
  107. package/packages/config-eslint/node_modules/balanced-match/dist/esm/index.js.map +0 -1
  108. package/packages/config-eslint/node_modules/balanced-match/dist/esm/package.json +0 -3
  109. package/packages/config-eslint/node_modules/balanced-match/package.json +0 -68
  110. package/packages/config-eslint/node_modules/brace-expansion/LICENSE +0 -23
  111. package/packages/config-eslint/node_modules/brace-expansion/README.md +0 -94
  112. package/packages/config-eslint/node_modules/brace-expansion/dist/commonjs/index.d.ts +0 -6
  113. package/packages/config-eslint/node_modules/brace-expansion/dist/commonjs/index.d.ts.map +0 -1
  114. package/packages/config-eslint/node_modules/brace-expansion/dist/commonjs/index.js +0 -199
  115. package/packages/config-eslint/node_modules/brace-expansion/dist/commonjs/index.js.map +0 -1
  116. package/packages/config-eslint/node_modules/brace-expansion/dist/commonjs/package.json +0 -3
  117. package/packages/config-eslint/node_modules/brace-expansion/dist/esm/index.d.ts +0 -6
  118. package/packages/config-eslint/node_modules/brace-expansion/dist/esm/index.d.ts.map +0 -1
  119. package/packages/config-eslint/node_modules/brace-expansion/dist/esm/index.js +0 -195
  120. package/packages/config-eslint/node_modules/brace-expansion/dist/esm/index.js.map +0 -1
  121. package/packages/config-eslint/node_modules/brace-expansion/dist/esm/package.json +0 -3
  122. package/packages/config-eslint/node_modules/brace-expansion/package.json +0 -64
  123. package/packages/config-eslint/node_modules/eslint/LICENSE +0 -19
  124. package/packages/config-eslint/node_modules/eslint/README.md +0 -369
  125. package/packages/config-eslint/node_modules/eslint/bin/eslint.js +0 -195
  126. package/packages/config-eslint/node_modules/eslint/conf/ecma-version.js +0 -16
  127. package/packages/config-eslint/node_modules/eslint/conf/globals.js +0 -169
  128. package/packages/config-eslint/node_modules/eslint/conf/replacements.json +0 -26
  129. package/packages/config-eslint/node_modules/eslint/conf/rule-type-list.json +0 -91
  130. package/packages/config-eslint/node_modules/eslint/lib/api.js +0 -39
  131. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/formatters/formatters-meta.json +0 -18
  132. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/formatters/html.js +0 -359
  133. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/formatters/json-with-metadata.js +0 -16
  134. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/formatters/json.js +0 -13
  135. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/formatters/stylish.js +0 -153
  136. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/hash.js +0 -35
  137. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/lint-result-cache.js +0 -220
  138. package/packages/config-eslint/node_modules/eslint/lib/cli.js +0 -521
  139. package/packages/config-eslint/node_modules/eslint/lib/config/config-loader.js +0 -668
  140. package/packages/config-eslint/node_modules/eslint/lib/config/config.js +0 -674
  141. package/packages/config-eslint/node_modules/eslint/lib/config/default-config.js +0 -78
  142. package/packages/config-eslint/node_modules/eslint/lib/config/flat-config-array.js +0 -217
  143. package/packages/config-eslint/node_modules/eslint/lib/config/flat-config-schema.js +0 -598
  144. package/packages/config-eslint/node_modules/eslint/lib/config-api.js +0 -12
  145. package/packages/config-eslint/node_modules/eslint/lib/eslint/eslint-helpers.js +0 -1462
  146. package/packages/config-eslint/node_modules/eslint/lib/eslint/eslint.js +0 -1364
  147. package/packages/config-eslint/node_modules/eslint/lib/eslint/index.js +0 -7
  148. package/packages/config-eslint/node_modules/eslint/lib/eslint/worker.js +0 -173
  149. package/packages/config-eslint/node_modules/eslint/lib/languages/js/index.js +0 -336
  150. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/index.js +0 -7
  151. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/source-code.js +0 -1178
  152. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/backward-token-comment-cursor.js +0 -61
  153. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/backward-token-cursor.js +0 -57
  154. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/cursor.js +0 -76
  155. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/cursors.js +0 -120
  156. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/decorative-cursor.js +0 -38
  157. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/filter-cursor.js +0 -42
  158. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/forward-token-comment-cursor.js +0 -65
  159. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/forward-token-cursor.js +0 -62
  160. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/index.js +0 -695
  161. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/limit-cursor.js +0 -39
  162. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/padded-token-cursor.js +0 -45
  163. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/skip-cursor.js +0 -41
  164. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/utils.js +0 -131
  165. package/packages/config-eslint/node_modules/eslint/lib/languages/js/validate-language-options.js +0 -196
  166. package/packages/config-eslint/node_modules/eslint/lib/linter/apply-disable-directives.js +0 -583
  167. package/packages/config-eslint/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js +0 -828
  168. package/packages/config-eslint/node_modules/eslint/lib/linter/code-path-analysis/code-path-segment.js +0 -262
  169. package/packages/config-eslint/node_modules/eslint/lib/linter/code-path-analysis/code-path-state.js +0 -2370
  170. package/packages/config-eslint/node_modules/eslint/lib/linter/code-path-analysis/code-path.js +0 -332
  171. package/packages/config-eslint/node_modules/eslint/lib/linter/code-path-analysis/debug-helpers.js +0 -223
  172. package/packages/config-eslint/node_modules/eslint/lib/linter/code-path-analysis/fork-context.js +0 -374
  173. package/packages/config-eslint/node_modules/eslint/lib/linter/code-path-analysis/id-generator.js +0 -44
  174. package/packages/config-eslint/node_modules/eslint/lib/linter/esquery.js +0 -332
  175. package/packages/config-eslint/node_modules/eslint/lib/linter/file-context.js +0 -88
  176. package/packages/config-eslint/node_modules/eslint/lib/linter/file-report.js +0 -604
  177. package/packages/config-eslint/node_modules/eslint/lib/linter/index.js +0 -11
  178. package/packages/config-eslint/node_modules/eslint/lib/linter/interpolate.js +0 -50
  179. package/packages/config-eslint/node_modules/eslint/lib/linter/linter.js +0 -1614
  180. package/packages/config-eslint/node_modules/eslint/lib/linter/rule-fixer.js +0 -199
  181. package/packages/config-eslint/node_modules/eslint/lib/linter/source-code-fixer.js +0 -154
  182. package/packages/config-eslint/node_modules/eslint/lib/linter/source-code-traverser.js +0 -333
  183. package/packages/config-eslint/node_modules/eslint/lib/linter/source-code-visitor.js +0 -81
  184. package/packages/config-eslint/node_modules/eslint/lib/linter/timing.js +0 -209
  185. package/packages/config-eslint/node_modules/eslint/lib/linter/vfile.js +0 -115
  186. package/packages/config-eslint/node_modules/eslint/lib/options.js +0 -416
  187. package/packages/config-eslint/node_modules/eslint/lib/rule-tester/index.js +0 -7
  188. package/packages/config-eslint/node_modules/eslint/lib/rule-tester/rule-tester.js +0 -1996
  189. package/packages/config-eslint/node_modules/eslint/lib/rules/accessor-pairs.js +0 -420
  190. package/packages/config-eslint/node_modules/eslint/lib/rules/array-bracket-newline.js +0 -291
  191. package/packages/config-eslint/node_modules/eslint/lib/rules/array-bracket-spacing.js +0 -301
  192. package/packages/config-eslint/node_modules/eslint/lib/rules/array-callback-return.js +0 -510
  193. package/packages/config-eslint/node_modules/eslint/lib/rules/array-element-newline.js +0 -374
  194. package/packages/config-eslint/node_modules/eslint/lib/rules/arrow-body-style.js +0 -418
  195. package/packages/config-eslint/node_modules/eslint/lib/rules/arrow-parens.js +0 -237
  196. package/packages/config-eslint/node_modules/eslint/lib/rules/arrow-spacing.js +0 -188
  197. package/packages/config-eslint/node_modules/eslint/lib/rules/block-scoped-var.js +0 -144
  198. package/packages/config-eslint/node_modules/eslint/lib/rules/block-spacing.js +0 -202
  199. package/packages/config-eslint/node_modules/eslint/lib/rules/brace-style.js +0 -278
  200. package/packages/config-eslint/node_modules/eslint/lib/rules/callback-return.js +0 -216
  201. package/packages/config-eslint/node_modules/eslint/lib/rules/camelcase.js +0 -422
  202. package/packages/config-eslint/node_modules/eslint/lib/rules/capitalized-comments.js +0 -325
  203. package/packages/config-eslint/node_modules/eslint/lib/rules/class-methods-use-this.js +0 -250
  204. package/packages/config-eslint/node_modules/eslint/lib/rules/comma-dangle.js +0 -424
  205. package/packages/config-eslint/node_modules/eslint/lib/rules/comma-spacing.js +0 -205
  206. package/packages/config-eslint/node_modules/eslint/lib/rules/comma-style.js +0 -391
  207. package/packages/config-eslint/node_modules/eslint/lib/rules/complexity.js +0 -201
  208. package/packages/config-eslint/node_modules/eslint/lib/rules/computed-property-spacing.js +0 -251
  209. package/packages/config-eslint/node_modules/eslint/lib/rules/consistent-return.js +0 -221
  210. package/packages/config-eslint/node_modules/eslint/lib/rules/consistent-this.js +0 -179
  211. package/packages/config-eslint/node_modules/eslint/lib/rules/constructor-super.js +0 -453
  212. package/packages/config-eslint/node_modules/eslint/lib/rules/curly.js +0 -425
  213. package/packages/config-eslint/node_modules/eslint/lib/rules/default-case-last.js +0 -51
  214. package/packages/config-eslint/node_modules/eslint/lib/rules/default-case.js +0 -103
  215. package/packages/config-eslint/node_modules/eslint/lib/rules/default-param-last.js +0 -78
  216. package/packages/config-eslint/node_modules/eslint/lib/rules/dot-location.js +0 -138
  217. package/packages/config-eslint/node_modules/eslint/lib/rules/dot-notation.js +0 -216
  218. package/packages/config-eslint/node_modules/eslint/lib/rules/eol-last.js +0 -135
  219. package/packages/config-eslint/node_modules/eslint/lib/rules/eqeqeq.js +0 -210
  220. package/packages/config-eslint/node_modules/eslint/lib/rules/for-direction.js +0 -168
  221. package/packages/config-eslint/node_modules/eslint/lib/rules/func-call-spacing.js +0 -281
  222. package/packages/config-eslint/node_modules/eslint/lib/rules/func-name-matching.js +0 -338
  223. package/packages/config-eslint/node_modules/eslint/lib/rules/func-names.js +0 -204
  224. package/packages/config-eslint/node_modules/eslint/lib/rules/func-style.js +0 -221
  225. package/packages/config-eslint/node_modules/eslint/lib/rules/function-call-argument-newline.js +0 -166
  226. package/packages/config-eslint/node_modules/eslint/lib/rules/function-paren-newline.js +0 -368
  227. package/packages/config-eslint/node_modules/eslint/lib/rules/generator-star-spacing.js +0 -246
  228. package/packages/config-eslint/node_modules/eslint/lib/rules/getter-return.js +0 -242
  229. package/packages/config-eslint/node_modules/eslint/lib/rules/global-require.js +0 -117
  230. package/packages/config-eslint/node_modules/eslint/lib/rules/grouped-accessor-pairs.js +0 -268
  231. package/packages/config-eslint/node_modules/eslint/lib/rules/guard-for-in.js +0 -85
  232. package/packages/config-eslint/node_modules/eslint/lib/rules/handle-callback-err.js +0 -122
  233. package/packages/config-eslint/node_modules/eslint/lib/rules/id-blacklist.js +0 -241
  234. package/packages/config-eslint/node_modules/eslint/lib/rules/id-denylist.js +0 -223
  235. package/packages/config-eslint/node_modules/eslint/lib/rules/id-length.js +0 -217
  236. package/packages/config-eslint/node_modules/eslint/lib/rules/id-match.js +0 -363
  237. package/packages/config-eslint/node_modules/eslint/lib/rules/implicit-arrow-linebreak.js +0 -125
  238. package/packages/config-eslint/node_modules/eslint/lib/rules/indent-legacy.js +0 -1369
  239. package/packages/config-eslint/node_modules/eslint/lib/rules/indent.js +0 -2334
  240. package/packages/config-eslint/node_modules/eslint/lib/rules/index.js +0 -332
  241. package/packages/config-eslint/node_modules/eslint/lib/rules/init-declarations.js +0 -172
  242. package/packages/config-eslint/node_modules/eslint/lib/rules/jsx-quotes.js +0 -128
  243. package/packages/config-eslint/node_modules/eslint/lib/rules/key-spacing.js +0 -822
  244. package/packages/config-eslint/node_modules/eslint/lib/rules/keyword-spacing.js +0 -701
  245. package/packages/config-eslint/node_modules/eslint/lib/rules/line-comment-position.js +0 -157
  246. package/packages/config-eslint/node_modules/eslint/lib/rules/linebreak-style.js +0 -135
  247. package/packages/config-eslint/node_modules/eslint/lib/rules/lines-around-comment.js +0 -581
  248. package/packages/config-eslint/node_modules/eslint/lib/rules/lines-around-directive.js +0 -249
  249. package/packages/config-eslint/node_modules/eslint/lib/rules/lines-between-class-members.js +0 -358
  250. package/packages/config-eslint/node_modules/eslint/lib/rules/logical-assignment-operators.js +0 -688
  251. package/packages/config-eslint/node_modules/eslint/lib/rules/max-classes-per-file.js +0 -90
  252. package/packages/config-eslint/node_modules/eslint/lib/rules/max-depth.js +0 -159
  253. package/packages/config-eslint/node_modules/eslint/lib/rules/max-len.js +0 -497
  254. package/packages/config-eslint/node_modules/eslint/lib/rules/max-lines-per-function.js +0 -238
  255. package/packages/config-eslint/node_modules/eslint/lib/rules/max-lines.js +0 -189
  256. package/packages/config-eslint/node_modules/eslint/lib/rules/max-nested-callbacks.js +0 -115
  257. package/packages/config-eslint/node_modules/eslint/lib/rules/max-params.js +0 -148
  258. package/packages/config-eslint/node_modules/eslint/lib/rules/max-statements-per-line.js +0 -224
  259. package/packages/config-eslint/node_modules/eslint/lib/rules/max-statements.js +0 -188
  260. package/packages/config-eslint/node_modules/eslint/lib/rules/multiline-comment-style.js +0 -652
  261. package/packages/config-eslint/node_modules/eslint/lib/rules/multiline-ternary.js +0 -257
  262. package/packages/config-eslint/node_modules/eslint/lib/rules/new-cap.js +0 -277
  263. package/packages/config-eslint/node_modules/eslint/lib/rules/new-parens.js +0 -120
  264. package/packages/config-eslint/node_modules/eslint/lib/rules/newline-after-var.js +0 -307
  265. package/packages/config-eslint/node_modules/eslint/lib/rules/newline-before-return.js +0 -242
  266. package/packages/config-eslint/node_modules/eslint/lib/rules/newline-per-chained-call.js +0 -159
  267. package/packages/config-eslint/node_modules/eslint/lib/rules/no-alert.js +0 -149
  268. package/packages/config-eslint/node_modules/eslint/lib/rules/no-array-constructor.js +0 -195
  269. package/packages/config-eslint/node_modules/eslint/lib/rules/no-async-promise-executor.js +0 -45
  270. package/packages/config-eslint/node_modules/eslint/lib/rules/no-await-in-loop.js +0 -115
  271. package/packages/config-eslint/node_modules/eslint/lib/rules/no-bitwise.js +0 -145
  272. package/packages/config-eslint/node_modules/eslint/lib/rules/no-buffer-constructor.js +0 -74
  273. package/packages/config-eslint/node_modules/eslint/lib/rules/no-caller.js +0 -52
  274. package/packages/config-eslint/node_modules/eslint/lib/rules/no-case-declarations.js +0 -80
  275. package/packages/config-eslint/node_modules/eslint/lib/rules/no-catch-shadow.js +0 -96
  276. package/packages/config-eslint/node_modules/eslint/lib/rules/no-class-assign.js +0 -66
  277. package/packages/config-eslint/node_modules/eslint/lib/rules/no-compare-neg-zero.js +0 -74
  278. package/packages/config-eslint/node_modules/eslint/lib/rules/no-cond-assign.js +0 -175
  279. package/packages/config-eslint/node_modules/eslint/lib/rules/no-confusing-arrow.js +0 -127
  280. package/packages/config-eslint/node_modules/eslint/lib/rules/no-console.js +0 -227
  281. package/packages/config-eslint/node_modules/eslint/lib/rules/no-const-assign.js +0 -73
  282. package/packages/config-eslint/node_modules/eslint/lib/rules/no-constant-binary-expression.js +0 -603
  283. package/packages/config-eslint/node_modules/eslint/lib/rules/no-constant-condition.js +0 -177
  284. package/packages/config-eslint/node_modules/eslint/lib/rules/no-constructor-return.js +0 -62
  285. package/packages/config-eslint/node_modules/eslint/lib/rules/no-continue.js +0 -38
  286. package/packages/config-eslint/node_modules/eslint/lib/rules/no-control-regex.js +0 -142
  287. package/packages/config-eslint/node_modules/eslint/lib/rules/no-debugger.js +0 -41
  288. package/packages/config-eslint/node_modules/eslint/lib/rules/no-delete-var.js +0 -42
  289. package/packages/config-eslint/node_modules/eslint/lib/rules/no-div-regex.js +0 -60
  290. package/packages/config-eslint/node_modules/eslint/lib/rules/no-dupe-args.js +0 -98
  291. package/packages/config-eslint/node_modules/eslint/lib/rules/no-dupe-class-members.js +0 -117
  292. package/packages/config-eslint/node_modules/eslint/lib/rules/no-dupe-else-if.js +0 -145
  293. package/packages/config-eslint/node_modules/eslint/lib/rules/no-dupe-keys.js +0 -165
  294. package/packages/config-eslint/node_modules/eslint/lib/rules/no-duplicate-case.js +0 -78
  295. package/packages/config-eslint/node_modules/eslint/lib/rules/no-duplicate-imports.js +0 -368
  296. package/packages/config-eslint/node_modules/eslint/lib/rules/no-else-return.js +0 -456
  297. package/packages/config-eslint/node_modules/eslint/lib/rules/no-empty-character-class.js +0 -83
  298. package/packages/config-eslint/node_modules/eslint/lib/rules/no-empty-function.js +0 -236
  299. package/packages/config-eslint/node_modules/eslint/lib/rules/no-empty-pattern.js +0 -85
  300. package/packages/config-eslint/node_modules/eslint/lib/rules/no-empty-static-block.js +0 -73
  301. package/packages/config-eslint/node_modules/eslint/lib/rules/no-empty.js +0 -153
  302. package/packages/config-eslint/node_modules/eslint/lib/rules/no-eq-null.js +0 -51
  303. package/packages/config-eslint/node_modules/eslint/lib/rules/no-eval.js +0 -301
  304. package/packages/config-eslint/node_modules/eslint/lib/rules/no-ex-assign.js +0 -57
  305. package/packages/config-eslint/node_modules/eslint/lib/rules/no-extend-native.js +0 -180
  306. package/packages/config-eslint/node_modules/eslint/lib/rules/no-extra-bind.js +0 -224
  307. package/packages/config-eslint/node_modules/eslint/lib/rules/no-extra-boolean-cast.js +0 -420
  308. package/packages/config-eslint/node_modules/eslint/lib/rules/no-extra-label.js +0 -169
  309. package/packages/config-eslint/node_modules/eslint/lib/rules/no-extra-parens.js +0 -1669
  310. package/packages/config-eslint/node_modules/eslint/lib/rules/no-extra-semi.js +0 -167
  311. package/packages/config-eslint/node_modules/eslint/lib/rules/no-fallthrough.js +0 -260
  312. package/packages/config-eslint/node_modules/eslint/lib/rules/no-floating-decimal.js +0 -99
  313. package/packages/config-eslint/node_modules/eslint/lib/rules/no-func-assign.js +0 -77
  314. package/packages/config-eslint/node_modules/eslint/lib/rules/no-global-assign.js +0 -101
  315. package/packages/config-eslint/node_modules/eslint/lib/rules/no-implicit-coercion.js +0 -468
  316. package/packages/config-eslint/node_modules/eslint/lib/rules/no-implicit-globals.js +0 -187
  317. package/packages/config-eslint/node_modules/eslint/lib/rules/no-implied-eval.js +0 -171
  318. package/packages/config-eslint/node_modules/eslint/lib/rules/no-import-assign.js +0 -227
  319. package/packages/config-eslint/node_modules/eslint/lib/rules/no-inline-comments.js +0 -115
  320. package/packages/config-eslint/node_modules/eslint/lib/rules/no-inner-declarations.js +0 -147
  321. package/packages/config-eslint/node_modules/eslint/lib/rules/no-invalid-regexp.js +0 -244
  322. package/packages/config-eslint/node_modules/eslint/lib/rules/no-invalid-this.js +0 -178
  323. package/packages/config-eslint/node_modules/eslint/lib/rules/no-irregular-whitespace.js +0 -292
  324. package/packages/config-eslint/node_modules/eslint/lib/rules/no-iterator.js +0 -48
  325. package/packages/config-eslint/node_modules/eslint/lib/rules/no-label-var.js +0 -78
  326. package/packages/config-eslint/node_modules/eslint/lib/rules/no-labels.js +0 -156
  327. package/packages/config-eslint/node_modules/eslint/lib/rules/no-lone-blocks.js +0 -140
  328. package/packages/config-eslint/node_modules/eslint/lib/rules/no-lonely-if.js +0 -126
  329. package/packages/config-eslint/node_modules/eslint/lib/rules/no-loop-func.js +0 -273
  330. package/packages/config-eslint/node_modules/eslint/lib/rules/no-loss-of-precision.js +0 -249
  331. package/packages/config-eslint/node_modules/eslint/lib/rules/no-magic-numbers.js +0 -365
  332. package/packages/config-eslint/node_modules/eslint/lib/rules/no-misleading-character-class.js +0 -595
  333. package/packages/config-eslint/node_modules/eslint/lib/rules/no-mixed-operators.js +0 -253
  334. package/packages/config-eslint/node_modules/eslint/lib/rules/no-mixed-requires.js +0 -267
  335. package/packages/config-eslint/node_modules/eslint/lib/rules/no-mixed-spaces-and-tabs.js +0 -148
  336. package/packages/config-eslint/node_modules/eslint/lib/rules/no-multi-assign.js +0 -66
  337. package/packages/config-eslint/node_modules/eslint/lib/rules/no-multi-spaces.js +0 -179
  338. package/packages/config-eslint/node_modules/eslint/lib/rules/no-multi-str.js +0 -67
  339. package/packages/config-eslint/node_modules/eslint/lib/rules/no-multiple-empty-lines.js +0 -210
  340. package/packages/config-eslint/node_modules/eslint/lib/rules/no-native-reassign.js +0 -114
  341. package/packages/config-eslint/node_modules/eslint/lib/rules/no-negated-condition.js +0 -100
  342. package/packages/config-eslint/node_modules/eslint/lib/rules/no-negated-in-lhs.js +0 -59
  343. package/packages/config-eslint/node_modules/eslint/lib/rules/no-nested-ternary.js +0 -46
  344. package/packages/config-eslint/node_modules/eslint/lib/rules/no-new-func.js +0 -96
  345. package/packages/config-eslint/node_modules/eslint/lib/rules/no-new-native-nonconstructor.js +0 -70
  346. package/packages/config-eslint/node_modules/eslint/lib/rules/no-new-object.js +0 -76
  347. package/packages/config-eslint/node_modules/eslint/lib/rules/no-new-require.js +0 -67
  348. package/packages/config-eslint/node_modules/eslint/lib/rules/no-new-symbol.js +0 -74
  349. package/packages/config-eslint/node_modules/eslint/lib/rules/no-new-wrappers.js +0 -62
  350. package/packages/config-eslint/node_modules/eslint/lib/rules/no-new.js +0 -42
  351. package/packages/config-eslint/node_modules/eslint/lib/rules/no-nonoctal-decimal-escape.js +0 -176
  352. package/packages/config-eslint/node_modules/eslint/lib/rules/no-obj-calls.js +0 -99
  353. package/packages/config-eslint/node_modules/eslint/lib/rules/no-object-constructor.js +0 -124
  354. package/packages/config-eslint/node_modules/eslint/lib/rules/no-octal-escape.js +0 -53
  355. package/packages/config-eslint/node_modules/eslint/lib/rules/no-octal.js +0 -42
  356. package/packages/config-eslint/node_modules/eslint/lib/rules/no-param-reassign.js +0 -248
  357. package/packages/config-eslint/node_modules/eslint/lib/rules/no-path-concat.js +0 -79
  358. package/packages/config-eslint/node_modules/eslint/lib/rules/no-plusplus.js +0 -102
  359. package/packages/config-eslint/node_modules/eslint/lib/rules/no-process-env.js +0 -68
  360. package/packages/config-eslint/node_modules/eslint/lib/rules/no-process-exit.js +0 -67
  361. package/packages/config-eslint/node_modules/eslint/lib/rules/no-promise-executor-return.js +0 -264
  362. package/packages/config-eslint/node_modules/eslint/lib/rules/no-proto.js +0 -45
  363. package/packages/config-eslint/node_modules/eslint/lib/rules/no-prototype-builtins.js +0 -181
  364. package/packages/config-eslint/node_modules/eslint/lib/rules/no-redeclare.js +0 -173
  365. package/packages/config-eslint/node_modules/eslint/lib/rules/no-regex-spaces.js +0 -219
  366. package/packages/config-eslint/node_modules/eslint/lib/rules/no-restricted-exports.js +0 -227
  367. package/packages/config-eslint/node_modules/eslint/lib/rules/no-restricted-globals.js +0 -266
  368. package/packages/config-eslint/node_modules/eslint/lib/rules/no-restricted-imports.js +0 -892
  369. package/packages/config-eslint/node_modules/eslint/lib/rules/no-restricted-modules.js +0 -249
  370. package/packages/config-eslint/node_modules/eslint/lib/rules/no-restricted-properties.js +0 -233
  371. package/packages/config-eslint/node_modules/eslint/lib/rules/no-restricted-syntax.js +0 -74
  372. package/packages/config-eslint/node_modules/eslint/lib/rules/no-return-assign.js +0 -87
  373. package/packages/config-eslint/node_modules/eslint/lib/rules/no-return-await.js +0 -162
  374. package/packages/config-eslint/node_modules/eslint/lib/rules/no-script-url.js +0 -68
  375. package/packages/config-eslint/node_modules/eslint/lib/rules/no-self-assign.js +0 -186
  376. package/packages/config-eslint/node_modules/eslint/lib/rules/no-self-compare.js +0 -77
  377. package/packages/config-eslint/node_modules/eslint/lib/rules/no-sequences.js +0 -158
  378. package/packages/config-eslint/node_modules/eslint/lib/rules/no-setter-return.js +0 -224
  379. package/packages/config-eslint/node_modules/eslint/lib/rules/no-shadow-restricted-names.js +0 -113
  380. package/packages/config-eslint/node_modules/eslint/lib/rules/no-shadow.js +0 -695
  381. package/packages/config-eslint/node_modules/eslint/lib/rules/no-spaced-func.js +0 -105
  382. package/packages/config-eslint/node_modules/eslint/lib/rules/no-sparse-arrays.js +0 -68
  383. package/packages/config-eslint/node_modules/eslint/lib/rules/no-sync.js +0 -81
  384. package/packages/config-eslint/node_modules/eslint/lib/rules/no-tabs.js +0 -110
  385. package/packages/config-eslint/node_modules/eslint/lib/rules/no-template-curly-in-string.js +0 -45
  386. package/packages/config-eslint/node_modules/eslint/lib/rules/no-ternary.js +0 -38
  387. package/packages/config-eslint/node_modules/eslint/lib/rules/no-this-before-super.js +0 -365
  388. package/packages/config-eslint/node_modules/eslint/lib/rules/no-throw-literal.js +0 -46
  389. package/packages/config-eslint/node_modules/eslint/lib/rules/no-trailing-spaces.js +0 -227
  390. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unassigned-vars.js +0 -80
  391. package/packages/config-eslint/node_modules/eslint/lib/rules/no-undef-init.js +0 -101
  392. package/packages/config-eslint/node_modules/eslint/lib/rules/no-undef.js +0 -84
  393. package/packages/config-eslint/node_modules/eslint/lib/rules/no-undefined.js +0 -91
  394. package/packages/config-eslint/node_modules/eslint/lib/rules/no-underscore-dangle.js +0 -383
  395. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unexpected-multiline.js +0 -130
  396. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unmodified-loop-condition.js +0 -367
  397. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unneeded-ternary.js +0 -232
  398. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unreachable-loop.js +0 -190
  399. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unreachable.js +0 -300
  400. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unsafe-finally.js +0 -119
  401. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unsafe-negation.js +0 -152
  402. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unsafe-optional-chaining.js +0 -221
  403. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unused-expressions.js +0 -227
  404. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unused-labels.js +0 -158
  405. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unused-private-class-members.js +0 -219
  406. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unused-vars.js +0 -1746
  407. package/packages/config-eslint/node_modules/eslint/lib/rules/no-use-before-define.js +0 -453
  408. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-assignment.js +0 -658
  409. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-backreference.js +0 -263
  410. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-call.js +0 -95
  411. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-catch.js +0 -57
  412. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-computed-key.js +0 -204
  413. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-concat.js +0 -121
  414. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-constructor.js +0 -262
  415. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-escape.js +0 -406
  416. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-rename.js +0 -202
  417. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-return.js +0 -401
  418. package/packages/config-eslint/node_modules/eslint/lib/rules/no-var.js +0 -375
  419. package/packages/config-eslint/node_modules/eslint/lib/rules/no-void.js +0 -69
  420. package/packages/config-eslint/node_modules/eslint/lib/rules/no-warning-comments.js +0 -209
  421. package/packages/config-eslint/node_modules/eslint/lib/rules/no-whitespace-before-property.js +0 -150
  422. package/packages/config-eslint/node_modules/eslint/lib/rules/no-with.js +0 -37
  423. package/packages/config-eslint/node_modules/eslint/lib/rules/nonblock-statement-body-position.js +0 -164
  424. package/packages/config-eslint/node_modules/eslint/lib/rules/object-curly-newline.js +0 -383
  425. package/packages/config-eslint/node_modules/eslint/lib/rules/object-curly-spacing.js +0 -369
  426. package/packages/config-eslint/node_modules/eslint/lib/rules/object-property-newline.js +0 -151
  427. package/packages/config-eslint/node_modules/eslint/lib/rules/object-shorthand.js +0 -652
  428. package/packages/config-eslint/node_modules/eslint/lib/rules/one-var-declaration-per-line.js +0 -117
  429. package/packages/config-eslint/node_modules/eslint/lib/rules/one-var.js +0 -717
  430. package/packages/config-eslint/node_modules/eslint/lib/rules/operator-assignment.js +0 -270
  431. package/packages/config-eslint/node_modules/eslint/lib/rules/operator-linebreak.js +0 -315
  432. package/packages/config-eslint/node_modules/eslint/lib/rules/padded-blocks.js +0 -366
  433. package/packages/config-eslint/node_modules/eslint/lib/rules/padding-line-between-statements.js +0 -612
  434. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-arrow-callback.js +0 -444
  435. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-const.js +0 -554
  436. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-destructuring.js +0 -332
  437. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-exponentiation-operator.js +0 -235
  438. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-named-capture-group.js +0 -197
  439. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-numeric-literals.js +0 -157
  440. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-object-has-own.js +0 -148
  441. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-object-spread.js +0 -319
  442. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-promise-reject-errors.js +0 -154
  443. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-reflect.js +0 -150
  444. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-regex-literals.js +0 -605
  445. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-rest-params.js +0 -125
  446. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-spread.js +0 -91
  447. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-template.js +0 -347
  448. package/packages/config-eslint/node_modules/eslint/lib/rules/preserve-caught-error.js +0 -535
  449. package/packages/config-eslint/node_modules/eslint/lib/rules/quote-props.js +0 -394
  450. package/packages/config-eslint/node_modules/eslint/lib/rules/quotes.js +0 -416
  451. package/packages/config-eslint/node_modules/eslint/lib/rules/radix.js +0 -199
  452. package/packages/config-eslint/node_modules/eslint/lib/rules/require-atomic-updates.js +0 -365
  453. package/packages/config-eslint/node_modules/eslint/lib/rules/require-await.js +0 -184
  454. package/packages/config-eslint/node_modules/eslint/lib/rules/require-unicode-regexp.js +0 -317
  455. package/packages/config-eslint/node_modules/eslint/lib/rules/require-yield.js +0 -86
  456. package/packages/config-eslint/node_modules/eslint/lib/rules/rest-spread-spacing.js +0 -150
  457. package/packages/config-eslint/node_modules/eslint/lib/rules/semi-spacing.js +0 -297
  458. package/packages/config-eslint/node_modules/eslint/lib/rules/semi-style.js +0 -218
  459. package/packages/config-eslint/node_modules/eslint/lib/rules/semi.js +0 -476
  460. package/packages/config-eslint/node_modules/eslint/lib/rules/sort-imports.js +0 -319
  461. package/packages/config-eslint/node_modules/eslint/lib/rules/sort-keys.js +0 -268
  462. package/packages/config-eslint/node_modules/eslint/lib/rules/sort-vars.js +0 -140
  463. package/packages/config-eslint/node_modules/eslint/lib/rules/space-before-blocks.js +0 -232
  464. package/packages/config-eslint/node_modules/eslint/lib/rules/space-before-function-paren.js +0 -202
  465. package/packages/config-eslint/node_modules/eslint/lib/rules/space-in-parens.js +0 -374
  466. package/packages/config-eslint/node_modules/eslint/lib/rules/space-infix-ops.js +0 -249
  467. package/packages/config-eslint/node_modules/eslint/lib/rules/space-unary-ops.js +0 -400
  468. package/packages/config-eslint/node_modules/eslint/lib/rules/spaced-comment.js +0 -447
  469. package/packages/config-eslint/node_modules/eslint/lib/rules/strict.js +0 -324
  470. package/packages/config-eslint/node_modules/eslint/lib/rules/switch-colon-spacing.js +0 -158
  471. package/packages/config-eslint/node_modules/eslint/lib/rules/symbol-description.js +0 -70
  472. package/packages/config-eslint/node_modules/eslint/lib/rules/template-curly-spacing.js +0 -168
  473. package/packages/config-eslint/node_modules/eslint/lib/rules/template-tag-spacing.js +0 -121
  474. package/packages/config-eslint/node_modules/eslint/lib/rules/unicode-bom.js +0 -73
  475. package/packages/config-eslint/node_modules/eslint/lib/rules/use-isnan.js +0 -268
  476. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/ast-utils.js +0 -2848
  477. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/char-source.js +0 -247
  478. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/fix-tracker.js +0 -125
  479. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/keywords.js +0 -67
  480. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/lazy-loading-rule-map.js +0 -118
  481. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/regular-expressions.js +0 -58
  482. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/unicode/index.js +0 -16
  483. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/unicode/is-combining-character.js +0 -13
  484. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/unicode/is-emoji-modifier.js +0 -13
  485. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/unicode/is-regional-indicator-symbol.js +0 -13
  486. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/unicode/is-surrogate-pair.js +0 -14
  487. package/packages/config-eslint/node_modules/eslint/lib/rules/valid-typeof.js +0 -171
  488. package/packages/config-eslint/node_modules/eslint/lib/rules/vars-on-top.js +0 -165
  489. package/packages/config-eslint/node_modules/eslint/lib/rules/wrap-iife.js +0 -238
  490. package/packages/config-eslint/node_modules/eslint/lib/rules/wrap-regex.js +0 -91
  491. package/packages/config-eslint/node_modules/eslint/lib/rules/yield-star-spacing.js +0 -158
  492. package/packages/config-eslint/node_modules/eslint/lib/rules/yoda.js +0 -362
  493. package/packages/config-eslint/node_modules/eslint/lib/services/parser-service.js +0 -64
  494. package/packages/config-eslint/node_modules/eslint/lib/services/processor-service.js +0 -100
  495. package/packages/config-eslint/node_modules/eslint/lib/services/suppressions-service.js +0 -302
  496. package/packages/config-eslint/node_modules/eslint/lib/services/warning-service.js +0 -87
  497. package/packages/config-eslint/node_modules/eslint/lib/shared/ajv.js +0 -34
  498. package/packages/config-eslint/node_modules/eslint/lib/shared/assert.js +0 -21
  499. package/packages/config-eslint/node_modules/eslint/lib/shared/ast-utils.js +0 -30
  500. package/packages/config-eslint/node_modules/eslint/lib/shared/deep-merge-arrays.js +0 -62
  501. package/packages/config-eslint/node_modules/eslint/lib/shared/directives.js +0 -16
  502. package/packages/config-eslint/node_modules/eslint/lib/shared/flags.js +0 -89
  503. package/packages/config-eslint/node_modules/eslint/lib/shared/logging.js +0 -38
  504. package/packages/config-eslint/node_modules/eslint/lib/shared/naming.js +0 -109
  505. package/packages/config-eslint/node_modules/eslint/lib/shared/option-utils.js +0 -63
  506. package/packages/config-eslint/node_modules/eslint/lib/shared/relative-module-resolver.js +0 -28
  507. package/packages/config-eslint/node_modules/eslint/lib/shared/runtime-info.js +0 -177
  508. package/packages/config-eslint/node_modules/eslint/lib/shared/serialization.js +0 -78
  509. package/packages/config-eslint/node_modules/eslint/lib/shared/severity.js +0 -49
  510. package/packages/config-eslint/node_modules/eslint/lib/shared/stats.js +0 -30
  511. package/packages/config-eslint/node_modules/eslint/lib/shared/string-utils.js +0 -58
  512. package/packages/config-eslint/node_modules/eslint/lib/shared/text-table.js +0 -68
  513. package/packages/config-eslint/node_modules/eslint/lib/shared/translate-cli-options.js +0 -223
  514. package/packages/config-eslint/node_modules/eslint/lib/shared/traverser.js +0 -202
  515. package/packages/config-eslint/node_modules/eslint/lib/types/config-api.d.ts +0 -12
  516. package/packages/config-eslint/node_modules/eslint/lib/types/index.d.ts +0 -1475
  517. package/packages/config-eslint/node_modules/eslint/lib/types/rules.d.ts +0 -5603
  518. package/packages/config-eslint/node_modules/eslint/lib/types/universal.d.ts +0 -6
  519. package/packages/config-eslint/node_modules/eslint/lib/types/use-at-your-own-risk.d.ts +0 -34
  520. package/packages/config-eslint/node_modules/eslint/lib/universal.js +0 -10
  521. package/packages/config-eslint/node_modules/eslint/lib/unsupported-api.js +0 -21
  522. package/packages/config-eslint/node_modules/eslint/messages/all-matched-files-ignored.js +0 -21
  523. package/packages/config-eslint/node_modules/eslint/messages/config-file-missing.js +0 -16
  524. package/packages/config-eslint/node_modules/eslint/messages/config-plugin-missing.js +0 -14
  525. package/packages/config-eslint/node_modules/eslint/messages/config-serialize-function.js +0 -30
  526. package/packages/config-eslint/node_modules/eslint/messages/eslintrc-incompat.js +0 -117
  527. package/packages/config-eslint/node_modules/eslint/messages/eslintrc-plugins.js +0 -27
  528. package/packages/config-eslint/node_modules/eslint/messages/extend-config-missing.js +0 -13
  529. package/packages/config-eslint/node_modules/eslint/messages/failed-to-read-json.js +0 -11
  530. package/packages/config-eslint/node_modules/eslint/messages/file-not-found.js +0 -10
  531. package/packages/config-eslint/node_modules/eslint/messages/invalid-rule-options.js +0 -17
  532. package/packages/config-eslint/node_modules/eslint/messages/invalid-rule-severity.js +0 -13
  533. package/packages/config-eslint/node_modules/eslint/messages/no-config-found.js +0 -15
  534. package/packages/config-eslint/node_modules/eslint/messages/plugin-conflict.js +0 -22
  535. package/packages/config-eslint/node_modules/eslint/messages/plugin-invalid.js +0 -16
  536. package/packages/config-eslint/node_modules/eslint/messages/plugin-missing.js +0 -19
  537. package/packages/config-eslint/node_modules/eslint/messages/shared.js +0 -23
  538. package/packages/config-eslint/node_modules/eslint/messages/whitespace-found.js +0 -11
  539. package/packages/config-eslint/node_modules/eslint/package.json +0 -220
  540. package/packages/config-eslint/node_modules/eslint-visitor-keys/LICENSE +0 -201
  541. package/packages/config-eslint/node_modules/eslint-visitor-keys/README.md +0 -123
  542. package/packages/config-eslint/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.cjs +0 -187
  543. package/packages/config-eslint/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.d.cts +0 -28
  544. package/packages/config-eslint/node_modules/eslint-visitor-keys/dist/index.d.ts +0 -16
  545. package/packages/config-eslint/node_modules/eslint-visitor-keys/dist/visitor-keys.d.ts +0 -12
  546. package/packages/config-eslint/node_modules/eslint-visitor-keys/lib/index.js +0 -67
  547. package/packages/config-eslint/node_modules/eslint-visitor-keys/lib/visitor-keys.js +0 -118
  548. package/packages/config-eslint/node_modules/eslint-visitor-keys/package.json +0 -57
  549. package/packages/config-eslint/node_modules/espree/LICENSE +0 -25
  550. package/packages/config-eslint/node_modules/espree/README.md +0 -261
  551. package/packages/config-eslint/node_modules/espree/dist/espree.cjs +0 -1284
  552. package/packages/config-eslint/node_modules/espree/dist/espree.d.cts +0 -3
  553. package/packages/config-eslint/node_modules/espree/dist/espree.d.cts.map +0 -1
  554. package/packages/config-eslint/node_modules/espree/dist/espree.d.ts +0 -67
  555. package/packages/config-eslint/node_modules/espree/dist/espree.d.ts.map +0 -1
  556. package/packages/config-eslint/node_modules/espree/espree.js +0 -287
  557. package/packages/config-eslint/node_modules/espree/lib/espree.js +0 -493
  558. package/packages/config-eslint/node_modules/espree/lib/options.js +0 -176
  559. package/packages/config-eslint/node_modules/espree/lib/token-translator.js +0 -306
  560. package/packages/config-eslint/node_modules/espree/lib/types.js +0 -118
  561. package/packages/config-eslint/node_modules/espree/package.json +0 -70
  562. package/packages/config-eslint/node_modules/ignore/LICENSE-MIT +0 -21
  563. package/packages/config-eslint/node_modules/ignore/README.md +0 -412
  564. package/packages/config-eslint/node_modules/ignore/index.d.ts +0 -61
  565. package/packages/config-eslint/node_modules/ignore/index.js +0 -636
  566. package/packages/config-eslint/node_modules/ignore/legacy.js +0 -559
  567. package/packages/config-eslint/node_modules/ignore/package.json +0 -74
  568. package/packages/config-eslint/node_modules/json-schema-traverse/.eslintrc.yml +0 -27
  569. package/packages/config-eslint/node_modules/json-schema-traverse/.travis.yml +0 -8
  570. package/packages/config-eslint/node_modules/json-schema-traverse/LICENSE +0 -21
  571. package/packages/config-eslint/node_modules/json-schema-traverse/README.md +0 -83
  572. package/packages/config-eslint/node_modules/json-schema-traverse/index.js +0 -89
  573. package/packages/config-eslint/node_modules/json-schema-traverse/package.json +0 -43
  574. package/packages/config-eslint/node_modules/json-schema-traverse/spec/.eslintrc.yml +0 -6
  575. package/packages/config-eslint/node_modules/json-schema-traverse/spec/fixtures/schema.js +0 -125
  576. package/packages/config-eslint/node_modules/json-schema-traverse/spec/index.spec.js +0 -171
  577. package/packages/config-eslint/node_modules/minimatch/LICENSE.md +0 -55
  578. package/packages/config-eslint/node_modules/minimatch/README.md +0 -528
  579. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts +0 -2
  580. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts.map +0 -1
  581. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js +0 -14
  582. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js.map +0 -1
  583. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/ast.d.ts +0 -22
  584. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/ast.d.ts.map +0 -1
  585. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/ast.js +0 -846
  586. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/ast.js.map +0 -1
  587. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts +0 -8
  588. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts.map +0 -1
  589. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/brace-expressions.js +0 -150
  590. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/brace-expressions.js.map +0 -1
  591. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/escape.d.ts +0 -15
  592. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/escape.d.ts.map +0 -1
  593. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/escape.js +0 -30
  594. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/escape.js.map +0 -1
  595. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/index.d.ts +0 -174
  596. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/index.d.ts.map +0 -1
  597. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/index.js +0 -1121
  598. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/index.js.map +0 -1
  599. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/package.json +0 -3
  600. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/unescape.d.ts +0 -22
  601. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/unescape.d.ts.map +0 -1
  602. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/unescape.js +0 -38
  603. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/unescape.js.map +0 -1
  604. package/packages/config-eslint/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts +0 -2
  605. package/packages/config-eslint/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts.map +0 -1
  606. package/packages/config-eslint/node_modules/minimatch/dist/esm/assert-valid-pattern.js +0 -10
  607. package/packages/config-eslint/node_modules/minimatch/dist/esm/assert-valid-pattern.js.map +0 -1
  608. package/packages/config-eslint/node_modules/minimatch/dist/esm/ast.d.ts +0 -22
  609. package/packages/config-eslint/node_modules/minimatch/dist/esm/ast.d.ts.map +0 -1
  610. package/packages/config-eslint/node_modules/minimatch/dist/esm/ast.js +0 -842
  611. package/packages/config-eslint/node_modules/minimatch/dist/esm/ast.js.map +0 -1
  612. package/packages/config-eslint/node_modules/minimatch/dist/esm/brace-expressions.d.ts +0 -8
  613. package/packages/config-eslint/node_modules/minimatch/dist/esm/brace-expressions.d.ts.map +0 -1
  614. package/packages/config-eslint/node_modules/minimatch/dist/esm/brace-expressions.js +0 -146
  615. package/packages/config-eslint/node_modules/minimatch/dist/esm/brace-expressions.js.map +0 -1
  616. package/packages/config-eslint/node_modules/minimatch/dist/esm/escape.d.ts +0 -15
  617. package/packages/config-eslint/node_modules/minimatch/dist/esm/escape.d.ts.map +0 -1
  618. package/packages/config-eslint/node_modules/minimatch/dist/esm/escape.js +0 -26
  619. package/packages/config-eslint/node_modules/minimatch/dist/esm/escape.js.map +0 -1
  620. package/packages/config-eslint/node_modules/minimatch/dist/esm/index.d.ts +0 -174
  621. package/packages/config-eslint/node_modules/minimatch/dist/esm/index.d.ts.map +0 -1
  622. package/packages/config-eslint/node_modules/minimatch/dist/esm/index.js +0 -1108
  623. package/packages/config-eslint/node_modules/minimatch/dist/esm/index.js.map +0 -1
  624. package/packages/config-eslint/node_modules/minimatch/dist/esm/package.json +0 -3
  625. package/packages/config-eslint/node_modules/minimatch/dist/esm/unescape.d.ts +0 -22
  626. package/packages/config-eslint/node_modules/minimatch/dist/esm/unescape.d.ts.map +0 -1
  627. package/packages/config-eslint/node_modules/minimatch/dist/esm/unescape.js +0 -34
  628. package/packages/config-eslint/node_modules/minimatch/dist/esm/unescape.js.map +0 -1
  629. package/packages/config-eslint/node_modules/minimatch/package.json +0 -67
@@ -1,1364 +0,0 @@
1
- /**
2
- * @fileoverview Main class using flat config
3
- * @author Nicholas C. Zakas
4
- */
5
-
6
- "use strict";
7
-
8
- //------------------------------------------------------------------------------
9
- // Requirements
10
- //------------------------------------------------------------------------------
11
-
12
- const { existsSync } = require("node:fs");
13
- const fs = require("node:fs/promises");
14
- const os = require("node:os");
15
- const path = require("node:path");
16
- const { pathToFileURL } = require("node:url");
17
- const { SHARE_ENV, Worker } = require("node:worker_threads");
18
- const { version } = require("../../package.json");
19
- const { defaultConfig } = require("../config/default-config");
20
- const timing = require("../linter/timing");
21
-
22
- const {
23
- createDebug,
24
-
25
- findFiles,
26
- getCacheFile,
27
-
28
- isNonEmptyString,
29
- isArrayOfNonEmptyString,
30
-
31
- createIgnoreResult,
32
- isErrorMessage,
33
- getPlaceholderPath,
34
-
35
- processOptions,
36
- loadOptionsFromModule,
37
-
38
- getFixerForFixTypes,
39
- verifyText,
40
- lintFile,
41
- createLinter,
42
- createLintResultCache,
43
- createDefaultConfigs,
44
- createConfigLoader,
45
- } = require("./eslint-helpers");
46
- const { Retrier } = require("@humanwhocodes/retry");
47
- const { ConfigLoader } = require("../config/config-loader");
48
- const { WarningService } = require("../services/warning-service");
49
- const { Config } = require("../config/config.js");
50
- const {
51
- getShorthandName,
52
- getNamespaceFromTerm,
53
- normalizePackageName,
54
- } = require("../shared/naming.js");
55
- const { resolve } = require("../shared/relative-module-resolver.js");
56
-
57
- //------------------------------------------------------------------------------
58
- // Typedefs
59
- //------------------------------------------------------------------------------
60
-
61
- // For VSCode IntelliSense
62
- /**
63
- * @import { Config as CalculatedConfig } from "../config/config.js";
64
- * @import { FlatConfigArray } from "../config/flat-config-array.js";
65
- * @import { RuleDefinition, RulesMeta } from "@eslint/core";
66
- * @import { WorkerLintResults } from "./worker.js";
67
- */
68
-
69
- /** @typedef {import("../types").Linter.Config} Config */
70
- /** @typedef {import("../types").ESLint.DeprecatedRuleUse} DeprecatedRuleInfo */
71
- /** @typedef {import("../types").ESLint.LintResult} LintResult */
72
- /** @typedef {import("../types").ESLint.Plugin} Plugin */
73
- /** @typedef {import("../types").ESLint.ResultsMeta} ResultsMeta */
74
-
75
- /**
76
- * The options with which to configure the ESLint instance.
77
- * @typedef {Object} ESLintOptions
78
- * @property {boolean} [allowInlineConfig] Enable or disable inline configuration comments.
79
- * @property {Config|Array<Config>} [baseConfig] Base config, extended by all configs used with this instance
80
- * @property {boolean} [cache] Enable result caching.
81
- * @property {string} [cacheLocation] The cache file to use instead of .eslintcache.
82
- * @property {"metadata" | "content"} [cacheStrategy] The strategy used to detect changed files.
83
- * @property {number | "auto" | "off"} [concurrency] Maximum number of linting threads, "auto" to choose automatically, "off" for no multithreading.
84
- * @property {string} [cwd] The value to use for the current working directory.
85
- * @property {boolean} [errorOnUnmatchedPattern] If `false` then `ESLint#lintFiles()` doesn't throw even if no target files found. Defaults to `true`.
86
- * @property {boolean|Function} [fix] Execute in autofix mode. If a function, should return a boolean.
87
- * @property {string[]} [fixTypes] Array of rule types to apply fixes for.
88
- * @property {string[]} [flags] Array of feature flags to enable.
89
- * @property {boolean} [globInputPaths] Set to false to skip glob resolution of input file paths to lint (default: true). If false, each input file paths is assumed to be a non-glob path to an existing file.
90
- * @property {boolean} [ignore] False disables all ignore patterns except for the default ones.
91
- * @property {string[]} [ignorePatterns] Ignore file patterns to use in addition to config ignores. These patterns are relative to `cwd`.
92
- * @property {Config|Array<Config>} [overrideConfig] Override config, overrides all configs used with this instance
93
- * @property {boolean|string} [overrideConfigFile] Searches for default config file when falsy;
94
- * doesn't do any config file lookup when `true`; considered to be a config filename
95
- * when a string.
96
- * @property {boolean} [passOnNoPatterns=false] When set to true, missing patterns cause
97
- * the linting operation to short circuit and not report any failures.
98
- * @property {Record<string,Plugin>} [plugins] An array of plugin implementations.
99
- * @property {boolean} [stats] True enables added statistics on lint results.
100
- * @property {boolean} [warnIgnored] Show warnings when the file list includes ignored files
101
- */
102
-
103
- //------------------------------------------------------------------------------
104
- // Helpers
105
- //------------------------------------------------------------------------------
106
-
107
- const hrtimeBigint = process.hrtime.bigint;
108
-
109
- const debug = createDebug("eslint:eslint");
110
- const privateMembers = new WeakMap();
111
- const removedFormatters = new Set([
112
- "checkstyle",
113
- "codeframe",
114
- "compact",
115
- "jslint-xml",
116
- "junit",
117
- "table",
118
- "tap",
119
- "unix",
120
- "visualstudio",
121
- ]);
122
- const fileRetryCodes = new Set(["ENFILE", "EMFILE"]);
123
-
124
- /**
125
- * Create rulesMeta object.
126
- * @param {Map<string, RuleDefinition>} rules a map of rules from which to generate the object.
127
- * @returns {Record<string, RulesMeta>} metadata for all enabled rules.
128
- */
129
- function createRulesMeta(rules) {
130
- return Array.from(rules).reduce((retVal, [id, rule]) => {
131
- retVal[id] = rule.meta;
132
- return retVal;
133
- }, {});
134
- }
135
-
136
- /** @type {WeakMap<CalculatedConfig, DeprecatedRuleInfo[]>} */
137
- const usedDeprecatedRulesCache = new WeakMap();
138
-
139
- /**
140
- * Create used deprecated rule list.
141
- * @param {ESLint} eslint The ESLint instance.
142
- * @param {string} maybeFilePath The absolute path to a lint target file or `"<text>"`.
143
- * @returns {DeprecatedRuleInfo[]} The used deprecated rule list.
144
- */
145
- function getOrFindUsedDeprecatedRules(eslint, maybeFilePath) {
146
- const {
147
- options: { cwd },
148
- configLoader,
149
- } = privateMembers.get(eslint);
150
- const filePath = path.isAbsolute(maybeFilePath)
151
- ? maybeFilePath
152
- : getPlaceholderPath(cwd);
153
- const configs = configLoader.getCachedConfigArrayForFile(filePath);
154
- const config = configs.getConfig(filePath);
155
-
156
- // Most files use the same config, so cache it.
157
- if (config && !usedDeprecatedRulesCache.has(config)) {
158
- const retv = [];
159
-
160
- if (config.rules) {
161
- for (const [ruleId, ruleConf] of Object.entries(config.rules)) {
162
- if (Config.getRuleNumericSeverity(ruleConf) === 0) {
163
- continue;
164
- }
165
- const rule = config.getRuleDefinition(ruleId);
166
- const meta = rule && rule.meta;
167
-
168
- if (meta && meta.deprecated) {
169
- const usesNewFormat = typeof meta.deprecated === "object";
170
-
171
- retv.push({
172
- ruleId,
173
- replacedBy: usesNewFormat
174
- ? (meta.deprecated.replacedBy?.map(
175
- replacement =>
176
- `${replacement.plugin?.name !== void 0 ? `${getShorthandName(replacement.plugin.name, "eslint-plugin")}/` : ""}${replacement.rule?.name ?? ""}`,
177
- ) ?? [])
178
- : meta.replacedBy || [],
179
- info: usesNewFormat ? meta.deprecated : void 0,
180
- });
181
- }
182
- }
183
- }
184
-
185
- usedDeprecatedRulesCache.set(config, Object.freeze(retv));
186
- }
187
-
188
- return config ? usedDeprecatedRulesCache.get(config) : Object.freeze([]);
189
- }
190
-
191
- /**
192
- * Processes the linting results generated by a CLIEngine linting report to
193
- * match the ESLint class's API.
194
- * @param {ESLint} eslint The ESLint instance.
195
- * @param {LintResult[]} results The linting results to process.
196
- * @returns {LintResult[]} The processed linting results.
197
- */
198
- function processLintReport(eslint, results) {
199
- const descriptor = {
200
- configurable: true,
201
- enumerable: true,
202
- get() {
203
- return getOrFindUsedDeprecatedRules(eslint, this.filePath);
204
- },
205
- };
206
-
207
- for (const result of results) {
208
- Object.defineProperty(result, "usedDeprecatedRules", descriptor);
209
- }
210
-
211
- return results;
212
- }
213
-
214
- /**
215
- * An Array.prototype.sort() compatible compare function to order results by their file path.
216
- * @param {LintResult} a The first lint result.
217
- * @param {LintResult} b The second lint result.
218
- * @returns {number} An integer representing the order in which the two results should occur.
219
- */
220
- function compareResultsByFilePath(a, b) {
221
- if (a.filePath < b.filePath) {
222
- return -1;
223
- }
224
-
225
- if (a.filePath > b.filePath) {
226
- return 1;
227
- }
228
-
229
- return 0;
230
- }
231
-
232
- /**
233
- * Determines which config file to use. This is determined by seeing if an
234
- * override config file was passed, and if so, using it; otherwise, as long
235
- * as override config file is not explicitly set to `false`, it will search
236
- * upwards from the cwd for a file named `eslint.config.js`.
237
- *
238
- * This function is used primarily by the `--inspect-config` option. For now,
239
- * we will maintain the existing behavior, which is to search up from the cwd.
240
- * @param {ESLintOptions} options The ESLint instance options.
241
- * @returns {Promise<{configFilePath:string|undefined;basePath:string}>} Location information for
242
- * the config file.
243
- */
244
- async function locateConfigFileToUse({ configFile, cwd }) {
245
- const configLoader = new ConfigLoader({
246
- cwd,
247
- configFile,
248
- });
249
-
250
- const configFilePath = await configLoader.findConfigFileForPath(
251
- path.join(cwd, "__placeholder__.js"),
252
- );
253
-
254
- if (!configFilePath) {
255
- throw new Error("No ESLint configuration file was found.");
256
- }
257
-
258
- return {
259
- configFilePath,
260
- basePath: configFile ? cwd : path.dirname(configFilePath),
261
- };
262
- }
263
-
264
- /**
265
- * Creates an error to be thrown when an array of results passed to `getRulesMetaForResults` was not created by the current engine.
266
- * @param {Error|undefined} cause The original error that led to this symptom error being thrown. Might not always be available.
267
- * @returns {TypeError} An error object.
268
- */
269
- function createExtraneousResultsError(cause) {
270
- return new TypeError(
271
- "Results object was not created from this ESLint instance.",
272
- {
273
- cause,
274
- },
275
- );
276
- }
277
-
278
- /**
279
- * Maximum number of files assumed to be best handled by one worker thread.
280
- * This value is a heuristic estimation that can be adjusted if required.
281
- */
282
- const AUTO_FILES_PER_WORKER = 50;
283
-
284
- /**
285
- * Calculates the number of worker threads to run for "auto" concurrency depending on the number of
286
- * files that need to be processed.
287
- *
288
- * The number of worker threads is calculated as the number of files that need to be processed
289
- * (`processableFileCount`) divided by the number of files assumed to be best handled by one worker
290
- * thread (`AUTO_FILES_PER_WORKER`), rounded up to the next integer.
291
- * Two adjustments are made to this calculation: first, the number of workers is capped at half the
292
- * number of available CPU cores (`maxWorkers`); second, a value of 1 is converted to 0.
293
- * The following table shows the relationship between the number of files to be processed and the
294
- * number of workers:
295
- *
296
- * Files to be processed | Workers
297
- * -------------------------------------------------------------------|-----------------
298
- * 0 | 0
299
- * 1, 2, …, AUTO_FILES_PER_WORKER | 0 (there's no 1)
300
- * AUTO_FILES_PER_WORKER + 1, …, AUTO_FILES_PER_WORKER * 2 | 2
301
- * AUTO_FILES_PER_WORKER * 2 + 1, …, AUTO_FILES_PER_WORKER * 3 | 3
302
- * ⋯ | ⋯
303
- * AUTO_FILES_PER_WORKER * (𝑛 - 1) + 1, …, AUTO_FILES_PER_WORKER * 𝑛 | 𝑛
304
- * ⋯ | ⋯
305
- * AUTO_FILES_PER_WORKER * (maxWorkers - 1) + 1, … | maxWorkers
306
- *
307
- * The number of files to be processed should be determined by the calling function.
308
- * @param {number} processableFileCount The number of files that need to be processed.
309
- * @param {number} maxWorkers The maximum number of workers to run.
310
- * @returns {number} The number of worker threads to run.
311
- */
312
- function getWorkerCountFor(processableFileCount, maxWorkers) {
313
- let workerCount = Math.ceil(processableFileCount / AUTO_FILES_PER_WORKER);
314
- if (workerCount > maxWorkers) {
315
- workerCount = maxWorkers;
316
- }
317
- if (workerCount <= 1) {
318
- workerCount = 0;
319
- }
320
- return workerCount;
321
- }
322
-
323
- /**
324
- * Returns true if a file has no valid cached results or if it needs to be reprocessed because there are violations that may need fixing.
325
- * This function will access the filesystem.
326
- * @param {LintResultCache} lintResultCache The lint result cache.
327
- * @param {boolean} fix The fix option.
328
- * @param {string} filePath The file for which to retrieve lint results.
329
- * @param {Config} config The config of the file.
330
- * @returns {boolean} True if the file needs to be reprocessed.
331
- */
332
- function needsReprocessing(lintResultCache, fix, filePath, config) {
333
- const results = lintResultCache.getValidCachedLintResults(filePath, config);
334
-
335
- // This reflects the reprocessing logic of the `lintFile` helper function.
336
- return !results || (fix && results.messages && results.messages.length > 0);
337
- }
338
-
339
- /**
340
- * Calculates the number of worker threads to run for "auto" concurrency.
341
- *
342
- * The number of worker threads depends on the number files that need to be processed.
343
- * Typically, this includes all non-ignored files.
344
- * In a cached run with "metadata" strategy, files with a valid cached result aren't counted.
345
- * @param {ESLint} eslint ESLint instance.
346
- * @param {string[]} filePaths File paths to lint.
347
- * @param {number} maxWorkers The maximum number of workers to run.
348
- * @returns {number} The number of worker threads to run for "auto" concurrency.
349
- */
350
- function calculateAutoWorkerCount(eslint, filePaths, maxWorkers) {
351
- const startTime = hrtimeBigint();
352
- const {
353
- configLoader,
354
- lintResultCache,
355
- options: { cacheStrategy, fix },
356
- } = privateMembers.get(eslint);
357
- /** True if cache is not used or if strategy is "content". */
358
- const countAllMatched = !lintResultCache || cacheStrategy === "content";
359
-
360
- let processableFileCount = 0;
361
- let remainingFiles = filePaths.length;
362
-
363
- /** The number of workers if none of the remaining files were to be counted. */
364
- let lowWorkerCount = 0;
365
-
366
- /*
367
- * Rather than counting all files to be processed in advance, we stop iterating as soon as we reach
368
- * a point where adding more files doesn't change the number of workers anymore.
369
- */
370
- for (const filePath of filePaths) {
371
- /** The number of workers if all of the remaining files were to be counted. */
372
- const highWorkerCount = getWorkerCountFor(
373
- processableFileCount + remainingFiles,
374
- maxWorkers,
375
- );
376
- if (lowWorkerCount >= highWorkerCount) {
377
- // The highest possible number of workers has been reached, so stop counting.
378
- break;
379
- }
380
- remainingFiles--;
381
- const configs = configLoader.getCachedConfigArrayForFile(filePath);
382
- const config = configs.getConfig(filePath);
383
- if (!config) {
384
- // file is ignored
385
- continue;
386
- }
387
- if (
388
- countAllMatched ||
389
- needsReprocessing(lintResultCache, fix, filePath, config)
390
- ) {
391
- processableFileCount++;
392
- lowWorkerCount = getWorkerCountFor(
393
- processableFileCount,
394
- maxWorkers,
395
- );
396
- }
397
- }
398
- debug(
399
- "%d file(s) to process counted in %t",
400
- processableFileCount,
401
- hrtimeBigint() - startTime,
402
- );
403
- return lowWorkerCount;
404
- }
405
-
406
- /**
407
- * Calculates the number of workers to run based on the concurrency setting and the number of files to lint.
408
- * @param {ESLint} eslint The ESLint instance.
409
- * @param {string[]} filePaths File paths to lint.
410
- * @param {{ availableParallelism: () => number }} [os] Node.js `os` module, or a mock for testing.
411
- * @returns {number} The effective number of worker threads to be started. A value of zero disables multithread linting.
412
- */
413
- function calculateWorkerCount(
414
- eslint,
415
- filePaths,
416
- { availableParallelism } = os,
417
- ) {
418
- const { concurrency } = privateMembers.get(eslint).options;
419
- switch (concurrency) {
420
- case "off":
421
- return 0;
422
- case "auto": {
423
- const maxWorkers = availableParallelism() >> 1;
424
- return calculateAutoWorkerCount(eslint, filePaths, maxWorkers);
425
- }
426
- default: {
427
- const workerCount = Math.min(concurrency, filePaths.length);
428
- return workerCount > 1 ? workerCount : 0;
429
- }
430
- }
431
- }
432
-
433
- // Used internally. Do not expose.
434
- const disableCloneabilityCheck = Symbol(
435
- "Do not check for uncloneable options.",
436
- );
437
-
438
- /**
439
- * The smallest net linting ratio that doesn't trigger a poor concurrency warning.
440
- * The net linting ratio is defined as the net linting duration divided by the thread's total runtime,
441
- * where the net linting duration is the total linting time minus the time spent on I/O-intensive operations:
442
- * **Net Linting Ratio** = (**Linting Time** – **I/O Time**) / **Thread Runtime**.
443
- * - **Linting Time**: Total time spent linting files
444
- * - **I/O Time**: Portion of linting time spent loading configs and reading files
445
- * - **Thread Runtime**: End-to-end execution time of the thread
446
- *
447
- * This value is a heuristic estimation that can be adjusted if required.
448
- */
449
- const LOW_NET_LINTING_RATIO = 0.7;
450
-
451
- /**
452
- * Runs worker threads to lint files.
453
- * @param {string[]} filePaths File paths to lint.
454
- * @param {number} workerCount The number of worker threads to run.
455
- * @param {ESLintOptions | string} eslintOptionsOrURL The unprocessed ESLint options or the URL of the options module.
456
- * @param {() => void} warnOnLowNetLintingRatio A function to call if the net linting ratio is low.
457
- * @returns {Promise<LintResult[]>} Lint results.
458
- */
459
- async function runWorkers(
460
- filePaths,
461
- workerCount,
462
- eslintOptionsOrURL,
463
- warnOnLowNetLintingRatio,
464
- ) {
465
- const fileCount = filePaths.length;
466
- const results = Array(fileCount);
467
- const workerURL = pathToFileURL(path.join(__dirname, "./worker.js"));
468
- const filePathIndexArray = new Uint32Array(
469
- new SharedArrayBuffer(Uint32Array.BYTES_PER_ELEMENT),
470
- );
471
- const abortController = new AbortController();
472
- const abortSignal = abortController.signal;
473
- const workerOptions = {
474
- env: SHARE_ENV,
475
- workerData: {
476
- eslintOptionsOrURL,
477
- filePathIndexArray,
478
- filePaths,
479
- },
480
- };
481
-
482
- let worstNetLintingRatio = 1;
483
-
484
- /**
485
- * A promise executor function that starts a worker thread on each invocation.
486
- * @param {() => void} resolve_ Called when the worker thread terminates successfully.
487
- * @param {(error: Error) => void} reject Called when the worker thread terminates with an error.
488
- * @returns {void}
489
- */
490
- function workerExecutor(resolve_, reject) {
491
- const workerStartTime = hrtimeBigint();
492
- const worker = new Worker(workerURL, workerOptions);
493
- worker.once(
494
- "message",
495
- (/** @type {WorkerLintResults} */ indexedResults) => {
496
- const workerDuration = hrtimeBigint() - workerStartTime;
497
-
498
- // The net linting ratio provides an approximate measure of worker thread efficiency, defined as the net linting duration divided by the thread's total runtime.
499
- const netLintingRatio =
500
- Number(indexedResults.netLintingDuration) /
501
- Number(workerDuration);
502
-
503
- worstNetLintingRatio = Math.min(
504
- worstNetLintingRatio,
505
- netLintingRatio,
506
- );
507
-
508
- if (timing.enabled && indexedResults.timings) {
509
- timing.mergeData(indexedResults.timings);
510
- }
511
-
512
- for (const result of indexedResults) {
513
- const { index } = result;
514
- delete result.index;
515
- results[index] = result;
516
- }
517
- resolve_();
518
- },
519
- );
520
- worker.once("error", error => {
521
- abortController.abort(error);
522
- reject(error);
523
- });
524
- abortSignal.addEventListener("abort", () => worker.terminate());
525
- }
526
-
527
- const promises = Array(workerCount);
528
- for (let index = 0; index < workerCount; ++index) {
529
- promises[index] = new Promise(workerExecutor);
530
- }
531
-
532
- try {
533
- await Promise.all(promises);
534
- } catch (error) {
535
- /*
536
- * If any worker fails, suppress timing display in the main thread
537
- * to avoid printing partial or misleading timing output.
538
- */
539
- timing.disableDisplay();
540
- throw error;
541
- }
542
-
543
- if (worstNetLintingRatio < LOW_NET_LINTING_RATIO) {
544
- warnOnLowNetLintingRatio();
545
- }
546
-
547
- return results;
548
- }
549
-
550
- /**
551
- * Lint files in multithread mode.
552
- * @param {ESLint} eslint ESLint instance.
553
- * @param {string[]} filePaths File paths to lint.
554
- * @param {number} workerCount The number of worker threads to run.
555
- * @param {ESLintOptions | string} eslintOptionsOrURL The unprocessed ESLint options or the URL of the options module.
556
- * @param {() => void} warnOnLowNetLintingRatio A function to call if the net linting ratio is low.
557
- * @returns {Promise<LintResult[]>} Lint results.
558
- */
559
- async function lintFilesWithMultithreading(
560
- eslint,
561
- filePaths,
562
- workerCount,
563
- eslintOptionsOrURL,
564
- warnOnLowNetLintingRatio,
565
- ) {
566
- const { configLoader, lintResultCache } = privateMembers.get(eslint);
567
-
568
- const results = await runWorkers(
569
- filePaths,
570
- workerCount,
571
- eslintOptionsOrURL,
572
- warnOnLowNetLintingRatio,
573
- );
574
- // Persist the cache to disk.
575
- if (lintResultCache) {
576
- results.forEach((result, index) => {
577
- if (result) {
578
- const filePath = filePaths[index];
579
- const configs =
580
- configLoader.getCachedConfigArrayForFile(filePath);
581
- const config = configs.getConfig(filePath);
582
-
583
- if (config) {
584
- /*
585
- * Store the lint result in the LintResultCache.
586
- * NOTE: The LintResultCache will remove the file source and any
587
- * other properties that are difficult to serialize, and will
588
- * hydrate those properties back in on future lint runs.
589
- */
590
- lintResultCache.setCachedLintResults(
591
- filePath,
592
- config,
593
- result,
594
- );
595
- }
596
- }
597
- });
598
- }
599
- return results;
600
- }
601
-
602
- /**
603
- * Lint files in single-thread mode.
604
- * @param {ESLint} eslint ESLint instance.
605
- * @param {string[]} filePaths File paths to lint.
606
- * @returns {Promise<LintResult[]>} Lint results.
607
- */
608
- async function lintFilesWithoutMultithreading(eslint, filePaths) {
609
- const {
610
- configLoader,
611
- linter,
612
- lintResultCache,
613
- options: eslintOptions,
614
- } = privateMembers.get(eslint);
615
-
616
- const controller = new AbortController();
617
- const retrier = new Retrier(error => fileRetryCodes.has(error.code), {
618
- concurrency: 100,
619
- });
620
-
621
- /*
622
- * Because we need to process multiple files, including reading from disk,
623
- * it is most efficient to start by reading each file via promises so that
624
- * they can be done in parallel. Then, we can lint the returned text. This
625
- * ensures we are waiting the minimum amount of time in between lints.
626
- */
627
- const results = await Promise.all(
628
- filePaths.map(async filePath => {
629
- const configs = configLoader.getCachedConfigArrayForFile(filePath);
630
- const config = configs.getConfig(filePath);
631
-
632
- const result = await lintFile(
633
- filePath,
634
- configs,
635
- eslintOptions,
636
- linter,
637
- lintResultCache,
638
- null,
639
- retrier,
640
- controller,
641
- );
642
-
643
- if (config) {
644
- /*
645
- * Store the lint result in the LintResultCache.
646
- * NOTE: The LintResultCache will remove the file source and any
647
- * other properties that are difficult to serialize, and will
648
- * hydrate those properties back in on future lint runs.
649
- */
650
- lintResultCache?.setCachedLintResults(filePath, config, result);
651
- }
652
-
653
- return result;
654
- }),
655
- );
656
- return results;
657
- }
658
-
659
- /**
660
- * Throws an error if the given options are not cloneable.
661
- * @param {ESLintOptions} options The options to check.
662
- * @returns {void}
663
- * @throws {TypeError} If the options are not cloneable.
664
- */
665
- function validateOptionCloneability(options) {
666
- try {
667
- structuredClone(options);
668
- return;
669
- } catch {
670
- // continue
671
- }
672
- const uncloneableOptionKeys = Object.keys(options)
673
- .filter(key => {
674
- try {
675
- structuredClone(options[key]);
676
- } catch {
677
- return true;
678
- }
679
- return false;
680
- })
681
- .sort();
682
- const error = new TypeError(
683
- `The ${uncloneableOptionKeys.length === 1 ? "option" : "options"} ${new Intl.ListFormat("en-US").format(uncloneableOptionKeys.map(key => `"${key}"`))} cannot be cloned. When concurrency is enabled, all options must be cloneable values (JSON values). Remove uncloneable options or use an options module.`,
684
- );
685
- error.code = "ESLINT_UNCLONEABLE_OPTIONS";
686
- throw error;
687
- }
688
-
689
- //-----------------------------------------------------------------------------
690
- // Main API
691
- //-----------------------------------------------------------------------------
692
-
693
- /**
694
- * Primary Node.js API for ESLint.
695
- */
696
- class ESLint {
697
- /**
698
- * The type of configuration used by this class.
699
- * @type {string}
700
- */
701
- static configType = "flat";
702
-
703
- /**
704
- * The loader to use for finding config files.
705
- * @type {ConfigLoader}
706
- */
707
- #configLoader;
708
-
709
- /**
710
- * The unprocessed options or the URL of the options module. Only set when concurrency is enabled.
711
- * @type {ESLintOptions | string | undefined}
712
- */
713
- #optionsOrURL;
714
-
715
- /**
716
- * Creates a new instance of the main ESLint API.
717
- * @param {ESLintOptions} options The options for this instance.
718
- */
719
- constructor(options = {}) {
720
- const processedOptions = processOptions(options);
721
- if (
722
- !options[disableCloneabilityCheck] &&
723
- processedOptions.concurrency !== "off"
724
- ) {
725
- validateOptionCloneability(options);
726
-
727
- // Save the unprocessed options in an instance field to pass to worker threads in `lintFiles()`.
728
- this.#optionsOrURL = options;
729
- }
730
- const warningService = new WarningService();
731
- const linter = createLinter(processedOptions, warningService);
732
-
733
- const cacheFilePath = getCacheFile(
734
- processedOptions.cacheLocation,
735
- processedOptions.cwd,
736
- );
737
-
738
- const lintResultCache = createLintResultCache(
739
- processedOptions,
740
- cacheFilePath,
741
- );
742
- const defaultConfigs = createDefaultConfigs(options.plugins);
743
-
744
- this.#configLoader = createConfigLoader(
745
- processedOptions,
746
- defaultConfigs,
747
- linter,
748
- warningService,
749
- );
750
-
751
- debug(`Using config loader ${this.#configLoader.constructor.name}`);
752
-
753
- privateMembers.set(this, {
754
- options: processedOptions,
755
- linter,
756
- cacheFilePath,
757
- lintResultCache,
758
- defaultConfigs,
759
- configs: null,
760
- configLoader: this.#configLoader,
761
- warningService,
762
- });
763
-
764
- // Check for the .eslintignore file, and warn if it's present.
765
- if (existsSync(path.resolve(processedOptions.cwd, ".eslintignore"))) {
766
- warningService.emitESLintIgnoreWarning();
767
- }
768
- }
769
-
770
- /**
771
- * The version text.
772
- * @type {string}
773
- */
774
- static get version() {
775
- return version;
776
- }
777
-
778
- /**
779
- * The default configuration that ESLint uses internally. This is provided for tooling that wants to calculate configurations using the same defaults as ESLint.
780
- * Keep in mind that the default configuration may change from version to version, so you shouldn't rely on any particular keys or values to be present.
781
- * @type {FlatConfigArray}
782
- */
783
- static get defaultConfig() {
784
- return defaultConfig;
785
- }
786
-
787
- /**
788
- * Outputs fixes from the given results to files.
789
- * @param {LintResult[]} results The lint results.
790
- * @returns {Promise<void>} Returns a promise that is used to track side effects.
791
- */
792
- static async outputFixes(results) {
793
- if (!Array.isArray(results)) {
794
- throw new Error("'results' must be an array");
795
- }
796
-
797
- const retrier = new Retrier(error => fileRetryCodes.has(error.code), {
798
- concurrency: 100,
799
- });
800
-
801
- await Promise.all(
802
- results
803
- .filter(result => {
804
- if (typeof result !== "object" || result === null) {
805
- throw new Error("'results' must include only objects");
806
- }
807
- return (
808
- typeof result.output === "string" &&
809
- path.isAbsolute(result.filePath)
810
- );
811
- })
812
- .map(r =>
813
- retrier.retry(() => fs.writeFile(r.filePath, r.output)),
814
- ),
815
- );
816
- }
817
-
818
- /**
819
- * Returns results that only contains errors.
820
- * @param {LintResult[]} results The results to filter.
821
- * @returns {LintResult[]} The filtered results.
822
- */
823
- static getErrorResults(results) {
824
- const filtered = [];
825
-
826
- results.forEach(result => {
827
- const filteredMessages = result.messages.filter(isErrorMessage);
828
- const filteredSuppressedMessages =
829
- result.suppressedMessages.filter(isErrorMessage);
830
-
831
- if (filteredMessages.length > 0) {
832
- filtered.push({
833
- ...result,
834
- messages: filteredMessages,
835
- suppressedMessages: filteredSuppressedMessages,
836
- errorCount: filteredMessages.length,
837
- warningCount: 0,
838
- fixableErrorCount: result.fixableErrorCount,
839
- fixableWarningCount: 0,
840
- });
841
- }
842
- });
843
-
844
- return filtered;
845
- }
846
-
847
- /**
848
- * Creates a new ESLint instance using options loaded from a module.
849
- * @param {URL} optionsURL The URL of the options module.
850
- * @returns {ESLint} The new ESLint instance.
851
- */
852
- static async fromOptionsModule(optionsURL) {
853
- if (!(optionsURL instanceof URL)) {
854
- throw new TypeError("Argument must be a URL object");
855
- }
856
- const optionsURLString = optionsURL.href;
857
- const loadedOptions = await loadOptionsFromModule(optionsURLString);
858
- const options = { ...loadedOptions, [disableCloneabilityCheck]: true };
859
- const eslint = new ESLint(options);
860
-
861
- if (options.concurrency !== "off") {
862
- // Save the options module URL in an instance field to pass to worker threads in `lintFiles()`.
863
- eslint.#optionsOrURL = optionsURLString;
864
- }
865
- return eslint;
866
- }
867
-
868
- /**
869
- * Returns meta objects for each rule represented in the lint results.
870
- * @param {LintResult[]} results The results to fetch rules meta for.
871
- * @returns {Record<string, RulesMeta>} A mapping of ruleIds to rule meta objects.
872
- * @throws {TypeError} When the results object wasn't created from this ESLint instance.
873
- * @throws {TypeError} When a plugin or rule is missing.
874
- */
875
- getRulesMetaForResults(results) {
876
- // short-circuit simple case
877
- if (results.length === 0) {
878
- return {};
879
- }
880
-
881
- const resultRules = new Map();
882
- const {
883
- configLoader,
884
- options: { cwd },
885
- } = privateMembers.get(this);
886
-
887
- for (const result of results) {
888
- /*
889
- * Normalize filename for <text>.
890
- */
891
- const filePath =
892
- result.filePath === "<text>"
893
- ? getPlaceholderPath(cwd)
894
- : result.filePath;
895
- const allMessages = result.messages.concat(
896
- result.suppressedMessages,
897
- );
898
-
899
- for (const { ruleId } of allMessages) {
900
- if (!ruleId) {
901
- continue;
902
- }
903
-
904
- /*
905
- * All of the plugin and rule information is contained within the
906
- * calculated config for the given file.
907
- */
908
- let configs;
909
-
910
- try {
911
- configs =
912
- configLoader.getCachedConfigArrayForFile(filePath);
913
- } catch (err) {
914
- throw createExtraneousResultsError(err);
915
- }
916
-
917
- const config = configs.getConfig(filePath);
918
-
919
- if (!config) {
920
- throw createExtraneousResultsError();
921
- }
922
- const rule = config.getRuleDefinition(ruleId);
923
-
924
- // ignore unknown rules
925
- if (rule) {
926
- resultRules.set(ruleId, rule);
927
- }
928
- }
929
- }
930
-
931
- return createRulesMeta(resultRules);
932
- }
933
-
934
- /**
935
- * Indicates if the given feature flag is enabled for this instance.
936
- * @param {string} flag The feature flag to check.
937
- * @returns {boolean} `true` if the feature flag is enabled, `false` if not.
938
- */
939
- hasFlag(flag) {
940
- // note: Linter does validation of the flags
941
- return privateMembers.get(this).linter.hasFlag(flag);
942
- }
943
-
944
- /**
945
- * Executes the current configuration on an array of file and directory names.
946
- * @param {string|string[]} patterns An array of file and directory names.
947
- * @returns {Promise<LintResult[]>} The results of linting the file patterns given.
948
- */
949
- async lintFiles(patterns) {
950
- let normalizedPatterns = patterns;
951
- const {
952
- cacheFilePath,
953
- lintResultCache,
954
- options: eslintOptions,
955
- warningService,
956
- } = privateMembers.get(this);
957
-
958
- /*
959
- * Special cases:
960
- * 1. `patterns` is an empty string
961
- * 2. `patterns` is an empty array
962
- *
963
- * In both cases, we use the cwd as the directory to lint.
964
- */
965
- if (
966
- patterns === "" ||
967
- (Array.isArray(patterns) && patterns.length === 0)
968
- ) {
969
- /*
970
- * Special case: If `passOnNoPatterns` is true, then we just exit
971
- * without doing any work.
972
- */
973
- if (eslintOptions.passOnNoPatterns) {
974
- return [];
975
- }
976
-
977
- normalizedPatterns = ["."];
978
- } else {
979
- if (
980
- !isNonEmptyString(patterns) &&
981
- !isArrayOfNonEmptyString(patterns)
982
- ) {
983
- throw new Error(
984
- "'patterns' must be a non-empty string or an array of non-empty strings",
985
- );
986
- }
987
-
988
- if (typeof patterns === "string") {
989
- normalizedPatterns = [patterns];
990
- }
991
- }
992
-
993
- debug(`Using file patterns: ${normalizedPatterns}`);
994
-
995
- const { concurrency, cwd, globInputPaths, errorOnUnmatchedPattern } =
996
- eslintOptions;
997
-
998
- // Delete cache file; should this be done here?
999
- if (!lintResultCache && cacheFilePath) {
1000
- debug(`Deleting cache file at ${cacheFilePath}`);
1001
-
1002
- try {
1003
- if (existsSync(cacheFilePath)) {
1004
- await fs.unlink(cacheFilePath);
1005
- }
1006
- } catch (error) {
1007
- if (existsSync(cacheFilePath)) {
1008
- throw error;
1009
- }
1010
- }
1011
- }
1012
-
1013
- const startTime = hrtimeBigint();
1014
- const filePaths = await findFiles({
1015
- patterns: normalizedPatterns,
1016
- cwd,
1017
- globInputPaths,
1018
- configLoader: this.#configLoader,
1019
- errorOnUnmatchedPattern,
1020
- });
1021
- debug(
1022
- "%d file(s) found in %t",
1023
- filePaths.length,
1024
- hrtimeBigint() - startTime,
1025
- );
1026
-
1027
- /** @type {LintResult[]} */
1028
- let results;
1029
-
1030
- // The value of `module.exports.calculateWorkerCount` can be overridden in tests.
1031
- const workerCount = module.exports.calculateWorkerCount(
1032
- this,
1033
- filePaths,
1034
- );
1035
- if (workerCount) {
1036
- debug(`Linting using ${workerCount} worker thread(s).`);
1037
- let poorConcurrencyNotice;
1038
- if (workerCount <= 2) {
1039
- poorConcurrencyNotice = "disable concurrency";
1040
- } else {
1041
- if (concurrency === "auto") {
1042
- poorConcurrencyNotice =
1043
- "disable concurrency or use a numeric concurrency setting";
1044
- } else {
1045
- poorConcurrencyNotice = "reduce or disable concurrency";
1046
- }
1047
- }
1048
- results = await lintFilesWithMultithreading(
1049
- this,
1050
- filePaths,
1051
- workerCount,
1052
- this.#optionsOrURL,
1053
- () =>
1054
- warningService.emitPoorConcurrencyWarning(
1055
- poorConcurrencyNotice,
1056
- ),
1057
- );
1058
- } else {
1059
- debug(`Linting in single-thread mode.`);
1060
- results = await lintFilesWithoutMultithreading(this, filePaths);
1061
- }
1062
-
1063
- // Persist the cache to disk.
1064
- if (lintResultCache) {
1065
- lintResultCache.reconcile();
1066
- }
1067
-
1068
- const finalResults = results.filter(result => !!result);
1069
-
1070
- return processLintReport(this, finalResults);
1071
- }
1072
-
1073
- /**
1074
- * Executes the current configuration on text.
1075
- * @param {string} code A string of JavaScript code to lint.
1076
- * @param {Object} [options] The options.
1077
- * @param {string} [options.filePath] The path to the file of the source code.
1078
- * @param {boolean} [options.warnIgnored] When set to true, warn if given filePath is an ignored path.
1079
- * @returns {Promise<LintResult[]>} The results of linting the string of code given.
1080
- */
1081
- async lintText(code, options = {}) {
1082
- // Parameter validation
1083
-
1084
- if (typeof code !== "string") {
1085
- throw new Error("'code' must be a string");
1086
- }
1087
-
1088
- if (typeof options !== "object") {
1089
- throw new Error("'options' must be an object, null, or undefined");
1090
- }
1091
-
1092
- // Options validation
1093
-
1094
- const { filePath, warnIgnored, ...unknownOptions } = options || {};
1095
-
1096
- const unknownOptionKeys = Object.keys(unknownOptions);
1097
-
1098
- if (unknownOptionKeys.length > 0) {
1099
- throw new Error(
1100
- `'options' must not include the unknown option(s): ${unknownOptionKeys.join(", ")}`,
1101
- );
1102
- }
1103
-
1104
- if (filePath !== void 0 && !isNonEmptyString(filePath)) {
1105
- throw new Error(
1106
- "'options.filePath' must be a non-empty string or undefined",
1107
- );
1108
- }
1109
-
1110
- if (
1111
- typeof warnIgnored !== "boolean" &&
1112
- typeof warnIgnored !== "undefined"
1113
- ) {
1114
- throw new Error(
1115
- "'options.warnIgnored' must be a boolean or undefined",
1116
- );
1117
- }
1118
-
1119
- // Now we can get down to linting
1120
-
1121
- const { linter, options: eslintOptions } = privateMembers.get(this);
1122
- const {
1123
- allowInlineConfig,
1124
- cwd,
1125
- fix,
1126
- fixTypes,
1127
- warnIgnored: constructorWarnIgnored,
1128
- ruleFilter,
1129
- stats,
1130
- } = eslintOptions;
1131
- const results = [];
1132
- const startTime = hrtimeBigint();
1133
- const fixTypesSet = fixTypes ? new Set(fixTypes) : null;
1134
- const resolvedFilename = path.resolve(
1135
- cwd,
1136
- filePath || "__placeholder__.js",
1137
- );
1138
- const configs =
1139
- await this.#configLoader.loadConfigArrayForFile(resolvedFilename);
1140
- const configStatus =
1141
- configs?.getConfigStatus(resolvedFilename) ?? "unconfigured";
1142
-
1143
- // Clear the last used config arrays.
1144
- if (resolvedFilename && configStatus !== "matched") {
1145
- const shouldWarnIgnored =
1146
- typeof warnIgnored === "boolean"
1147
- ? warnIgnored
1148
- : constructorWarnIgnored;
1149
-
1150
- if (shouldWarnIgnored) {
1151
- results.push(
1152
- createIgnoreResult(resolvedFilename, cwd, configStatus),
1153
- );
1154
- }
1155
- } else {
1156
- const config = configs.getConfig(resolvedFilename);
1157
- const fixer = getFixerForFixTypes(fix, fixTypesSet, config);
1158
-
1159
- // Do lint.
1160
- results.push(
1161
- verifyText({
1162
- text: code,
1163
- filePath: resolvedFilename.endsWith("__placeholder__.js")
1164
- ? "<text>"
1165
- : resolvedFilename,
1166
- configs,
1167
- cwd,
1168
- fix: fixer,
1169
- allowInlineConfig,
1170
- ruleFilter,
1171
- stats,
1172
- linter,
1173
- }),
1174
- );
1175
- }
1176
-
1177
- debug("Linting complete in %t", hrtimeBigint() - startTime);
1178
-
1179
- return processLintReport(this, results);
1180
- }
1181
-
1182
- /**
1183
- * Returns the formatter representing the given formatter name.
1184
- * @param {string} [name] The name of the formatter to load.
1185
- * The following values are allowed:
1186
- * - `undefined` ... Load `stylish` builtin formatter.
1187
- * - A builtin formatter name ... Load the builtin formatter.
1188
- * - A third-party formatter name:
1189
- * - `foo` → `eslint-formatter-foo`
1190
- * - `@foo` → `@foo/eslint-formatter`
1191
- * - `@foo/bar` → `@foo/eslint-formatter-bar`
1192
- * - A file path ... Load the file.
1193
- * @returns {Promise<Formatter>} A promise resolving to the formatter object.
1194
- * This promise will be rejected if the given formatter was not found or not
1195
- * a function.
1196
- */
1197
- async loadFormatter(name = "stylish") {
1198
- if (typeof name !== "string") {
1199
- throw new Error("'name' must be a string");
1200
- }
1201
-
1202
- // replace \ with / for Windows compatibility
1203
- const normalizedFormatName = name.replace(/\\/gu, "/");
1204
- const namespace = getNamespaceFromTerm(normalizedFormatName);
1205
-
1206
- // grab our options
1207
- const { cwd } = privateMembers.get(this).options;
1208
-
1209
- let formatterPath;
1210
- let isBuiltInFormatter = false;
1211
-
1212
- // if there's a slash, then it's a file (TODO: this check seems dubious for scoped npm packages)
1213
- if (!namespace && normalizedFormatName.includes("/")) {
1214
- formatterPath = path.resolve(cwd, normalizedFormatName);
1215
- } else {
1216
- try {
1217
- const npmFormat = normalizePackageName(
1218
- normalizedFormatName,
1219
- "eslint-formatter",
1220
- );
1221
-
1222
- // TODO: This is pretty dirty...would be nice to clean up at some point.
1223
- formatterPath = resolve(npmFormat, getPlaceholderPath(cwd));
1224
- } catch {
1225
- formatterPath = path.resolve(
1226
- __dirname,
1227
- "../",
1228
- "cli-engine",
1229
- "formatters",
1230
- `${normalizedFormatName}.js`,
1231
- );
1232
- isBuiltInFormatter = true;
1233
- }
1234
- }
1235
-
1236
- let formatter;
1237
-
1238
- try {
1239
- formatter = (await import(pathToFileURL(formatterPath))).default;
1240
- } catch (ex) {
1241
- // check for formatters that have been removed
1242
- if (isBuiltInFormatter && removedFormatters.has(name)) {
1243
- ex.message = `The ${name} formatter is no longer part of core ESLint. Install it manually with \`npm install -D eslint-formatter-${name}\``;
1244
- } else {
1245
- ex.message = `There was a problem loading formatter: ${formatterPath}\nError: ${ex.message}`;
1246
- }
1247
-
1248
- throw ex;
1249
- }
1250
-
1251
- if (typeof formatter !== "function") {
1252
- throw new TypeError(
1253
- `Formatter must be a function, but got a ${typeof formatter}.`,
1254
- );
1255
- }
1256
-
1257
- const eslint = this;
1258
-
1259
- return {
1260
- /**
1261
- * The main formatter method.
1262
- * @param {LintResult[]} results The lint results to format.
1263
- * @param {ResultsMeta} resultsMeta Warning count and max threshold.
1264
- * @returns {string} The formatted lint results.
1265
- */
1266
- format(results, resultsMeta) {
1267
- let rulesMeta = null;
1268
-
1269
- results.sort(compareResultsByFilePath);
1270
-
1271
- return formatter(results, {
1272
- ...resultsMeta,
1273
- cwd,
1274
- get rulesMeta() {
1275
- if (!rulesMeta) {
1276
- rulesMeta = eslint.getRulesMetaForResults(results);
1277
- }
1278
-
1279
- return rulesMeta;
1280
- },
1281
- });
1282
- },
1283
- };
1284
- }
1285
-
1286
- /**
1287
- * Returns a configuration object for the given file based on the CLI options.
1288
- * This is the same logic used by the ESLint CLI executable to determine
1289
- * configuration for each file it processes.
1290
- * @param {string} filePath The path of the file to retrieve a config object for.
1291
- * @returns {Promise<CalculatedConfig|undefined>} A configuration object for the file
1292
- * or `undefined` if there is no configuration data for the object.
1293
- */
1294
- async calculateConfigForFile(filePath) {
1295
- if (!isNonEmptyString(filePath)) {
1296
- throw new Error("'filePath' must be a non-empty string");
1297
- }
1298
- const options = privateMembers.get(this).options;
1299
- const absolutePath = path.resolve(options.cwd, filePath);
1300
- const configs =
1301
- await this.#configLoader.loadConfigArrayForFile(absolutePath);
1302
-
1303
- if (!configs) {
1304
- const error = new Error("Could not find config file.");
1305
-
1306
- error.messageTemplate = "config-file-missing";
1307
- throw error;
1308
- }
1309
-
1310
- return configs.getConfig(absolutePath);
1311
- }
1312
-
1313
- /**
1314
- * Finds the config file being used by this instance based on the options
1315
- * passed to the constructor.
1316
- * @param {string} [filePath] The path of the file to find the config file for.
1317
- * @returns {Promise<string|undefined>} The path to the config file being used or
1318
- * `undefined` if no config file is being used.
1319
- */
1320
- async findConfigFile(filePath) {
1321
- const options = privateMembers.get(this).options;
1322
-
1323
- /*
1324
- * Because the new config lookup scheme skips the current directory
1325
- * and looks into the parent directories, we need to use a placeholder
1326
- * directory to ensure the file in cwd is checked.
1327
- */
1328
- const fakeCwd = path.join(options.cwd, "__placeholder__");
1329
-
1330
- return this.#configLoader
1331
- .findConfigFileForPath(filePath ?? fakeCwd)
1332
- .catch(() => void 0);
1333
- }
1334
-
1335
- /**
1336
- * Checks if a given path is ignored by ESLint.
1337
- * @param {string} filePath The path of the file to check.
1338
- * @returns {Promise<boolean>} Whether or not the given path is ignored.
1339
- */
1340
- async isPathIgnored(filePath) {
1341
- const config = await this.calculateConfigForFile(filePath);
1342
-
1343
- return config === void 0;
1344
- }
1345
- }
1346
-
1347
- /**
1348
- * Returns whether flat config should be used.
1349
- * @returns {Promise<true>} Whether flat config should be used.
1350
- */
1351
- async function shouldUseFlatConfig() {
1352
- return true;
1353
- }
1354
-
1355
- //------------------------------------------------------------------------------
1356
- // Public Interface
1357
- //------------------------------------------------------------------------------
1358
-
1359
- module.exports = {
1360
- ESLint,
1361
- shouldUseFlatConfig,
1362
- locateConfigFileToUse,
1363
- calculateWorkerCount,
1364
- };