@alexlit/lint-kit 166.1.0 → 167.0.0

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