@alexlit/lint-kit 127.0.0 → 127.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 (592) hide show
  1. package/package.json +1 -1
  2. package/packages/config-commitlint/package.json +3 -3
  3. package/packages/config-eslint/package.json +6 -6
  4. package/packages/config-prettier/package.json +2 -2
  5. package/packages/config-stylelint/package.json +3 -3
  6. package/packages/config-stylelint/plugins/scss.js +1 -0
  7. package/scripts/up.sh +6 -2
  8. package/packages/config-eslint/node_modules/ajv/.tonic_example.js +0 -20
  9. package/packages/config-eslint/node_modules/ajv/LICENSE +0 -22
  10. package/packages/config-eslint/node_modules/ajv/README.md +0 -1497
  11. package/packages/config-eslint/node_modules/ajv/dist/ajv.bundle.js +0 -7189
  12. package/packages/config-eslint/node_modules/ajv/dist/ajv.min.js +0 -3
  13. package/packages/config-eslint/node_modules/ajv/dist/ajv.min.js.map +0 -1
  14. package/packages/config-eslint/node_modules/ajv/lib/ajv.d.ts +0 -397
  15. package/packages/config-eslint/node_modules/ajv/lib/ajv.js +0 -506
  16. package/packages/config-eslint/node_modules/ajv/lib/cache.js +0 -26
  17. package/packages/config-eslint/node_modules/ajv/lib/compile/async.js +0 -90
  18. package/packages/config-eslint/node_modules/ajv/lib/compile/equal.js +0 -5
  19. package/packages/config-eslint/node_modules/ajv/lib/compile/error_classes.js +0 -34
  20. package/packages/config-eslint/node_modules/ajv/lib/compile/formats.js +0 -142
  21. package/packages/config-eslint/node_modules/ajv/lib/compile/index.js +0 -387
  22. package/packages/config-eslint/node_modules/ajv/lib/compile/resolve.js +0 -270
  23. package/packages/config-eslint/node_modules/ajv/lib/compile/rules.js +0 -66
  24. package/packages/config-eslint/node_modules/ajv/lib/compile/schema_obj.js +0 -9
  25. package/packages/config-eslint/node_modules/ajv/lib/compile/ucs2length.js +0 -20
  26. package/packages/config-eslint/node_modules/ajv/lib/compile/util.js +0 -239
  27. package/packages/config-eslint/node_modules/ajv/lib/data.js +0 -49
  28. package/packages/config-eslint/node_modules/ajv/lib/definition_schema.js +0 -37
  29. package/packages/config-eslint/node_modules/ajv/lib/dot/_limit.jst +0 -113
  30. package/packages/config-eslint/node_modules/ajv/lib/dot/_limitItems.jst +0 -12
  31. package/packages/config-eslint/node_modules/ajv/lib/dot/_limitLength.jst +0 -12
  32. package/packages/config-eslint/node_modules/ajv/lib/dot/_limitProperties.jst +0 -12
  33. package/packages/config-eslint/node_modules/ajv/lib/dot/allOf.jst +0 -32
  34. package/packages/config-eslint/node_modules/ajv/lib/dot/anyOf.jst +0 -46
  35. package/packages/config-eslint/node_modules/ajv/lib/dot/coerce.def +0 -51
  36. package/packages/config-eslint/node_modules/ajv/lib/dot/comment.jst +0 -9
  37. package/packages/config-eslint/node_modules/ajv/lib/dot/const.jst +0 -11
  38. package/packages/config-eslint/node_modules/ajv/lib/dot/contains.jst +0 -55
  39. package/packages/config-eslint/node_modules/ajv/lib/dot/custom.jst +0 -191
  40. package/packages/config-eslint/node_modules/ajv/lib/dot/defaults.def +0 -47
  41. package/packages/config-eslint/node_modules/ajv/lib/dot/definitions.def +0 -203
  42. package/packages/config-eslint/node_modules/ajv/lib/dot/dependencies.jst +0 -79
  43. package/packages/config-eslint/node_modules/ajv/lib/dot/enum.jst +0 -30
  44. package/packages/config-eslint/node_modules/ajv/lib/dot/errors.def +0 -194
  45. package/packages/config-eslint/node_modules/ajv/lib/dot/format.jst +0 -106
  46. package/packages/config-eslint/node_modules/ajv/lib/dot/if.jst +0 -73
  47. package/packages/config-eslint/node_modules/ajv/lib/dot/items.jst +0 -98
  48. package/packages/config-eslint/node_modules/ajv/lib/dot/missing.def +0 -39
  49. package/packages/config-eslint/node_modules/ajv/lib/dot/multipleOf.jst +0 -22
  50. package/packages/config-eslint/node_modules/ajv/lib/dot/not.jst +0 -43
  51. package/packages/config-eslint/node_modules/ajv/lib/dot/oneOf.jst +0 -54
  52. package/packages/config-eslint/node_modules/ajv/lib/dot/pattern.jst +0 -14
  53. package/packages/config-eslint/node_modules/ajv/lib/dot/properties.jst +0 -245
  54. package/packages/config-eslint/node_modules/ajv/lib/dot/propertyNames.jst +0 -52
  55. package/packages/config-eslint/node_modules/ajv/lib/dot/ref.jst +0 -85
  56. package/packages/config-eslint/node_modules/ajv/lib/dot/required.jst +0 -108
  57. package/packages/config-eslint/node_modules/ajv/lib/dot/uniqueItems.jst +0 -62
  58. package/packages/config-eslint/node_modules/ajv/lib/dot/validate.jst +0 -276
  59. package/packages/config-eslint/node_modules/ajv/lib/dotjs/README.md +0 -3
  60. package/packages/config-eslint/node_modules/ajv/lib/dotjs/_limit.js +0 -163
  61. package/packages/config-eslint/node_modules/ajv/lib/dotjs/_limitItems.js +0 -80
  62. package/packages/config-eslint/node_modules/ajv/lib/dotjs/_limitLength.js +0 -85
  63. package/packages/config-eslint/node_modules/ajv/lib/dotjs/_limitProperties.js +0 -80
  64. package/packages/config-eslint/node_modules/ajv/lib/dotjs/allOf.js +0 -42
  65. package/packages/config-eslint/node_modules/ajv/lib/dotjs/anyOf.js +0 -73
  66. package/packages/config-eslint/node_modules/ajv/lib/dotjs/comment.js +0 -14
  67. package/packages/config-eslint/node_modules/ajv/lib/dotjs/const.js +0 -56
  68. package/packages/config-eslint/node_modules/ajv/lib/dotjs/contains.js +0 -81
  69. package/packages/config-eslint/node_modules/ajv/lib/dotjs/custom.js +0 -228
  70. package/packages/config-eslint/node_modules/ajv/lib/dotjs/dependencies.js +0 -168
  71. package/packages/config-eslint/node_modules/ajv/lib/dotjs/enum.js +0 -66
  72. package/packages/config-eslint/node_modules/ajv/lib/dotjs/format.js +0 -150
  73. package/packages/config-eslint/node_modules/ajv/lib/dotjs/if.js +0 -103
  74. package/packages/config-eslint/node_modules/ajv/lib/dotjs/index.js +0 -33
  75. package/packages/config-eslint/node_modules/ajv/lib/dotjs/items.js +0 -140
  76. package/packages/config-eslint/node_modules/ajv/lib/dotjs/multipleOf.js +0 -80
  77. package/packages/config-eslint/node_modules/ajv/lib/dotjs/not.js +0 -84
  78. package/packages/config-eslint/node_modules/ajv/lib/dotjs/oneOf.js +0 -73
  79. package/packages/config-eslint/node_modules/ajv/lib/dotjs/pattern.js +0 -75
  80. package/packages/config-eslint/node_modules/ajv/lib/dotjs/properties.js +0 -335
  81. package/packages/config-eslint/node_modules/ajv/lib/dotjs/propertyNames.js +0 -81
  82. package/packages/config-eslint/node_modules/ajv/lib/dotjs/ref.js +0 -124
  83. package/packages/config-eslint/node_modules/ajv/lib/dotjs/required.js +0 -270
  84. package/packages/config-eslint/node_modules/ajv/lib/dotjs/uniqueItems.js +0 -86
  85. package/packages/config-eslint/node_modules/ajv/lib/dotjs/validate.js +0 -482
  86. package/packages/config-eslint/node_modules/ajv/lib/keyword.js +0 -146
  87. package/packages/config-eslint/node_modules/ajv/lib/refs/data.json +0 -17
  88. package/packages/config-eslint/node_modules/ajv/lib/refs/json-schema-draft-04.json +0 -149
  89. package/packages/config-eslint/node_modules/ajv/lib/refs/json-schema-draft-06.json +0 -154
  90. package/packages/config-eslint/node_modules/ajv/lib/refs/json-schema-draft-07.json +0 -168
  91. package/packages/config-eslint/node_modules/ajv/lib/refs/json-schema-secure.json +0 -94
  92. package/packages/config-eslint/node_modules/ajv/package.json +0 -106
  93. package/packages/config-eslint/node_modules/ajv/scripts/.eslintrc.yml +0 -3
  94. package/packages/config-eslint/node_modules/ajv/scripts/bundle.js +0 -61
  95. package/packages/config-eslint/node_modules/ajv/scripts/compile-dots.js +0 -73
  96. package/packages/config-eslint/node_modules/ajv/scripts/info +0 -10
  97. package/packages/config-eslint/node_modules/ajv/scripts/prepare-tests +0 -12
  98. package/packages/config-eslint/node_modules/ajv/scripts/publish-built-version +0 -32
  99. package/packages/config-eslint/node_modules/ajv/scripts/travis-gh-pages +0 -23
  100. package/packages/config-eslint/node_modules/ansi-styles/index.d.ts +0 -345
  101. package/packages/config-eslint/node_modules/ansi-styles/index.js +0 -163
  102. package/packages/config-eslint/node_modules/ansi-styles/license +0 -9
  103. package/packages/config-eslint/node_modules/ansi-styles/package.json +0 -56
  104. package/packages/config-eslint/node_modules/ansi-styles/readme.md +0 -152
  105. package/packages/config-eslint/node_modules/chalk/index.d.ts +0 -415
  106. package/packages/config-eslint/node_modules/chalk/license +0 -9
  107. package/packages/config-eslint/node_modules/chalk/package.json +0 -68
  108. package/packages/config-eslint/node_modules/chalk/readme.md +0 -341
  109. package/packages/config-eslint/node_modules/chalk/source/index.js +0 -229
  110. package/packages/config-eslint/node_modules/chalk/source/templates.js +0 -134
  111. package/packages/config-eslint/node_modules/chalk/source/util.js +0 -39
  112. package/packages/config-eslint/node_modules/color-convert/CHANGELOG.md +0 -54
  113. package/packages/config-eslint/node_modules/color-convert/LICENSE +0 -21
  114. package/packages/config-eslint/node_modules/color-convert/README.md +0 -68
  115. package/packages/config-eslint/node_modules/color-convert/conversions.js +0 -839
  116. package/packages/config-eslint/node_modules/color-convert/index.js +0 -81
  117. package/packages/config-eslint/node_modules/color-convert/package.json +0 -48
  118. package/packages/config-eslint/node_modules/color-convert/route.js +0 -97
  119. package/packages/config-eslint/node_modules/color-name/LICENSE +0 -8
  120. package/packages/config-eslint/node_modules/color-name/README.md +0 -11
  121. package/packages/config-eslint/node_modules/color-name/index.js +0 -152
  122. package/packages/config-eslint/node_modules/color-name/package.json +0 -28
  123. package/packages/config-eslint/node_modules/eslint/LICENSE +0 -19
  124. package/packages/config-eslint/node_modules/eslint/README.md +0 -306
  125. package/packages/config-eslint/node_modules/eslint/bin/eslint.js +0 -174
  126. package/packages/config-eslint/node_modules/eslint/conf/default-cli-options.js +0 -32
  127. package/packages/config-eslint/node_modules/eslint/conf/ecma-version.js +0 -16
  128. package/packages/config-eslint/node_modules/eslint/conf/globals.js +0 -160
  129. package/packages/config-eslint/node_modules/eslint/conf/replacements.json +0 -22
  130. package/packages/config-eslint/node_modules/eslint/conf/rule-type-list.json +0 -30
  131. package/packages/config-eslint/node_modules/eslint/lib/api.js +0 -50
  132. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/cli-engine.js +0 -1089
  133. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/file-enumerator.js +0 -547
  134. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/formatters/formatters-meta.json +0 -18
  135. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/formatters/html.js +0 -351
  136. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/formatters/json-with-metadata.js +0 -16
  137. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/formatters/json.js +0 -13
  138. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/formatters/stylish.js +0 -101
  139. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/hash.js +0 -35
  140. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/index.js +0 -7
  141. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/lint-result-cache.js +0 -203
  142. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/load-rules.js +0 -46
  143. package/packages/config-eslint/node_modules/eslint/lib/cli.js +0 -552
  144. package/packages/config-eslint/node_modules/eslint/lib/config/default-config.js +0 -75
  145. package/packages/config-eslint/node_modules/eslint/lib/config/flat-config-array.js +0 -423
  146. package/packages/config-eslint/node_modules/eslint/lib/config/flat-config-helpers.js +0 -132
  147. package/packages/config-eslint/node_modules/eslint/lib/config/flat-config-schema.js +0 -576
  148. package/packages/config-eslint/node_modules/eslint/lib/config/rule-validator.js +0 -194
  149. package/packages/config-eslint/node_modules/eslint/lib/eslint/eslint-helpers.js +0 -975
  150. package/packages/config-eslint/node_modules/eslint/lib/eslint/eslint.js +0 -1307
  151. package/packages/config-eslint/node_modules/eslint/lib/eslint/index.js +0 -9
  152. package/packages/config-eslint/node_modules/eslint/lib/eslint/legacy-eslint.js +0 -742
  153. package/packages/config-eslint/node_modules/eslint/lib/languages/js/index.js +0 -252
  154. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/index.js +0 -7
  155. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/source-code.js +0 -1318
  156. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/backward-token-comment-cursor.js +0 -57
  157. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/backward-token-cursor.js +0 -58
  158. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/cursor.js +0 -76
  159. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/cursors.js +0 -92
  160. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/decorative-cursor.js +0 -39
  161. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/filter-cursor.js +0 -43
  162. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/forward-token-comment-cursor.js +0 -57
  163. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/forward-token-cursor.js +0 -63
  164. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/index.js +0 -627
  165. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/limit-cursor.js +0 -40
  166. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/padded-token-cursor.js +0 -38
  167. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/skip-cursor.js +0 -42
  168. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/utils.js +0 -107
  169. package/packages/config-eslint/node_modules/eslint/lib/languages/js/validate-language-options.js +0 -181
  170. package/packages/config-eslint/node_modules/eslint/lib/linter/apply-disable-directives.js +0 -513
  171. package/packages/config-eslint/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js +0 -851
  172. package/packages/config-eslint/node_modules/eslint/lib/linter/code-path-analysis/code-path-segment.js +0 -263
  173. package/packages/config-eslint/node_modules/eslint/lib/linter/code-path-analysis/code-path-state.js +0 -2348
  174. package/packages/config-eslint/node_modules/eslint/lib/linter/code-path-analysis/code-path.js +0 -344
  175. package/packages/config-eslint/node_modules/eslint/lib/linter/code-path-analysis/debug-helpers.js +0 -203
  176. package/packages/config-eslint/node_modules/eslint/lib/linter/code-path-analysis/fork-context.js +0 -349
  177. package/packages/config-eslint/node_modules/eslint/lib/linter/code-path-analysis/id-generator.js +0 -45
  178. package/packages/config-eslint/node_modules/eslint/lib/linter/config-comment-parser.js +0 -169
  179. package/packages/config-eslint/node_modules/eslint/lib/linter/index.js +0 -11
  180. package/packages/config-eslint/node_modules/eslint/lib/linter/interpolate.js +0 -50
  181. package/packages/config-eslint/node_modules/eslint/lib/linter/linter.js +0 -2410
  182. package/packages/config-eslint/node_modules/eslint/lib/linter/node-event-generator.js +0 -352
  183. package/packages/config-eslint/node_modules/eslint/lib/linter/report-translator.js +0 -376
  184. package/packages/config-eslint/node_modules/eslint/lib/linter/rule-fixer.js +0 -163
  185. package/packages/config-eslint/node_modules/eslint/lib/linter/rules.js +0 -71
  186. package/packages/config-eslint/node_modules/eslint/lib/linter/safe-emitter.js +0 -52
  187. package/packages/config-eslint/node_modules/eslint/lib/linter/source-code-fixer.js +0 -152
  188. package/packages/config-eslint/node_modules/eslint/lib/linter/timing.js +0 -169
  189. package/packages/config-eslint/node_modules/eslint/lib/linter/vfile.js +0 -111
  190. package/packages/config-eslint/node_modules/eslint/lib/options.js +0 -442
  191. package/packages/config-eslint/node_modules/eslint/lib/rule-tester/index.js +0 -7
  192. package/packages/config-eslint/node_modules/eslint/lib/rule-tester/rule-tester.js +0 -1286
  193. package/packages/config-eslint/node_modules/eslint/lib/rules/accessor-pairs.js +0 -346
  194. package/packages/config-eslint/node_modules/eslint/lib/rules/array-bracket-newline.js +0 -261
  195. package/packages/config-eslint/node_modules/eslint/lib/rules/array-bracket-spacing.js +0 -244
  196. package/packages/config-eslint/node_modules/eslint/lib/rules/array-callback-return.js +0 -446
  197. package/packages/config-eslint/node_modules/eslint/lib/rules/array-element-newline.js +0 -311
  198. package/packages/config-eslint/node_modules/eslint/lib/rules/arrow-body-style.js +0 -296
  199. package/packages/config-eslint/node_modules/eslint/lib/rules/arrow-parens.js +0 -186
  200. package/packages/config-eslint/node_modules/eslint/lib/rules/arrow-spacing.js +0 -164
  201. package/packages/config-eslint/node_modules/eslint/lib/rules/block-scoped-var.js +0 -135
  202. package/packages/config-eslint/node_modules/eslint/lib/rules/block-spacing.js +0 -174
  203. package/packages/config-eslint/node_modules/eslint/lib/rules/brace-style.js +0 -197
  204. package/packages/config-eslint/node_modules/eslint/lib/rules/callback-return.js +0 -187
  205. package/packages/config-eslint/node_modules/eslint/lib/rules/camelcase.js +0 -397
  206. package/packages/config-eslint/node_modules/eslint/lib/rules/capitalized-comments.js +0 -303
  207. package/packages/config-eslint/node_modules/eslint/lib/rules/class-methods-use-this.js +0 -187
  208. package/packages/config-eslint/node_modules/eslint/lib/rules/comma-dangle.js +0 -373
  209. package/packages/config-eslint/node_modules/eslint/lib/rules/comma-spacing.js +0 -192
  210. package/packages/config-eslint/node_modules/eslint/lib/rules/comma-style.js +0 -314
  211. package/packages/config-eslint/node_modules/eslint/lib/rules/complexity.js +0 -178
  212. package/packages/config-eslint/node_modules/eslint/lib/rules/computed-property-spacing.js +0 -208
  213. package/packages/config-eslint/node_modules/eslint/lib/rules/consistent-return.js +0 -210
  214. package/packages/config-eslint/node_modules/eslint/lib/rules/consistent-this.js +0 -153
  215. package/packages/config-eslint/node_modules/eslint/lib/rules/constructor-super.js +0 -445
  216. package/packages/config-eslint/node_modules/eslint/lib/rules/curly.js +0 -486
  217. package/packages/config-eslint/node_modules/eslint/lib/rules/default-case-last.js +0 -44
  218. package/packages/config-eslint/node_modules/eslint/lib/rules/default-case.js +0 -97
  219. package/packages/config-eslint/node_modules/eslint/lib/rules/default-param-last.js +0 -62
  220. package/packages/config-eslint/node_modules/eslint/lib/rules/dot-location.js +0 -108
  221. package/packages/config-eslint/node_modules/eslint/lib/rules/dot-notation.js +0 -176
  222. package/packages/config-eslint/node_modules/eslint/lib/rules/eol-last.js +0 -115
  223. package/packages/config-eslint/node_modules/eslint/lib/rules/eqeqeq.js +0 -174
  224. package/packages/config-eslint/node_modules/eslint/lib/rules/for-direction.js +0 -140
  225. package/packages/config-eslint/node_modules/eslint/lib/rules/func-call-spacing.js +0 -233
  226. package/packages/config-eslint/node_modules/eslint/lib/rules/func-name-matching.js +0 -253
  227. package/packages/config-eslint/node_modules/eslint/lib/rules/func-names.js +0 -191
  228. package/packages/config-eslint/node_modules/eslint/lib/rules/func-style.js +0 -136
  229. package/packages/config-eslint/node_modules/eslint/lib/rules/function-call-argument-newline.js +0 -125
  230. package/packages/config-eslint/node_modules/eslint/lib/rules/function-paren-newline.js +0 -292
  231. package/packages/config-eslint/node_modules/eslint/lib/rules/generator-star-spacing.js +0 -209
  232. package/packages/config-eslint/node_modules/eslint/lib/rules/getter-return.js +0 -204
  233. package/packages/config-eslint/node_modules/eslint/lib/rules/global-require.js +0 -90
  234. package/packages/config-eslint/node_modules/eslint/lib/rules/grouped-accessor-pairs.js +0 -215
  235. package/packages/config-eslint/node_modules/eslint/lib/rules/guard-for-in.js +0 -76
  236. package/packages/config-eslint/node_modules/eslint/lib/rules/handle-callback-err.js +0 -101
  237. package/packages/config-eslint/node_modules/eslint/lib/rules/id-blacklist.js +0 -246
  238. package/packages/config-eslint/node_modules/eslint/lib/rules/id-denylist.js +0 -228
  239. package/packages/config-eslint/node_modules/eslint/lib/rules/id-length.js +0 -177
  240. package/packages/config-eslint/node_modules/eslint/lib/rules/id-match.js +0 -299
  241. package/packages/config-eslint/node_modules/eslint/lib/rules/implicit-arrow-linebreak.js +0 -84
  242. package/packages/config-eslint/node_modules/eslint/lib/rules/indent-legacy.js +0 -1126
  243. package/packages/config-eslint/node_modules/eslint/lib/rules/indent.js +0 -1803
  244. package/packages/config-eslint/node_modules/eslint/lib/rules/index.js +0 -305
  245. package/packages/config-eslint/node_modules/eslint/lib/rules/init-declarations.js +0 -139
  246. package/packages/config-eslint/node_modules/eslint/lib/rules/jsx-quotes.js +0 -98
  247. package/packages/config-eslint/node_modules/eslint/lib/rules/key-spacing.js +0 -687
  248. package/packages/config-eslint/node_modules/eslint/lib/rules/keyword-spacing.js +0 -640
  249. package/packages/config-eslint/node_modules/eslint/lib/rules/line-comment-position.js +0 -125
  250. package/packages/config-eslint/node_modules/eslint/lib/rules/linebreak-style.js +0 -108
  251. package/packages/config-eslint/node_modules/eslint/lib/rules/lines-around-comment.js +0 -471
  252. package/packages/config-eslint/node_modules/eslint/lib/rules/lines-around-directive.js +0 -201
  253. package/packages/config-eslint/node_modules/eslint/lib/rules/lines-between-class-members.js +0 -269
  254. package/packages/config-eslint/node_modules/eslint/lib/rules/logical-assignment-operators.js +0 -504
  255. package/packages/config-eslint/node_modules/eslint/lib/rules/max-classes-per-file.js +0 -89
  256. package/packages/config-eslint/node_modules/eslint/lib/rules/max-depth.js +0 -156
  257. package/packages/config-eslint/node_modules/eslint/lib/rules/max-len.js +0 -440
  258. package/packages/config-eslint/node_modules/eslint/lib/rules/max-lines-per-function.js +0 -213
  259. package/packages/config-eslint/node_modules/eslint/lib/rules/max-lines.js +0 -193
  260. package/packages/config-eslint/node_modules/eslint/lib/rules/max-nested-callbacks.js +0 -117
  261. package/packages/config-eslint/node_modules/eslint/lib/rules/max-params.js +0 -102
  262. package/packages/config-eslint/node_modules/eslint/lib/rules/max-statements-per-line.js +0 -199
  263. package/packages/config-eslint/node_modules/eslint/lib/rules/max-statements.js +0 -184
  264. package/packages/config-eslint/node_modules/eslint/lib/rules/multiline-comment-style.js +0 -476
  265. package/packages/config-eslint/node_modules/eslint/lib/rules/multiline-ternary.js +0 -174
  266. package/packages/config-eslint/node_modules/eslint/lib/rules/new-cap.js +0 -276
  267. package/packages/config-eslint/node_modules/eslint/lib/rules/new-parens.js +0 -93
  268. package/packages/config-eslint/node_modules/eslint/lib/rules/newline-after-var.js +0 -253
  269. package/packages/config-eslint/node_modules/eslint/lib/rules/newline-before-return.js +0 -217
  270. package/packages/config-eslint/node_modules/eslint/lib/rules/newline-per-chained-call.js +0 -126
  271. package/packages/config-eslint/node_modules/eslint/lib/rules/no-alert.js +0 -138
  272. package/packages/config-eslint/node_modules/eslint/lib/rules/no-array-constructor.js +0 -133
  273. package/packages/config-eslint/node_modules/eslint/lib/rules/no-async-promise-executor.js +0 -39
  274. package/packages/config-eslint/node_modules/eslint/lib/rules/no-await-in-loop.js +0 -106
  275. package/packages/config-eslint/node_modules/eslint/lib/rules/no-bitwise.js +0 -119
  276. package/packages/config-eslint/node_modules/eslint/lib/rules/no-buffer-constructor.js +0 -50
  277. package/packages/config-eslint/node_modules/eslint/lib/rules/no-caller.js +0 -46
  278. package/packages/config-eslint/node_modules/eslint/lib/rules/no-case-declarations.js +0 -76
  279. package/packages/config-eslint/node_modules/eslint/lib/rules/no-catch-shadow.js +0 -82
  280. package/packages/config-eslint/node_modules/eslint/lib/rules/no-class-assign.js +0 -63
  281. package/packages/config-eslint/node_modules/eslint/lib/rules/no-compare-neg-zero.js +0 -60
  282. package/packages/config-eslint/node_modules/eslint/lib/rules/no-cond-assign.js +0 -159
  283. package/packages/config-eslint/node_modules/eslint/lib/rules/no-confusing-arrow.js +0 -92
  284. package/packages/config-eslint/node_modules/eslint/lib/rules/no-console.js +0 -207
  285. package/packages/config-eslint/node_modules/eslint/lib/rules/no-const-assign.js +0 -56
  286. package/packages/config-eslint/node_modules/eslint/lib/rules/no-constant-binary-expression.js +0 -508
  287. package/packages/config-eslint/node_modules/eslint/lib/rules/no-constant-condition.js +0 -161
  288. package/packages/config-eslint/node_modules/eslint/lib/rules/no-constructor-return.js +0 -62
  289. package/packages/config-eslint/node_modules/eslint/lib/rules/no-continue.js +0 -39
  290. package/packages/config-eslint/node_modules/eslint/lib/rules/no-control-regex.js +0 -138
  291. package/packages/config-eslint/node_modules/eslint/lib/rules/no-debugger.js +0 -43
  292. package/packages/config-eslint/node_modules/eslint/lib/rules/no-delete-var.js +0 -42
  293. package/packages/config-eslint/node_modules/eslint/lib/rules/no-div-regex.js +0 -53
  294. package/packages/config-eslint/node_modules/eslint/lib/rules/no-dupe-args.js +0 -82
  295. package/packages/config-eslint/node_modules/eslint/lib/rules/no-dupe-class-members.js +0 -104
  296. package/packages/config-eslint/node_modules/eslint/lib/rules/no-dupe-else-if.js +0 -122
  297. package/packages/config-eslint/node_modules/eslint/lib/rules/no-dupe-keys.js +0 -142
  298. package/packages/config-eslint/node_modules/eslint/lib/rules/no-duplicate-case.js +0 -71
  299. package/packages/config-eslint/node_modules/eslint/lib/rules/no-duplicate-imports.js +0 -290
  300. package/packages/config-eslint/node_modules/eslint/lib/rules/no-else-return.js +0 -405
  301. package/packages/config-eslint/node_modules/eslint/lib/rules/no-empty-character-class.js +0 -76
  302. package/packages/config-eslint/node_modules/eslint/lib/rules/no-empty-function.js +0 -167
  303. package/packages/config-eslint/node_modules/eslint/lib/rules/no-empty-pattern.js +0 -78
  304. package/packages/config-eslint/node_modules/eslint/lib/rules/no-empty-static-block.js +0 -47
  305. package/packages/config-eslint/node_modules/eslint/lib/rules/no-empty.js +0 -103
  306. package/packages/config-eslint/node_modules/eslint/lib/rules/no-eq-null.js +0 -46
  307. package/packages/config-eslint/node_modules/eslint/lib/rules/no-eval.js +0 -286
  308. package/packages/config-eslint/node_modules/eslint/lib/rules/no-ex-assign.js +0 -54
  309. package/packages/config-eslint/node_modules/eslint/lib/rules/no-extend-native.js +0 -178
  310. package/packages/config-eslint/node_modules/eslint/lib/rules/no-extra-bind.js +0 -213
  311. package/packages/config-eslint/node_modules/eslint/lib/rules/no-extra-boolean-cast.js +0 -369
  312. package/packages/config-eslint/node_modules/eslint/lib/rules/no-extra-label.js +0 -149
  313. package/packages/config-eslint/node_modules/eslint/lib/rules/no-extra-parens.js +0 -1322
  314. package/packages/config-eslint/node_modules/eslint/lib/rules/no-extra-semi.js +0 -147
  315. package/packages/config-eslint/node_modules/eslint/lib/rules/no-fallthrough.js +0 -221
  316. package/packages/config-eslint/node_modules/eslint/lib/rules/no-floating-decimal.js +0 -73
  317. package/packages/config-eslint/node_modules/eslint/lib/rules/no-func-assign.js +0 -78
  318. package/packages/config-eslint/node_modules/eslint/lib/rules/no-global-assign.js +0 -95
  319. package/packages/config-eslint/node_modules/eslint/lib/rules/no-implicit-coercion.js +0 -422
  320. package/packages/config-eslint/node_modules/eslint/lib/rules/no-implicit-globals.js +0 -146
  321. package/packages/config-eslint/node_modules/eslint/lib/rules/no-implied-eval.js +0 -132
  322. package/packages/config-eslint/node_modules/eslint/lib/rules/no-import-assign.js +0 -241
  323. package/packages/config-eslint/node_modules/eslint/lib/rules/no-inline-comments.js +0 -110
  324. package/packages/config-eslint/node_modules/eslint/lib/rules/no-inner-declarations.js +0 -131
  325. package/packages/config-eslint/node_modules/eslint/lib/rules/no-invalid-regexp.js +0 -194
  326. package/packages/config-eslint/node_modules/eslint/lib/rules/no-invalid-this.js +0 -150
  327. package/packages/config-eslint/node_modules/eslint/lib/rules/no-irregular-whitespace.js +0 -276
  328. package/packages/config-eslint/node_modules/eslint/lib/rules/no-iterator.js +0 -52
  329. package/packages/config-eslint/node_modules/eslint/lib/rules/no-label-var.js +0 -80
  330. package/packages/config-eslint/node_modules/eslint/lib/rules/no-labels.js +0 -149
  331. package/packages/config-eslint/node_modules/eslint/lib/rules/no-lone-blocks.js +0 -136
  332. package/packages/config-eslint/node_modules/eslint/lib/rules/no-lonely-if.js +0 -88
  333. package/packages/config-eslint/node_modules/eslint/lib/rules/no-loop-func.js +0 -238
  334. package/packages/config-eslint/node_modules/eslint/lib/rules/no-loss-of-precision.js +0 -214
  335. package/packages/config-eslint/node_modules/eslint/lib/rules/no-magic-numbers.js +0 -243
  336. package/packages/config-eslint/node_modules/eslint/lib/rules/no-misleading-character-class.js +0 -537
  337. package/packages/config-eslint/node_modules/eslint/lib/rules/no-mixed-operators.js +0 -229
  338. package/packages/config-eslint/node_modules/eslint/lib/rules/no-mixed-requires.js +0 -238
  339. package/packages/config-eslint/node_modules/eslint/lib/rules/no-mixed-spaces-and-tabs.js +0 -116
  340. package/packages/config-eslint/node_modules/eslint/lib/rules/no-multi-assign.js +0 -67
  341. package/packages/config-eslint/node_modules/eslint/lib/rules/no-multi-spaces.js +0 -141
  342. package/packages/config-eslint/node_modules/eslint/lib/rules/no-multi-str.js +0 -65
  343. package/packages/config-eslint/node_modules/eslint/lib/rules/no-multiple-empty-lines.js +0 -154
  344. package/packages/config-eslint/node_modules/eslint/lib/rules/no-native-reassign.js +0 -98
  345. package/packages/config-eslint/node_modules/eslint/lib/rules/no-negated-condition.js +0 -95
  346. package/packages/config-eslint/node_modules/eslint/lib/rules/no-negated-in-lhs.js +0 -46
  347. package/packages/config-eslint/node_modules/eslint/lib/rules/no-nested-ternary.js +0 -44
  348. package/packages/config-eslint/node_modules/eslint/lib/rules/no-new-func.js +0 -87
  349. package/packages/config-eslint/node_modules/eslint/lib/rules/no-new-native-nonconstructor.js +0 -66
  350. package/packages/config-eslint/node_modules/eslint/lib/rules/no-new-object.js +0 -67
  351. package/packages/config-eslint/node_modules/eslint/lib/rules/no-new-require.js +0 -50
  352. package/packages/config-eslint/node_modules/eslint/lib/rules/no-new-symbol.js +0 -63
  353. package/packages/config-eslint/node_modules/eslint/lib/rules/no-new-wrappers.js +0 -60
  354. package/packages/config-eslint/node_modules/eslint/lib/rules/no-new.js +0 -43
  355. package/packages/config-eslint/node_modules/eslint/lib/rules/no-nonoctal-decimal-escape.js +0 -148
  356. package/packages/config-eslint/node_modules/eslint/lib/rules/no-obj-calls.js +0 -86
  357. package/packages/config-eslint/node_modules/eslint/lib/rules/no-object-constructor.js +0 -117
  358. package/packages/config-eslint/node_modules/eslint/lib/rules/no-octal-escape.js +0 -56
  359. package/packages/config-eslint/node_modules/eslint/lib/rules/no-octal.js +0 -45
  360. package/packages/config-eslint/node_modules/eslint/lib/rules/no-param-reassign.js +0 -230
  361. package/packages/config-eslint/node_modules/eslint/lib/rules/no-path-concat.js +0 -64
  362. package/packages/config-eslint/node_modules/eslint/lib/rules/no-plusplus.js +0 -105
  363. package/packages/config-eslint/node_modules/eslint/lib/rules/no-process-env.js +0 -51
  364. package/packages/config-eslint/node_modules/eslint/lib/rules/no-process-exit.js +0 -47
  365. package/packages/config-eslint/node_modules/eslint/lib/rules/no-promise-executor-return.js +0 -263
  366. package/packages/config-eslint/node_modules/eslint/lib/rules/no-proto.js +0 -48
  367. package/packages/config-eslint/node_modules/eslint/lib/rules/no-prototype-builtins.js +0 -159
  368. package/packages/config-eslint/node_modules/eslint/lib/rules/no-redeclare.js +0 -174
  369. package/packages/config-eslint/node_modules/eslint/lib/rules/no-regex-spaces.js +0 -197
  370. package/packages/config-eslint/node_modules/eslint/lib/rules/no-restricted-exports.js +0 -204
  371. package/packages/config-eslint/node_modules/eslint/lib/rules/no-restricted-globals.js +0 -124
  372. package/packages/config-eslint/node_modules/eslint/lib/rules/no-restricted-imports.js +0 -563
  373. package/packages/config-eslint/node_modules/eslint/lib/rules/no-restricted-modules.js +0 -213
  374. package/packages/config-eslint/node_modules/eslint/lib/rules/no-restricted-properties.js +0 -168
  375. package/packages/config-eslint/node_modules/eslint/lib/rules/no-restricted-syntax.js +0 -70
  376. package/packages/config-eslint/node_modules/eslint/lib/rules/no-return-assign.js +0 -80
  377. package/packages/config-eslint/node_modules/eslint/lib/rules/no-return-await.js +0 -135
  378. package/packages/config-eslint/node_modules/eslint/lib/rules/no-script-url.js +0 -61
  379. package/packages/config-eslint/node_modules/eslint/lib/rules/no-self-assign.js +0 -183
  380. package/packages/config-eslint/node_modules/eslint/lib/rules/no-self-compare.js +0 -60
  381. package/packages/config-eslint/node_modules/eslint/lib/rules/no-sequences.js +0 -139
  382. package/packages/config-eslint/node_modules/eslint/lib/rules/no-setter-return.js +0 -226
  383. package/packages/config-eslint/node_modules/eslint/lib/rules/no-shadow-restricted-names.js +0 -65
  384. package/packages/config-eslint/node_modules/eslint/lib/rules/no-shadow.js +0 -336
  385. package/packages/config-eslint/node_modules/eslint/lib/rules/no-spaced-func.js +0 -83
  386. package/packages/config-eslint/node_modules/eslint/lib/rules/no-sparse-arrays.js +0 -73
  387. package/packages/config-eslint/node_modules/eslint/lib/rules/no-sync.js +0 -64
  388. package/packages/config-eslint/node_modules/eslint/lib/rules/no-tabs.js +0 -81
  389. package/packages/config-eslint/node_modules/eslint/lib/rules/no-template-curly-in-string.js +0 -44
  390. package/packages/config-eslint/node_modules/eslint/lib/rules/no-ternary.js +0 -41
  391. package/packages/config-eslint/node_modules/eslint/lib/rules/no-this-before-super.js +0 -363
  392. package/packages/config-eslint/node_modules/eslint/lib/rules/no-throw-literal.js +0 -51
  393. package/packages/config-eslint/node_modules/eslint/lib/rules/no-trailing-spaces.js +0 -192
  394. package/packages/config-eslint/node_modules/eslint/lib/rules/no-undef-init.js +0 -75
  395. package/packages/config-eslint/node_modules/eslint/lib/rules/no-undef.js +0 -79
  396. package/packages/config-eslint/node_modules/eslint/lib/rules/no-undefined.js +0 -86
  397. package/packages/config-eslint/node_modules/eslint/lib/rules/no-underscore-dangle.js +0 -335
  398. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unexpected-multiline.js +0 -120
  399. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unmodified-loop-condition.js +0 -360
  400. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unneeded-ternary.js +0 -166
  401. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unreachable-loop.js +0 -185
  402. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unreachable.js +0 -293
  403. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unsafe-finally.js +0 -111
  404. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unsafe-negation.js +0 -128
  405. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unsafe-optional-chaining.js +0 -205
  406. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unused-expressions.js +0 -186
  407. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unused-labels.js +0 -143
  408. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unused-private-class-members.js +0 -195
  409. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unused-vars.js +0 -881
  410. package/packages/config-eslint/node_modules/eslint/lib/rules/no-use-before-define.js +0 -348
  411. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-assignment.js +0 -566
  412. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-backreference.js +0 -244
  413. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-call.js +0 -90
  414. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-catch.js +0 -57
  415. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-computed-key.js +0 -168
  416. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-concat.js +0 -115
  417. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-constructor.js +0 -189
  418. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-escape.js +0 -333
  419. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-rename.js +0 -172
  420. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-return.js +0 -369
  421. package/packages/config-eslint/node_modules/eslint/lib/rules/no-var.js +0 -334
  422. package/packages/config-eslint/node_modules/eslint/lib/rules/no-void.js +0 -64
  423. package/packages/config-eslint/node_modules/eslint/lib/rules/no-warning-comments.js +0 -201
  424. package/packages/config-eslint/node_modules/eslint/lib/rules/no-whitespace-before-property.js +0 -116
  425. package/packages/config-eslint/node_modules/eslint/lib/rules/no-with.js +0 -39
  426. package/packages/config-eslint/node_modules/eslint/lib/rules/nonblock-statement-body-position.js +0 -127
  427. package/packages/config-eslint/node_modules/eslint/lib/rules/object-curly-newline.js +0 -324
  428. package/packages/config-eslint/node_modules/eslint/lib/rules/object-curly-spacing.js +0 -311
  429. package/packages/config-eslint/node_modules/eslint/lib/rules/object-property-newline.js +0 -102
  430. package/packages/config-eslint/node_modules/eslint/lib/rules/object-shorthand.js +0 -521
  431. package/packages/config-eslint/node_modules/eslint/lib/rules/one-var-declaration-per-line.js +0 -95
  432. package/packages/config-eslint/node_modules/eslint/lib/rules/one-var.js +0 -567
  433. package/packages/config-eslint/node_modules/eslint/lib/rules/operator-assignment.js +0 -209
  434. package/packages/config-eslint/node_modules/eslint/lib/rules/operator-linebreak.js +0 -253
  435. package/packages/config-eslint/node_modules/eslint/lib/rules/padded-blocks.js +0 -310
  436. package/packages/config-eslint/node_modules/eslint/lib/rules/padding-line-between-statements.js +0 -590
  437. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-arrow-callback.js +0 -381
  438. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-const.js +0 -501
  439. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-destructuring.js +0 -301
  440. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-exponentiation-operator.js +0 -191
  441. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-named-capture-group.js +0 -178
  442. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-numeric-literals.js +0 -148
  443. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-object-has-own.js +0 -114
  444. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-object-spread.js +0 -298
  445. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-promise-reject-errors.js +0 -132
  446. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-reflect.js +0 -127
  447. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-regex-literals.js +0 -507
  448. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-rest-params.js +0 -118
  449. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-spread.js +0 -87
  450. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-template.js +0 -275
  451. package/packages/config-eslint/node_modules/eslint/lib/rules/quote-props.js +0 -310
  452. package/packages/config-eslint/node_modules/eslint/lib/rules/quotes.js +0 -350
  453. package/packages/config-eslint/node_modules/eslint/lib/rules/radix.js +0 -198
  454. package/packages/config-eslint/node_modules/eslint/lib/rules/require-atomic-updates.js +0 -331
  455. package/packages/config-eslint/node_modules/eslint/lib/rules/require-await.js +0 -147
  456. package/packages/config-eslint/node_modules/eslint/lib/rules/require-unicode-regexp.js +0 -129
  457. package/packages/config-eslint/node_modules/eslint/lib/rules/require-yield.js +0 -77
  458. package/packages/config-eslint/node_modules/eslint/lib/rules/rest-spread-spacing.js +0 -123
  459. package/packages/config-eslint/node_modules/eslint/lib/rules/semi-spacing.js +0 -248
  460. package/packages/config-eslint/node_modules/eslint/lib/rules/semi-style.js +0 -158
  461. package/packages/config-eslint/node_modules/eslint/lib/rules/semi.js +0 -438
  462. package/packages/config-eslint/node_modules/eslint/lib/rules/sort-imports.js +0 -241
  463. package/packages/config-eslint/node_modules/eslint/lib/rules/sort-keys.js +0 -230
  464. package/packages/config-eslint/node_modules/eslint/lib/rules/sort-vars.js +0 -104
  465. package/packages/config-eslint/node_modules/eslint/lib/rules/space-before-blocks.js +0 -204
  466. package/packages/config-eslint/node_modules/eslint/lib/rules/space-before-function-paren.js +0 -167
  467. package/packages/config-eslint/node_modules/eslint/lib/rules/space-in-parens.js +0 -285
  468. package/packages/config-eslint/node_modules/eslint/lib/rules/space-infix-ops.js +0 -198
  469. package/packages/config-eslint/node_modules/eslint/lib/rules/space-unary-ops.js +0 -324
  470. package/packages/config-eslint/node_modules/eslint/lib/rules/spaced-comment.js +0 -385
  471. package/packages/config-eslint/node_modules/eslint/lib/rules/strict.js +0 -277
  472. package/packages/config-eslint/node_modules/eslint/lib/rules/switch-colon-spacing.js +0 -132
  473. package/packages/config-eslint/node_modules/eslint/lib/rules/symbol-description.js +0 -73
  474. package/packages/config-eslint/node_modules/eslint/lib/rules/template-curly-spacing.js +0 -144
  475. package/packages/config-eslint/node_modules/eslint/lib/rules/template-tag-spacing.js +0 -93
  476. package/packages/config-eslint/node_modules/eslint/lib/rules/unicode-bom.js +0 -73
  477. package/packages/config-eslint/node_modules/eslint/lib/rules/use-isnan.js +0 -235
  478. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/ast-utils.js +0 -2292
  479. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/char-source.js +0 -240
  480. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/fix-tracker.js +0 -114
  481. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/keywords.js +0 -67
  482. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/lazy-loading-rule-map.js +0 -115
  483. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/regular-expressions.js +0 -42
  484. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/unicode/index.js +0 -16
  485. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/unicode/is-combining-character.js +0 -13
  486. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/unicode/is-emoji-modifier.js +0 -13
  487. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/unicode/is-regional-indicator-symbol.js +0 -13
  488. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/unicode/is-surrogate-pair.js +0 -14
  489. package/packages/config-eslint/node_modules/eslint/lib/rules/valid-typeof.js +0 -127
  490. package/packages/config-eslint/node_modules/eslint/lib/rules/vars-on-top.js +0 -157
  491. package/packages/config-eslint/node_modules/eslint/lib/rules/wrap-iife.js +0 -207
  492. package/packages/config-eslint/node_modules/eslint/lib/rules/wrap-regex.js +0 -61
  493. package/packages/config-eslint/node_modules/eslint/lib/rules/yield-star-spacing.js +0 -130
  494. package/packages/config-eslint/node_modules/eslint/lib/rules/yoda.js +0 -353
  495. package/packages/config-eslint/node_modules/eslint/lib/shared/ajv.js +0 -34
  496. package/packages/config-eslint/node_modules/eslint/lib/shared/ast-utils.js +0 -29
  497. package/packages/config-eslint/node_modules/eslint/lib/shared/directives.js +0 -15
  498. package/packages/config-eslint/node_modules/eslint/lib/shared/flags.js +0 -27
  499. package/packages/config-eslint/node_modules/eslint/lib/shared/logging.js +0 -39
  500. package/packages/config-eslint/node_modules/eslint/lib/shared/runtime-info.js +0 -168
  501. package/packages/config-eslint/node_modules/eslint/lib/shared/serialization.js +0 -55
  502. package/packages/config-eslint/node_modules/eslint/lib/shared/severity.js +0 -49
  503. package/packages/config-eslint/node_modules/eslint/lib/shared/stats.js +0 -30
  504. package/packages/config-eslint/node_modules/eslint/lib/shared/string-utils.js +0 -58
  505. package/packages/config-eslint/node_modules/eslint/lib/shared/traverser.js +0 -195
  506. package/packages/config-eslint/node_modules/eslint/lib/shared/types.js +0 -250
  507. package/packages/config-eslint/node_modules/eslint/lib/unsupported-api.js +0 -28
  508. package/packages/config-eslint/node_modules/eslint/messages/all-files-ignored.js +0 -16
  509. package/packages/config-eslint/node_modules/eslint/messages/all-matched-files-ignored.js +0 -21
  510. package/packages/config-eslint/node_modules/eslint/messages/config-file-missing.js +0 -16
  511. package/packages/config-eslint/node_modules/eslint/messages/eslintrc-incompat.js +0 -119
  512. package/packages/config-eslint/node_modules/eslint/messages/eslintrc-plugins.js +0 -24
  513. package/packages/config-eslint/node_modules/eslint/messages/extend-config-missing.js +0 -13
  514. package/packages/config-eslint/node_modules/eslint/messages/failed-to-read-json.js +0 -11
  515. package/packages/config-eslint/node_modules/eslint/messages/file-not-found.js +0 -10
  516. package/packages/config-eslint/node_modules/eslint/messages/invalid-rule-options.js +0 -17
  517. package/packages/config-eslint/node_modules/eslint/messages/invalid-rule-severity.js +0 -13
  518. package/packages/config-eslint/node_modules/eslint/messages/no-config-found.js +0 -15
  519. package/packages/config-eslint/node_modules/eslint/messages/plugin-conflict.js +0 -22
  520. package/packages/config-eslint/node_modules/eslint/messages/plugin-invalid.js +0 -16
  521. package/packages/config-eslint/node_modules/eslint/messages/plugin-missing.js +0 -19
  522. package/packages/config-eslint/node_modules/eslint/messages/print-config-with-directory-path.js +0 -8
  523. package/packages/config-eslint/node_modules/eslint/messages/shared.js +0 -18
  524. package/packages/config-eslint/node_modules/eslint/messages/whitespace-found.js +0 -11
  525. package/packages/config-eslint/node_modules/eslint/package.json +0 -188
  526. package/packages/config-eslint/node_modules/eslint-scope/LICENSE +0 -22
  527. package/packages/config-eslint/node_modules/eslint-scope/README.md +0 -91
  528. package/packages/config-eslint/node_modules/eslint-scope/dist/eslint-scope.cjs +0 -2266
  529. package/packages/config-eslint/node_modules/eslint-scope/lib/definition.js +0 -85
  530. package/packages/config-eslint/node_modules/eslint-scope/lib/index.js +0 -169
  531. package/packages/config-eslint/node_modules/eslint-scope/lib/pattern-visitor.js +0 -154
  532. package/packages/config-eslint/node_modules/eslint-scope/lib/reference.js +0 -166
  533. package/packages/config-eslint/node_modules/eslint-scope/lib/referencer.js +0 -656
  534. package/packages/config-eslint/node_modules/eslint-scope/lib/scope-manager.js +0 -249
  535. package/packages/config-eslint/node_modules/eslint-scope/lib/scope.js +0 -793
  536. package/packages/config-eslint/node_modules/eslint-scope/lib/variable.js +0 -87
  537. package/packages/config-eslint/node_modules/eslint-scope/lib/version.js +0 -3
  538. package/packages/config-eslint/node_modules/eslint-scope/package.json +0 -65
  539. package/packages/config-eslint/node_modules/file-entry-cache/LICENSE +0 -22
  540. package/packages/config-eslint/node_modules/file-entry-cache/README.md +0 -115
  541. package/packages/config-eslint/node_modules/file-entry-cache/cache.js +0 -291
  542. package/packages/config-eslint/node_modules/file-entry-cache/package.json +0 -56
  543. package/packages/config-eslint/node_modules/find-up/index.d.ts +0 -138
  544. package/packages/config-eslint/node_modules/find-up/index.js +0 -89
  545. package/packages/config-eslint/node_modules/find-up/license +0 -9
  546. package/packages/config-eslint/node_modules/find-up/package.json +0 -54
  547. package/packages/config-eslint/node_modules/find-up/readme.md +0 -151
  548. package/packages/config-eslint/node_modules/flat-cache/LICENSE +0 -22
  549. package/packages/config-eslint/node_modules/flat-cache/README.md +0 -77
  550. package/packages/config-eslint/node_modules/flat-cache/changelog.md +0 -278
  551. package/packages/config-eslint/node_modules/flat-cache/package.json +0 -63
  552. package/packages/config-eslint/node_modules/flat-cache/src/cache.js +0 -214
  553. package/packages/config-eslint/node_modules/flat-cache/src/del.js +0 -30
  554. package/packages/config-eslint/node_modules/flat-cache/src/utils.js +0 -42
  555. package/packages/config-eslint/node_modules/glob-parent/LICENSE +0 -15
  556. package/packages/config-eslint/node_modules/glob-parent/README.md +0 -134
  557. package/packages/config-eslint/node_modules/glob-parent/index.js +0 -75
  558. package/packages/config-eslint/node_modules/glob-parent/package.json +0 -54
  559. package/packages/config-eslint/node_modules/json-schema-traverse/.eslintrc.yml +0 -27
  560. package/packages/config-eslint/node_modules/json-schema-traverse/.travis.yml +0 -8
  561. package/packages/config-eslint/node_modules/json-schema-traverse/LICENSE +0 -21
  562. package/packages/config-eslint/node_modules/json-schema-traverse/README.md +0 -83
  563. package/packages/config-eslint/node_modules/json-schema-traverse/index.js +0 -89
  564. package/packages/config-eslint/node_modules/json-schema-traverse/package.json +0 -43
  565. package/packages/config-eslint/node_modules/json-schema-traverse/spec/.eslintrc.yml +0 -6
  566. package/packages/config-eslint/node_modules/json-schema-traverse/spec/fixtures/schema.js +0 -125
  567. package/packages/config-eslint/node_modules/json-schema-traverse/spec/index.spec.js +0 -171
  568. package/packages/config-eslint/node_modules/locate-path/index.d.ts +0 -83
  569. package/packages/config-eslint/node_modules/locate-path/index.js +0 -68
  570. package/packages/config-eslint/node_modules/locate-path/license +0 -9
  571. package/packages/config-eslint/node_modules/locate-path/package.json +0 -46
  572. package/packages/config-eslint/node_modules/locate-path/readme.md +0 -125
  573. package/packages/config-eslint/node_modules/p-limit/index.d.ts +0 -42
  574. package/packages/config-eslint/node_modules/p-limit/index.js +0 -71
  575. package/packages/config-eslint/node_modules/p-limit/license +0 -9
  576. package/packages/config-eslint/node_modules/p-limit/package.json +0 -52
  577. package/packages/config-eslint/node_modules/p-limit/readme.md +0 -101
  578. package/packages/config-eslint/node_modules/p-locate/index.d.ts +0 -53
  579. package/packages/config-eslint/node_modules/p-locate/index.js +0 -50
  580. package/packages/config-eslint/node_modules/p-locate/license +0 -9
  581. package/packages/config-eslint/node_modules/p-locate/package.json +0 -54
  582. package/packages/config-eslint/node_modules/p-locate/readme.md +0 -93
  583. package/packages/config-eslint/node_modules/path-exists/index.d.ts +0 -28
  584. package/packages/config-eslint/node_modules/path-exists/index.js +0 -23
  585. package/packages/config-eslint/node_modules/path-exists/license +0 -9
  586. package/packages/config-eslint/node_modules/path-exists/package.json +0 -39
  587. package/packages/config-eslint/node_modules/path-exists/readme.md +0 -52
  588. package/packages/config-eslint/node_modules/yocto-queue/index.d.ts +0 -56
  589. package/packages/config-eslint/node_modules/yocto-queue/index.js +0 -68
  590. package/packages/config-eslint/node_modules/yocto-queue/license +0 -9
  591. package/packages/config-eslint/node_modules/yocto-queue/package.json +0 -43
  592. package/packages/config-eslint/node_modules/yocto-queue/readme.md +0 -64
@@ -1,1307 +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 fs = require("node:fs/promises");
13
- const { existsSync } = require("node:fs");
14
- const path = require("node:path");
15
- const findUp = require("find-up");
16
- const { version } = require("../../package.json");
17
- const { Linter } = require("../linter");
18
- const { getRuleFromConfig } = require("../config/flat-config-helpers");
19
- const {
20
- Legacy: {
21
- ConfigOps: {
22
- getRuleSeverity
23
- },
24
- ModuleResolver,
25
- naming
26
- }
27
- } = require("@eslint/eslintrc");
28
-
29
- const {
30
- findFiles,
31
- getCacheFile,
32
-
33
- isNonEmptyString,
34
- isArrayOfNonEmptyString,
35
-
36
- createIgnoreResult,
37
- isErrorMessage,
38
-
39
- processOptions
40
- } = require("./eslint-helpers");
41
- const { pathToFileURL } = require("node:url");
42
- const { FlatConfigArray } = require("../config/flat-config-array");
43
- const LintResultCache = require("../cli-engine/lint-result-cache");
44
- const { Retrier } = require("@humanwhocodes/retry");
45
-
46
- /*
47
- * This is necessary to allow overwriting writeFile for testing purposes.
48
- * We can just use fs/promises once we drop Node.js 12 support.
49
- */
50
-
51
- //------------------------------------------------------------------------------
52
- // Typedefs
53
- //------------------------------------------------------------------------------
54
-
55
- // For VSCode IntelliSense
56
- /** @typedef {import("../shared/types").ConfigData} ConfigData */
57
- /** @typedef {import("../shared/types").DeprecatedRuleInfo} DeprecatedRuleInfo */
58
- /** @typedef {import("../shared/types").LintMessage} LintMessage */
59
- /** @typedef {import("../shared/types").LintResult} LintResult */
60
- /** @typedef {import("../shared/types").ParserOptions} ParserOptions */
61
- /** @typedef {import("../shared/types").Plugin} Plugin */
62
- /** @typedef {import("../shared/types").ResultsMeta} ResultsMeta */
63
- /** @typedef {import("../shared/types").RuleConf} RuleConf */
64
- /** @typedef {import("../shared/types").Rule} Rule */
65
- /** @typedef {ReturnType<ConfigArray.extractConfig>} ExtractedConfig */
66
- /** @typedef {import('../cli-engine/cli-engine').CLIEngine} CLIEngine */
67
- /** @typedef {import('./legacy-eslint').CLIEngineLintReport} CLIEngineLintReport */
68
-
69
- /**
70
- * The options with which to configure the ESLint instance.
71
- * @typedef {Object} ESLintOptions
72
- * @property {boolean} [allowInlineConfig] Enable or disable inline configuration comments.
73
- * @property {ConfigData|Array<ConfigData>} [baseConfig] Base config, extended by all configs used with this instance
74
- * @property {boolean} [cache] Enable result caching.
75
- * @property {string} [cacheLocation] The cache file to use instead of .eslintcache.
76
- * @property {"metadata" | "content"} [cacheStrategy] The strategy used to detect changed files.
77
- * @property {string} [cwd] The value to use for the current working directory.
78
- * @property {boolean} [errorOnUnmatchedPattern] If `false` then `ESLint#lintFiles()` doesn't throw even if no target files found. Defaults to `true`.
79
- * @property {boolean|Function} [fix] Execute in autofix mode. If a function, should return a boolean.
80
- * @property {string[]} [fixTypes] Array of rule types to apply fixes for.
81
- * @property {string[]} [flags] Array of feature flags to enable.
82
- * @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.
83
- * @property {boolean} [ignore] False disables all ignore patterns except for the default ones.
84
- * @property {string[]} [ignorePatterns] Ignore file patterns to use in addition to config ignores. These patterns are relative to `cwd`.
85
- * @property {ConfigData|Array<ConfigData>} [overrideConfig] Override config, overrides all configs used with this instance
86
- * @property {boolean|string} [overrideConfigFile] Searches for default config file when falsy;
87
- * doesn't do any config file lookup when `true`; considered to be a config filename
88
- * when a string.
89
- * @property {Record<string,Plugin>} [plugins] An array of plugin implementations.
90
- * @property {boolean} [stats] True enables added statistics on lint results.
91
- * @property {boolean} [warnIgnored] Show warnings when the file list includes ignored files
92
- * @property {boolean} [passOnNoPatterns=false] When set to true, missing patterns cause
93
- * the linting operation to short circuit and not report any failures.
94
- */
95
-
96
- //------------------------------------------------------------------------------
97
- // Helpers
98
- //------------------------------------------------------------------------------
99
-
100
- const FLAT_CONFIG_FILENAMES = [
101
- "eslint.config.js",
102
- "eslint.config.mjs",
103
- "eslint.config.cjs"
104
- ];
105
- const FLAT_CONFIG_FILENAMES_WITH_TS = [
106
- ...FLAT_CONFIG_FILENAMES,
107
- "eslint.config.ts",
108
- "eslint.config.mts",
109
- "eslint.config.cts"
110
- ];
111
- const debug = require("debug")("eslint:eslint");
112
- const privateMembers = new WeakMap();
113
-
114
- /**
115
- * @type {Map<string, string>}
116
- */
117
- const importedConfigFileModificationTime = new Map();
118
- const removedFormatters = new Set([
119
- "checkstyle",
120
- "codeframe",
121
- "compact",
122
- "jslint-xml",
123
- "junit",
124
- "table",
125
- "tap",
126
- "unix",
127
- "visualstudio"
128
- ]);
129
-
130
- /**
131
- * It will calculate the error and warning count for collection of messages per file
132
- * @param {LintMessage[]} messages Collection of messages
133
- * @returns {Object} Contains the stats
134
- * @private
135
- */
136
- function calculateStatsPerFile(messages) {
137
- const stat = {
138
- errorCount: 0,
139
- fatalErrorCount: 0,
140
- warningCount: 0,
141
- fixableErrorCount: 0,
142
- fixableWarningCount: 0
143
- };
144
-
145
- for (let i = 0; i < messages.length; i++) {
146
- const message = messages[i];
147
-
148
- if (message.fatal || message.severity === 2) {
149
- stat.errorCount++;
150
- if (message.fatal) {
151
- stat.fatalErrorCount++;
152
- }
153
- if (message.fix) {
154
- stat.fixableErrorCount++;
155
- }
156
- } else {
157
- stat.warningCount++;
158
- if (message.fix) {
159
- stat.fixableWarningCount++;
160
- }
161
- }
162
- }
163
- return stat;
164
- }
165
-
166
- /**
167
- * Create rulesMeta object.
168
- * @param {Map<string,Rule>} rules a map of rules from which to generate the object.
169
- * @returns {Object} metadata for all enabled rules.
170
- */
171
- function createRulesMeta(rules) {
172
- return Array.from(rules).reduce((retVal, [id, rule]) => {
173
- retVal[id] = rule.meta;
174
- return retVal;
175
- }, {});
176
- }
177
-
178
- /**
179
- * Return the absolute path of a file named `"__placeholder__.js"` in a given directory.
180
- * This is used as a replacement for a missing file path.
181
- * @param {string} cwd An absolute directory path.
182
- * @returns {string} The absolute path of a file named `"__placeholder__.js"` in the given directory.
183
- */
184
- function getPlaceholderPath(cwd) {
185
- return path.join(cwd, "__placeholder__.js");
186
- }
187
-
188
- /** @type {WeakMap<ExtractedConfig, DeprecatedRuleInfo[]>} */
189
- const usedDeprecatedRulesCache = new WeakMap();
190
-
191
- /**
192
- * Create used deprecated rule list.
193
- * @param {CLIEngine} eslint The CLIEngine instance.
194
- * @param {string} maybeFilePath The absolute path to a lint target file or `"<text>"`.
195
- * @returns {DeprecatedRuleInfo[]} The used deprecated rule list.
196
- */
197
- function getOrFindUsedDeprecatedRules(eslint, maybeFilePath) {
198
- const {
199
- configs,
200
- options: { cwd }
201
- } = privateMembers.get(eslint);
202
- const filePath = path.isAbsolute(maybeFilePath)
203
- ? maybeFilePath
204
- : getPlaceholderPath(cwd);
205
- const config = configs.getConfig(filePath);
206
-
207
- // Most files use the same config, so cache it.
208
- if (config && !usedDeprecatedRulesCache.has(config)) {
209
- const retv = [];
210
-
211
- if (config.rules) {
212
- for (const [ruleId, ruleConf] of Object.entries(config.rules)) {
213
- if (getRuleSeverity(ruleConf) === 0) {
214
- continue;
215
- }
216
- const rule = getRuleFromConfig(ruleId, config);
217
- const meta = rule && rule.meta;
218
-
219
- if (meta && meta.deprecated) {
220
- retv.push({ ruleId, replacedBy: meta.replacedBy || [] });
221
- }
222
- }
223
- }
224
-
225
-
226
- usedDeprecatedRulesCache.set(config, Object.freeze(retv));
227
- }
228
-
229
- return config ? usedDeprecatedRulesCache.get(config) : Object.freeze([]);
230
- }
231
-
232
- /**
233
- * Processes the linting results generated by a CLIEngine linting report to
234
- * match the ESLint class's API.
235
- * @param {CLIEngine} eslint The CLIEngine instance.
236
- * @param {CLIEngineLintReport} report The CLIEngine linting report to process.
237
- * @returns {LintResult[]} The processed linting results.
238
- */
239
- function processLintReport(eslint, { results }) {
240
- const descriptor = {
241
- configurable: true,
242
- enumerable: true,
243
- get() {
244
- return getOrFindUsedDeprecatedRules(eslint, this.filePath);
245
- }
246
- };
247
-
248
- for (const result of results) {
249
- Object.defineProperty(result, "usedDeprecatedRules", descriptor);
250
- }
251
-
252
- return results;
253
- }
254
-
255
- /**
256
- * An Array.prototype.sort() compatible compare function to order results by their file path.
257
- * @param {LintResult} a The first lint result.
258
- * @param {LintResult} b The second lint result.
259
- * @returns {number} An integer representing the order in which the two results should occur.
260
- */
261
- function compareResultsByFilePath(a, b) {
262
- if (a.filePath < b.filePath) {
263
- return -1;
264
- }
265
-
266
- if (a.filePath > b.filePath) {
267
- return 1;
268
- }
269
-
270
- return 0;
271
- }
272
-
273
- /**
274
- * Searches from the current working directory up until finding the
275
- * given flat config filename.
276
- * @param {string} cwd The current working directory to search from.
277
- * @param {boolean} hasUnstableTSConfigFlag `true` if the `unstable_ts_config` flag is enabled, `false` if it's not.
278
- * @returns {Promise<string|undefined>} The filename if found or `undefined` if not.
279
- */
280
- function findFlatConfigFile(cwd, hasUnstableTSConfigFlag) {
281
- const filenames = hasUnstableTSConfigFlag ? FLAT_CONFIG_FILENAMES_WITH_TS : FLAT_CONFIG_FILENAMES;
282
-
283
- return findUp(
284
- filenames,
285
- { cwd }
286
- );
287
- }
288
-
289
- /**
290
- * Check if the file is a TypeScript file.
291
- * @param {string} filePath The file path to check.
292
- * @returns {boolean} `true` if the file is a TypeScript file, `false` if it's not.
293
- */
294
- function isFileTS(filePath) {
295
- const fileExtension = path.extname(filePath);
296
-
297
- return /^\.[mc]?ts$/u.test(fileExtension);
298
- }
299
-
300
- /**
301
- * Check if ESLint is running in Bun.
302
- * @returns {boolean} `true` if the ESLint is running Bun, `false` if it's not.
303
- */
304
- function isRunningInBun() {
305
- return !!globalThis.Bun;
306
- }
307
-
308
- /**
309
- * Check if ESLint is running in Deno.
310
- * @returns {boolean} `true` if the ESLint is running in Deno, `false` if it's not.
311
- */
312
- function isRunningInDeno() {
313
- return !!globalThis.Deno;
314
- }
315
-
316
- /**
317
- * Load the config array from the given filename.
318
- * @param {string} filePath The filename to load from.
319
- * @param {boolean} hasUnstableTSConfigFlag `true` if the `unstable_ts_config` flag is enabled, `false` if it's not.
320
- * @returns {Promise<any>} The config loaded from the config file.
321
- */
322
- async function loadFlatConfigFile(filePath, hasUnstableTSConfigFlag) {
323
- debug(`Loading config from ${filePath}`);
324
-
325
- const fileURL = pathToFileURL(filePath);
326
-
327
- debug(`Config file URL is ${fileURL}`);
328
-
329
- const mtime = (await fs.stat(filePath)).mtime.getTime().toString();
330
-
331
- /*
332
- * Append a query with the config file's modification time (`mtime`) in order
333
- * to import the current version of the config file. Without the query, `import()` would
334
- * cache the config file module by the pathname only, and then always return
335
- * the same version (the one that was actual when the module was imported for the first time).
336
- *
337
- * This ensures that the config file module is loaded and executed again
338
- * if it has been changed since the last time it was imported.
339
- * If it hasn't been changed, `import()` will just return the cached version.
340
- *
341
- * Note that we should not overuse queries (e.g., by appending the current time
342
- * to always reload the config file module) as that could cause memory leaks
343
- * because entries are never removed from the import cache.
344
- */
345
- fileURL.searchParams.append("mtime", mtime);
346
-
347
- /*
348
- * With queries, we can bypass the import cache. However, when import-ing a CJS module,
349
- * Node.js uses the require infrastructure under the hood. That includes the require cache,
350
- * which caches the config file module by its file path (queries have no effect).
351
- * Therefore, we also need to clear the require cache before importing the config file module.
352
- * In order to get the same behavior with ESM and CJS config files, in particular - to reload
353
- * the config file only if it has been changed, we track file modification times and clear
354
- * the require cache only if the file has been changed.
355
- */
356
- if (importedConfigFileModificationTime.get(filePath) !== mtime) {
357
- delete require.cache[filePath];
358
- }
359
-
360
- const isTS = isFileTS(filePath) && hasUnstableTSConfigFlag;
361
-
362
- const isBun = isRunningInBun();
363
-
364
- const isDeno = isRunningInDeno();
365
-
366
- if (isTS && !isDeno && !isBun) {
367
-
368
- const createJiti = await import("jiti").then(jitiModule => jitiModule.default, () => {
369
- throw new Error("The 'jiti' library is required for loading TypeScript configuration files. Make sure to install it.");
370
- });
371
-
372
- /*
373
- * Disabling `moduleCache` allows us to reload a
374
- * config file when the last modified timestamp changes.
375
- */
376
-
377
- const jiti = createJiti(__filename, { moduleCache: false });
378
-
379
- if (typeof jiti?.import !== "function") {
380
- throw new Error("You are using an outdated version of the 'jiti' library. Please update to the latest version of 'jiti' to ensure compatibility and access to the latest features.");
381
- }
382
-
383
- const config = await jiti.import(fileURL.href);
384
-
385
- importedConfigFileModificationTime.set(filePath, mtime);
386
-
387
- return config?.default ?? config;
388
- }
389
-
390
- const config = (await import(fileURL.href)).default;
391
-
392
- importedConfigFileModificationTime.set(filePath, mtime);
393
-
394
- return config;
395
- }
396
-
397
- /**
398
- * Determines which config file to use. This is determined by seeing if an
399
- * override config file was passed, and if so, using it; otherwise, as long
400
- * as override config file is not explicitly set to `false`, it will search
401
- * upwards from the cwd for a file named `eslint.config.js`.
402
- * @param {ESLintOptions} options The ESLint instance options.
403
- * @param {boolean} hasUnstableTSConfigFlag `true` if the `unstable_ts_config` flag is enabled, `false` if it's not.
404
- * @returns {Promise<{configFilePath:string|undefined;basePath:string;error:Error|null}>} Location information for
405
- * the config file.
406
- */
407
- async function locateConfigFileToUse({ configFile, cwd }, hasUnstableTSConfigFlag) {
408
-
409
- // determine where to load config file from
410
- let configFilePath;
411
- let basePath = cwd;
412
- let error = null;
413
-
414
- if (typeof configFile === "string") {
415
- debug(`Override config file path is ${configFile}`);
416
- configFilePath = path.resolve(cwd, configFile);
417
- } else if (configFile !== false) {
418
- debug("Searching for eslint.config.js");
419
- configFilePath = await findFlatConfigFile(cwd, hasUnstableTSConfigFlag);
420
-
421
- if (configFilePath) {
422
- basePath = path.resolve(path.dirname(configFilePath));
423
- } else {
424
- error = new Error("Could not find config file.");
425
- error.messageTemplate = "config-file-missing";
426
- }
427
-
428
- }
429
-
430
- return {
431
- configFilePath,
432
- basePath,
433
- error
434
- };
435
-
436
- }
437
-
438
- /**
439
- * Calculates the config array for this run based on inputs.
440
- * @param {ESLint} eslint The instance to create the config array for.
441
- * @param {ESLintOptions} options The ESLint instance options.
442
- * @returns {Promise<typeof FlatConfigArray>} The config array for `eslint``.
443
- */
444
- async function calculateConfigArray(eslint, {
445
- cwd,
446
- baseConfig,
447
- overrideConfig,
448
- configFile,
449
- ignore: shouldIgnore,
450
- ignorePatterns
451
- }) {
452
-
453
- // check for cached instance
454
- const slots = privateMembers.get(eslint);
455
-
456
- if (slots.configs) {
457
- return slots.configs;
458
- }
459
-
460
- const hasUnstableTSConfigFlag = eslint.hasFlag("unstable_ts_config");
461
-
462
- const { configFilePath, basePath, error } = await locateConfigFileToUse({ configFile, cwd }, hasUnstableTSConfigFlag);
463
-
464
- // config file is required to calculate config
465
- if (error) {
466
- throw error;
467
- }
468
-
469
- const configs = new FlatConfigArray(baseConfig || [], { basePath, shouldIgnore });
470
-
471
- // load config file
472
- if (configFilePath) {
473
- const fileConfig = await loadFlatConfigFile(configFilePath, hasUnstableTSConfigFlag);
474
-
475
- if (Array.isArray(fileConfig)) {
476
- configs.push(...fileConfig);
477
- } else {
478
- configs.push(fileConfig);
479
- }
480
- }
481
-
482
- // add in any configured defaults
483
- configs.push(...slots.defaultConfigs);
484
-
485
- // append command line ignore patterns
486
- if (ignorePatterns && ignorePatterns.length > 0) {
487
-
488
- let relativeIgnorePatterns;
489
-
490
- /*
491
- * If the config file basePath is different than the cwd, then
492
- * the ignore patterns won't work correctly. Here, we adjust the
493
- * ignore pattern to include the correct relative path. Patterns
494
- * passed as `ignorePatterns` are relative to the cwd, whereas
495
- * the config file basePath can be an ancestor of the cwd.
496
- */
497
- if (basePath === cwd) {
498
- relativeIgnorePatterns = ignorePatterns;
499
- } else {
500
-
501
- // In minimatch patterns, only `/` can be used as path separator
502
- const relativeIgnorePath = path.relative(basePath, cwd).replaceAll(path.sep, "/");
503
-
504
- relativeIgnorePatterns = ignorePatterns.map(pattern => {
505
- const negated = pattern.startsWith("!");
506
- const basePattern = negated ? pattern.slice(1) : pattern;
507
-
508
- return (negated ? "!" : "") +
509
- path.posix.join(relativeIgnorePath, basePattern);
510
- });
511
- }
512
-
513
- /*
514
- * Ignore patterns are added to the end of the config array
515
- * so they can override default ignores.
516
- */
517
- configs.push({
518
- ignores: relativeIgnorePatterns
519
- });
520
- }
521
-
522
- if (overrideConfig) {
523
- if (Array.isArray(overrideConfig)) {
524
- configs.push(...overrideConfig);
525
- } else {
526
- configs.push(overrideConfig);
527
- }
528
- }
529
-
530
- await configs.normalize();
531
-
532
- // cache the config array for this instance
533
- slots.configs = configs;
534
-
535
- return configs;
536
- }
537
-
538
- /**
539
- * Processes an source code using ESLint.
540
- * @param {Object} config The config object.
541
- * @param {string} config.text The source code to verify.
542
- * @param {string} config.cwd The path to the current working directory.
543
- * @param {string|undefined} config.filePath The path to the file of `text`. If this is undefined, it uses `<text>`.
544
- * @param {FlatConfigArray} config.configs The config.
545
- * @param {boolean} config.fix If `true` then it does fix.
546
- * @param {boolean} config.allowInlineConfig If `true` then it uses directive comments.
547
- * @param {Function} config.ruleFilter A predicate function to filter which rules should be run.
548
- * @param {boolean} config.stats If `true`, then if reports extra statistics with the lint results.
549
- * @param {Linter} config.linter The linter instance to verify.
550
- * @returns {LintResult} The result of linting.
551
- * @private
552
- */
553
- function verifyText({
554
- text,
555
- cwd,
556
- filePath: providedFilePath,
557
- configs,
558
- fix,
559
- allowInlineConfig,
560
- ruleFilter,
561
- stats,
562
- linter
563
- }) {
564
- const filePath = providedFilePath || "<text>";
565
-
566
- debug(`Lint ${filePath}`);
567
-
568
- /*
569
- * Verify.
570
- * `config.extractConfig(filePath)` requires an absolute path, but `linter`
571
- * doesn't know CWD, so it gives `linter` an absolute path always.
572
- */
573
- const filePathToVerify = filePath === "<text>" ? getPlaceholderPath(cwd) : filePath;
574
- const { fixed, messages, output } = linter.verifyAndFix(
575
- text,
576
- configs,
577
- {
578
- allowInlineConfig,
579
- filename: filePathToVerify,
580
- fix,
581
- ruleFilter,
582
- stats,
583
-
584
- /**
585
- * Check if the linter should adopt a given code block or not.
586
- * @param {string} blockFilename The virtual filename of a code block.
587
- * @returns {boolean} `true` if the linter should adopt the code block.
588
- */
589
- filterCodeBlock(blockFilename) {
590
- return configs.getConfig(blockFilename) !== void 0;
591
- }
592
- }
593
- );
594
-
595
- // Tweak and return.
596
- const result = {
597
- filePath: filePath === "<text>" ? filePath : path.resolve(filePath),
598
- messages,
599
- suppressedMessages: linter.getSuppressedMessages(),
600
- ...calculateStatsPerFile(messages)
601
- };
602
-
603
- if (fixed) {
604
- result.output = output;
605
- }
606
-
607
- if (
608
- result.errorCount + result.warningCount > 0 &&
609
- typeof result.output === "undefined"
610
- ) {
611
- result.source = text;
612
- }
613
-
614
- if (stats) {
615
- result.stats = {
616
- times: linter.getTimes(),
617
- fixPasses: linter.getFixPassCount()
618
- };
619
- }
620
-
621
- return result;
622
- }
623
-
624
- /**
625
- * Checks whether a message's rule type should be fixed.
626
- * @param {LintMessage} message The message to check.
627
- * @param {FlatConfig} config The config for the file that generated the message.
628
- * @param {string[]} fixTypes An array of fix types to check.
629
- * @returns {boolean} Whether the message should be fixed.
630
- */
631
- function shouldMessageBeFixed(message, config, fixTypes) {
632
- if (!message.ruleId) {
633
- return fixTypes.has("directive");
634
- }
635
-
636
- const rule = message.ruleId && getRuleFromConfig(message.ruleId, config);
637
-
638
- return Boolean(rule && rule.meta && fixTypes.has(rule.meta.type));
639
- }
640
-
641
- /**
642
- * Creates an error to be thrown when an array of results passed to `getRulesMetaForResults` was not created by the current engine.
643
- * @returns {TypeError} An error object.
644
- */
645
- function createExtraneousResultsError() {
646
- return new TypeError("Results object was not created from this ESLint instance.");
647
- }
648
-
649
- //-----------------------------------------------------------------------------
650
- // Main API
651
- //-----------------------------------------------------------------------------
652
-
653
- /**
654
- * Primary Node.js API for ESLint.
655
- */
656
- class ESLint {
657
-
658
- /**
659
- * The type of configuration used by this class.
660
- * @type {string}
661
- */
662
- static configType = "flat";
663
-
664
- /**
665
- * Creates a new instance of the main ESLint API.
666
- * @param {ESLintOptions} options The options for this instance.
667
- */
668
- constructor(options = {}) {
669
-
670
- const defaultConfigs = [];
671
- const processedOptions = processOptions(options);
672
- const linter = new Linter({
673
- cwd: processedOptions.cwd,
674
- configType: "flat",
675
- flags: processedOptions.flags
676
- });
677
-
678
- const cacheFilePath = getCacheFile(
679
- processedOptions.cacheLocation,
680
- processedOptions.cwd
681
- );
682
-
683
- const lintResultCache = processedOptions.cache
684
- ? new LintResultCache(cacheFilePath, processedOptions.cacheStrategy)
685
- : null;
686
-
687
- privateMembers.set(this, {
688
- options: processedOptions,
689
- linter,
690
- cacheFilePath,
691
- lintResultCache,
692
- defaultConfigs,
693
- configs: null
694
- });
695
-
696
- /**
697
- * If additional plugins are passed in, add that to the default
698
- * configs for this instance.
699
- */
700
- if (options.plugins) {
701
-
702
- const plugins = {};
703
-
704
- for (const [pluginName, plugin] of Object.entries(options.plugins)) {
705
- plugins[naming.getShorthandName(pluginName, "eslint-plugin")] = plugin;
706
- }
707
-
708
- defaultConfigs.push({
709
- plugins
710
- });
711
- }
712
-
713
- // Check for the .eslintignore file, and warn if it's present.
714
- if (existsSync(path.resolve(processedOptions.cwd, ".eslintignore"))) {
715
- process.emitWarning(
716
- "The \".eslintignore\" file is no longer supported. Switch to using the \"ignores\" property in \"eslint.config.js\": https://eslint.org/docs/latest/use/configure/migration-guide#ignoring-files",
717
- "ESLintIgnoreWarning"
718
- );
719
- }
720
- }
721
-
722
- /**
723
- * The version text.
724
- * @type {string}
725
- */
726
- static get version() {
727
- return version;
728
- }
729
-
730
- /**
731
- * Outputs fixes from the given results to files.
732
- * @param {LintResult[]} results The lint results.
733
- * @returns {Promise<void>} Returns a promise that is used to track side effects.
734
- */
735
- static async outputFixes(results) {
736
- if (!Array.isArray(results)) {
737
- throw new Error("'results' must be an array");
738
- }
739
-
740
- await Promise.all(
741
- results
742
- .filter(result => {
743
- if (typeof result !== "object" || result === null) {
744
- throw new Error("'results' must include only objects");
745
- }
746
- return (
747
- typeof result.output === "string" &&
748
- path.isAbsolute(result.filePath)
749
- );
750
- })
751
- .map(r => fs.writeFile(r.filePath, r.output))
752
- );
753
- }
754
-
755
- /**
756
- * Returns results that only contains errors.
757
- * @param {LintResult[]} results The results to filter.
758
- * @returns {LintResult[]} The filtered results.
759
- */
760
- static getErrorResults(results) {
761
- const filtered = [];
762
-
763
- results.forEach(result => {
764
- const filteredMessages = result.messages.filter(isErrorMessage);
765
- const filteredSuppressedMessages = result.suppressedMessages.filter(isErrorMessage);
766
-
767
- if (filteredMessages.length > 0) {
768
- filtered.push({
769
- ...result,
770
- messages: filteredMessages,
771
- suppressedMessages: filteredSuppressedMessages,
772
- errorCount: filteredMessages.length,
773
- warningCount: 0,
774
- fixableErrorCount: result.fixableErrorCount,
775
- fixableWarningCount: 0
776
- });
777
- }
778
- });
779
-
780
- return filtered;
781
- }
782
-
783
- /**
784
- * Returns meta objects for each rule represented in the lint results.
785
- * @param {LintResult[]} results The results to fetch rules meta for.
786
- * @returns {Object} A mapping of ruleIds to rule meta objects.
787
- * @throws {TypeError} When the results object wasn't created from this ESLint instance.
788
- * @throws {TypeError} When a plugin or rule is missing.
789
- */
790
- getRulesMetaForResults(results) {
791
-
792
- // short-circuit simple case
793
- if (results.length === 0) {
794
- return {};
795
- }
796
-
797
- const resultRules = new Map();
798
- const {
799
- configs,
800
- options: { cwd }
801
- } = privateMembers.get(this);
802
-
803
- /*
804
- * We can only accurately return rules meta information for linting results if the
805
- * results were created by this instance. Otherwise, the necessary rules data is
806
- * not available. So if the config array doesn't already exist, just throw an error
807
- * to let the user know we can't do anything here.
808
- */
809
- if (!configs) {
810
- throw createExtraneousResultsError();
811
- }
812
-
813
- for (const result of results) {
814
-
815
- /*
816
- * Normalize filename for <text>.
817
- */
818
- const filePath = result.filePath === "<text>"
819
- ? getPlaceholderPath(cwd) : result.filePath;
820
- const allMessages = result.messages.concat(result.suppressedMessages);
821
-
822
- for (const { ruleId } of allMessages) {
823
- if (!ruleId) {
824
- continue;
825
- }
826
-
827
- /*
828
- * All of the plugin and rule information is contained within the
829
- * calculated config for the given file.
830
- */
831
- const config = configs.getConfig(filePath);
832
-
833
- if (!config) {
834
- throw createExtraneousResultsError();
835
- }
836
- const rule = getRuleFromConfig(ruleId, config);
837
-
838
- // ignore unknown rules
839
- if (rule) {
840
- resultRules.set(ruleId, rule);
841
- }
842
- }
843
- }
844
-
845
- return createRulesMeta(resultRules);
846
- }
847
-
848
- /**
849
- * Indicates if the given feature flag is enabled for this instance.
850
- * @param {string} flag The feature flag to check.
851
- * @returns {boolean} `true` if the feature flag is enabled, `false` if not.
852
- */
853
- hasFlag(flag) {
854
-
855
- // note: Linter does validation of the flags
856
- return privateMembers.get(this).linter.hasFlag(flag);
857
- }
858
-
859
- /**
860
- * Executes the current configuration on an array of file and directory names.
861
- * @param {string|string[]} patterns An array of file and directory names.
862
- * @returns {Promise<LintResult[]>} The results of linting the file patterns given.
863
- */
864
- async lintFiles(patterns) {
865
-
866
- let normalizedPatterns = patterns;
867
- const {
868
- cacheFilePath,
869
- lintResultCache,
870
- linter,
871
- options: eslintOptions
872
- } = privateMembers.get(this);
873
-
874
- /*
875
- * Special cases:
876
- * 1. `patterns` is an empty string
877
- * 2. `patterns` is an empty array
878
- *
879
- * In both cases, we use the cwd as the directory to lint.
880
- */
881
- if (patterns === "" || Array.isArray(patterns) && patterns.length === 0) {
882
-
883
- /*
884
- * Special case: If `passOnNoPatterns` is true, then we just exit
885
- * without doing any work.
886
- */
887
- if (eslintOptions.passOnNoPatterns) {
888
- return [];
889
- }
890
-
891
- normalizedPatterns = ["."];
892
- } else {
893
-
894
- if (!isNonEmptyString(patterns) && !isArrayOfNonEmptyString(patterns)) {
895
- throw new Error("'patterns' must be a non-empty string or an array of non-empty strings");
896
- }
897
-
898
- if (typeof patterns === "string") {
899
- normalizedPatterns = [patterns];
900
- }
901
- }
902
-
903
- debug(`Using file patterns: ${normalizedPatterns}`);
904
-
905
- const configs = await calculateConfigArray(this, eslintOptions);
906
- const {
907
- allowInlineConfig,
908
- cache,
909
- cwd,
910
- fix,
911
- fixTypes,
912
- ruleFilter,
913
- stats,
914
- globInputPaths,
915
- errorOnUnmatchedPattern,
916
- warnIgnored
917
- } = eslintOptions;
918
- const startTime = Date.now();
919
- const fixTypesSet = fixTypes ? new Set(fixTypes) : null;
920
-
921
- // Delete cache file; should this be done here?
922
- if (!cache && cacheFilePath) {
923
- debug(`Deleting cache file at ${cacheFilePath}`);
924
-
925
- try {
926
- await fs.unlink(cacheFilePath);
927
- } catch (error) {
928
- const errorCode = error && error.code;
929
-
930
- // Ignore errors when no such file exists or file system is read only (and cache file does not exist)
931
- if (errorCode !== "ENOENT" && !(errorCode === "EROFS" && !existsSync(cacheFilePath))) {
932
- throw error;
933
- }
934
- }
935
- }
936
-
937
- const filePaths = await findFiles({
938
- patterns: normalizedPatterns,
939
- cwd,
940
- globInputPaths,
941
- configs,
942
- errorOnUnmatchedPattern
943
- });
944
- const controller = new AbortController();
945
- const retryCodes = new Set(["ENFILE", "EMFILE"]);
946
- const retrier = new Retrier(error => retryCodes.has(error.code));
947
-
948
- debug(`${filePaths.length} files found in: ${Date.now() - startTime}ms`);
949
-
950
- /*
951
- * Because we need to process multiple files, including reading from disk,
952
- * it is most efficient to start by reading each file via promises so that
953
- * they can be done in parallel. Then, we can lint the returned text. This
954
- * ensures we are waiting the minimum amount of time in between lints.
955
- */
956
- const results = await Promise.all(
957
-
958
- filePaths.map(filePath => {
959
-
960
- const config = configs.getConfig(filePath);
961
-
962
- /*
963
- * If a filename was entered that cannot be matched
964
- * to a config, then notify the user.
965
- */
966
- if (!config) {
967
- if (warnIgnored) {
968
- const configStatus = configs.getConfigStatus(filePath);
969
-
970
- return createIgnoreResult(filePath, cwd, configStatus);
971
- }
972
-
973
- return void 0;
974
- }
975
-
976
- // Skip if there is cached result.
977
- if (lintResultCache) {
978
- const cachedResult =
979
- lintResultCache.getCachedLintResults(filePath, config);
980
-
981
- if (cachedResult) {
982
- const hadMessages =
983
- cachedResult.messages &&
984
- cachedResult.messages.length > 0;
985
-
986
- if (hadMessages && fix) {
987
- debug(`Reprocessing cached file to allow autofix: ${filePath}`);
988
- } else {
989
- debug(`Skipping file since it hasn't changed: ${filePath}`);
990
- return cachedResult;
991
- }
992
- }
993
- }
994
-
995
-
996
- // set up fixer for fixTypes if necessary
997
- let fixer = fix;
998
-
999
- if (fix && fixTypesSet) {
1000
-
1001
- // save original value of options.fix in case it's a function
1002
- const originalFix = (typeof fix === "function")
1003
- ? fix : () => true;
1004
-
1005
- fixer = message => shouldMessageBeFixed(message, config, fixTypesSet) && originalFix(message);
1006
- }
1007
-
1008
- return retrier.retry(() => fs.readFile(filePath, { encoding: "utf8", signal: controller.signal })
1009
- .then(text => {
1010
-
1011
- // fail immediately if an error occurred in another file
1012
- controller.signal.throwIfAborted();
1013
-
1014
- // do the linting
1015
- const result = verifyText({
1016
- text,
1017
- filePath,
1018
- configs,
1019
- cwd,
1020
- fix: fixer,
1021
- allowInlineConfig,
1022
- ruleFilter,
1023
- stats,
1024
- linter
1025
- });
1026
-
1027
- /*
1028
- * Store the lint result in the LintResultCache.
1029
- * NOTE: The LintResultCache will remove the file source and any
1030
- * other properties that are difficult to serialize, and will
1031
- * hydrate those properties back in on future lint runs.
1032
- */
1033
- if (lintResultCache) {
1034
- lintResultCache.setCachedLintResults(filePath, config, result);
1035
- }
1036
-
1037
- return result;
1038
- }))
1039
- .catch(error => {
1040
- controller.abort(error);
1041
- throw error;
1042
- });
1043
- })
1044
- );
1045
-
1046
- // Persist the cache to disk.
1047
- if (lintResultCache) {
1048
- lintResultCache.reconcile();
1049
- }
1050
-
1051
- const finalResults = results.filter(result => !!result);
1052
-
1053
- return processLintReport(this, {
1054
- results: finalResults
1055
- });
1056
- }
1057
-
1058
- /**
1059
- * Executes the current configuration on text.
1060
- * @param {string} code A string of JavaScript code to lint.
1061
- * @param {Object} [options] The options.
1062
- * @param {string} [options.filePath] The path to the file of the source code.
1063
- * @param {boolean} [options.warnIgnored] When set to true, warn if given filePath is an ignored path.
1064
- * @returns {Promise<LintResult[]>} The results of linting the string of code given.
1065
- */
1066
- async lintText(code, options = {}) {
1067
-
1068
- // Parameter validation
1069
-
1070
- if (typeof code !== "string") {
1071
- throw new Error("'code' must be a string");
1072
- }
1073
-
1074
- if (typeof options !== "object") {
1075
- throw new Error("'options' must be an object, null, or undefined");
1076
- }
1077
-
1078
- // Options validation
1079
-
1080
- const {
1081
- filePath,
1082
- warnIgnored,
1083
- ...unknownOptions
1084
- } = options || {};
1085
-
1086
- const unknownOptionKeys = Object.keys(unknownOptions);
1087
-
1088
- if (unknownOptionKeys.length > 0) {
1089
- throw new Error(`'options' must not include the unknown option(s): ${unknownOptionKeys.join(", ")}`);
1090
- }
1091
-
1092
- if (filePath !== void 0 && !isNonEmptyString(filePath)) {
1093
- throw new Error("'options.filePath' must be a non-empty string or undefined");
1094
- }
1095
-
1096
- if (typeof warnIgnored !== "boolean" && typeof warnIgnored !== "undefined") {
1097
- throw new Error("'options.warnIgnored' must be a boolean or undefined");
1098
- }
1099
-
1100
- // Now we can get down to linting
1101
-
1102
- const {
1103
- linter,
1104
- options: eslintOptions
1105
- } = privateMembers.get(this);
1106
- const configs = await calculateConfigArray(this, eslintOptions);
1107
- const {
1108
- allowInlineConfig,
1109
- cwd,
1110
- fix,
1111
- warnIgnored: constructorWarnIgnored,
1112
- ruleFilter,
1113
- stats
1114
- } = eslintOptions;
1115
- const results = [];
1116
- const startTime = Date.now();
1117
- const resolvedFilename = path.resolve(cwd, filePath || "__placeholder__.js");
1118
-
1119
- // Clear the last used config arrays.
1120
- if (resolvedFilename && await this.isPathIgnored(resolvedFilename)) {
1121
- const shouldWarnIgnored = typeof warnIgnored === "boolean" ? warnIgnored : constructorWarnIgnored;
1122
-
1123
- if (shouldWarnIgnored) {
1124
- const configStatus = configs.getConfigStatus(resolvedFilename);
1125
-
1126
- results.push(createIgnoreResult(resolvedFilename, cwd, configStatus));
1127
- }
1128
- } else {
1129
-
1130
- // Do lint.
1131
- results.push(verifyText({
1132
- text: code,
1133
- filePath: resolvedFilename.endsWith("__placeholder__.js") ? "<text>" : resolvedFilename,
1134
- configs,
1135
- cwd,
1136
- fix,
1137
- allowInlineConfig,
1138
- ruleFilter,
1139
- stats,
1140
- linter
1141
- }));
1142
- }
1143
-
1144
- debug(`Linting complete in: ${Date.now() - startTime}ms`);
1145
-
1146
- return processLintReport(this, {
1147
- results
1148
- });
1149
-
1150
- }
1151
-
1152
- /**
1153
- * Returns the formatter representing the given formatter name.
1154
- * @param {string} [name] The name of the formatter to load.
1155
- * The following values are allowed:
1156
- * - `undefined` ... Load `stylish` builtin formatter.
1157
- * - A builtin formatter name ... Load the builtin formatter.
1158
- * - A third-party formatter name:
1159
- * - `foo` → `eslint-formatter-foo`
1160
- * - `@foo` → `@foo/eslint-formatter`
1161
- * - `@foo/bar` → `@foo/eslint-formatter-bar`
1162
- * - A file path ... Load the file.
1163
- * @returns {Promise<Formatter>} A promise resolving to the formatter object.
1164
- * This promise will be rejected if the given formatter was not found or not
1165
- * a function.
1166
- */
1167
- async loadFormatter(name = "stylish") {
1168
- if (typeof name !== "string") {
1169
- throw new Error("'name' must be a string");
1170
- }
1171
-
1172
- // replace \ with / for Windows compatibility
1173
- const normalizedFormatName = name.replace(/\\/gu, "/");
1174
- const namespace = naming.getNamespaceFromTerm(normalizedFormatName);
1175
-
1176
- // grab our options
1177
- const { cwd } = privateMembers.get(this).options;
1178
-
1179
-
1180
- let formatterPath;
1181
-
1182
- // if there's a slash, then it's a file (TODO: this check seems dubious for scoped npm packages)
1183
- if (!namespace && normalizedFormatName.includes("/")) {
1184
- formatterPath = path.resolve(cwd, normalizedFormatName);
1185
- } else {
1186
- try {
1187
- const npmFormat = naming.normalizePackageName(normalizedFormatName, "eslint-formatter");
1188
-
1189
- // TODO: This is pretty dirty...would be nice to clean up at some point.
1190
- formatterPath = ModuleResolver.resolve(npmFormat, getPlaceholderPath(cwd));
1191
- } catch {
1192
- formatterPath = path.resolve(__dirname, "../", "cli-engine", "formatters", `${normalizedFormatName}.js`);
1193
- }
1194
- }
1195
-
1196
- let formatter;
1197
-
1198
- try {
1199
- formatter = (await import(pathToFileURL(formatterPath))).default;
1200
- } catch (ex) {
1201
-
1202
- // check for formatters that have been removed
1203
- if (removedFormatters.has(name)) {
1204
- ex.message = `The ${name} formatter is no longer part of core ESLint. Install it manually with \`npm install -D eslint-formatter-${name}\``;
1205
- } else {
1206
- ex.message = `There was a problem loading formatter: ${formatterPath}\nError: ${ex.message}`;
1207
- }
1208
-
1209
- throw ex;
1210
- }
1211
-
1212
-
1213
- if (typeof formatter !== "function") {
1214
- throw new TypeError(`Formatter must be a function, but got a ${typeof formatter}.`);
1215
- }
1216
-
1217
- const eslint = this;
1218
-
1219
- return {
1220
-
1221
- /**
1222
- * The main formatter method.
1223
- * @param {LintResult[]} results The lint results to format.
1224
- * @param {ResultsMeta} resultsMeta Warning count and max threshold.
1225
- * @returns {string} The formatted lint results.
1226
- */
1227
- format(results, resultsMeta) {
1228
- let rulesMeta = null;
1229
-
1230
- results.sort(compareResultsByFilePath);
1231
-
1232
- return formatter(results, {
1233
- ...resultsMeta,
1234
- cwd,
1235
- get rulesMeta() {
1236
- if (!rulesMeta) {
1237
- rulesMeta = eslint.getRulesMetaForResults(results);
1238
- }
1239
-
1240
- return rulesMeta;
1241
- }
1242
- });
1243
- }
1244
- };
1245
- }
1246
-
1247
- /**
1248
- * Returns a configuration object for the given file based on the CLI options.
1249
- * This is the same logic used by the ESLint CLI executable to determine
1250
- * configuration for each file it processes.
1251
- * @param {string} filePath The path of the file to retrieve a config object for.
1252
- * @returns {Promise<ConfigData|undefined>} A configuration object for the file
1253
- * or `undefined` if there is no configuration data for the object.
1254
- */
1255
- async calculateConfigForFile(filePath) {
1256
- if (!isNonEmptyString(filePath)) {
1257
- throw new Error("'filePath' must be a non-empty string");
1258
- }
1259
- const options = privateMembers.get(this).options;
1260
- const absolutePath = path.resolve(options.cwd, filePath);
1261
- const configs = await calculateConfigArray(this, options);
1262
-
1263
- return configs.getConfig(absolutePath);
1264
- }
1265
-
1266
- /**
1267
- * Finds the config file being used by this instance based on the options
1268
- * passed to the constructor.
1269
- * @returns {Promise<string|undefined>} The path to the config file being used or
1270
- * `undefined` if no config file is being used.
1271
- */
1272
- async findConfigFile() {
1273
- const options = privateMembers.get(this).options;
1274
- const { configFilePath } = await locateConfigFileToUse(options, this.hasFlag("unstable_ts_config"));
1275
-
1276
- return configFilePath;
1277
- }
1278
-
1279
- /**
1280
- * Checks if a given path is ignored by ESLint.
1281
- * @param {string} filePath The path of the file to check.
1282
- * @returns {Promise<boolean>} Whether or not the given path is ignored.
1283
- */
1284
- async isPathIgnored(filePath) {
1285
- const config = await this.calculateConfigForFile(filePath);
1286
-
1287
- return config === void 0;
1288
- }
1289
- }
1290
-
1291
- /**
1292
- * Returns whether flat config should be used.
1293
- * @returns {Promise<boolean>} Whether flat config should be used.
1294
- */
1295
- async function shouldUseFlatConfig() {
1296
- return (process.env.ESLINT_USE_FLAT_CONFIG !== "false");
1297
- }
1298
-
1299
- //------------------------------------------------------------------------------
1300
- // Public Interface
1301
- //------------------------------------------------------------------------------
1302
-
1303
- module.exports = {
1304
- ESLint,
1305
- shouldUseFlatConfig,
1306
- locateConfigFileToUse
1307
- };