@alexlit/lint-kit 183.1.0 → 183.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (629) hide show
  1. package/package.json +1 -1
  2. package/packages/config-stylelint/index.js +1 -1
  3. package/packages/config-stylelint/package.json +2 -2
  4. package/packages/config-stylelint/plugins/bem.js +1 -5
  5. package/packages/config-eslint/node_modules/ajv/.tonic_example.js +0 -20
  6. package/packages/config-eslint/node_modules/ajv/LICENSE +0 -22
  7. package/packages/config-eslint/node_modules/ajv/README.md +0 -1505
  8. package/packages/config-eslint/node_modules/ajv/dist/ajv.bundle.js +0 -7201
  9. package/packages/config-eslint/node_modules/ajv/dist/ajv.min.js +0 -3
  10. package/packages/config-eslint/node_modules/ajv/dist/ajv.min.js.map +0 -1
  11. package/packages/config-eslint/node_modules/ajv/lib/ajv.d.ts +0 -402
  12. package/packages/config-eslint/node_modules/ajv/lib/ajv.js +0 -506
  13. package/packages/config-eslint/node_modules/ajv/lib/cache.js +0 -26
  14. package/packages/config-eslint/node_modules/ajv/lib/compile/async.js +0 -90
  15. package/packages/config-eslint/node_modules/ajv/lib/compile/equal.js +0 -5
  16. package/packages/config-eslint/node_modules/ajv/lib/compile/error_classes.js +0 -34
  17. package/packages/config-eslint/node_modules/ajv/lib/compile/formats.js +0 -142
  18. package/packages/config-eslint/node_modules/ajv/lib/compile/index.js +0 -389
  19. package/packages/config-eslint/node_modules/ajv/lib/compile/resolve.js +0 -270
  20. package/packages/config-eslint/node_modules/ajv/lib/compile/rules.js +0 -66
  21. package/packages/config-eslint/node_modules/ajv/lib/compile/schema_obj.js +0 -9
  22. package/packages/config-eslint/node_modules/ajv/lib/compile/ucs2length.js +0 -20
  23. package/packages/config-eslint/node_modules/ajv/lib/compile/util.js +0 -239
  24. package/packages/config-eslint/node_modules/ajv/lib/data.js +0 -49
  25. package/packages/config-eslint/node_modules/ajv/lib/definition_schema.js +0 -37
  26. package/packages/config-eslint/node_modules/ajv/lib/dot/_limit.jst +0 -113
  27. package/packages/config-eslint/node_modules/ajv/lib/dot/_limitItems.jst +0 -12
  28. package/packages/config-eslint/node_modules/ajv/lib/dot/_limitLength.jst +0 -12
  29. package/packages/config-eslint/node_modules/ajv/lib/dot/_limitProperties.jst +0 -12
  30. package/packages/config-eslint/node_modules/ajv/lib/dot/allOf.jst +0 -32
  31. package/packages/config-eslint/node_modules/ajv/lib/dot/anyOf.jst +0 -46
  32. package/packages/config-eslint/node_modules/ajv/lib/dot/coerce.def +0 -51
  33. package/packages/config-eslint/node_modules/ajv/lib/dot/comment.jst +0 -9
  34. package/packages/config-eslint/node_modules/ajv/lib/dot/const.jst +0 -11
  35. package/packages/config-eslint/node_modules/ajv/lib/dot/contains.jst +0 -55
  36. package/packages/config-eslint/node_modules/ajv/lib/dot/custom.jst +0 -191
  37. package/packages/config-eslint/node_modules/ajv/lib/dot/defaults.def +0 -47
  38. package/packages/config-eslint/node_modules/ajv/lib/dot/definitions.def +0 -203
  39. package/packages/config-eslint/node_modules/ajv/lib/dot/dependencies.jst +0 -79
  40. package/packages/config-eslint/node_modules/ajv/lib/dot/enum.jst +0 -30
  41. package/packages/config-eslint/node_modules/ajv/lib/dot/errors.def +0 -194
  42. package/packages/config-eslint/node_modules/ajv/lib/dot/format.jst +0 -106
  43. package/packages/config-eslint/node_modules/ajv/lib/dot/if.jst +0 -73
  44. package/packages/config-eslint/node_modules/ajv/lib/dot/items.jst +0 -98
  45. package/packages/config-eslint/node_modules/ajv/lib/dot/missing.def +0 -39
  46. package/packages/config-eslint/node_modules/ajv/lib/dot/multipleOf.jst +0 -22
  47. package/packages/config-eslint/node_modules/ajv/lib/dot/not.jst +0 -43
  48. package/packages/config-eslint/node_modules/ajv/lib/dot/oneOf.jst +0 -54
  49. package/packages/config-eslint/node_modules/ajv/lib/dot/pattern.jst +0 -25
  50. package/packages/config-eslint/node_modules/ajv/lib/dot/properties.jst +0 -245
  51. package/packages/config-eslint/node_modules/ajv/lib/dot/propertyNames.jst +0 -52
  52. package/packages/config-eslint/node_modules/ajv/lib/dot/ref.jst +0 -85
  53. package/packages/config-eslint/node_modules/ajv/lib/dot/required.jst +0 -108
  54. package/packages/config-eslint/node_modules/ajv/lib/dot/uniqueItems.jst +0 -62
  55. package/packages/config-eslint/node_modules/ajv/lib/dot/validate.jst +0 -276
  56. package/packages/config-eslint/node_modules/ajv/lib/dotjs/README.md +0 -3
  57. package/packages/config-eslint/node_modules/ajv/lib/dotjs/_limit.js +0 -163
  58. package/packages/config-eslint/node_modules/ajv/lib/dotjs/_limitItems.js +0 -80
  59. package/packages/config-eslint/node_modules/ajv/lib/dotjs/_limitLength.js +0 -85
  60. package/packages/config-eslint/node_modules/ajv/lib/dotjs/_limitProperties.js +0 -80
  61. package/packages/config-eslint/node_modules/ajv/lib/dotjs/allOf.js +0 -42
  62. package/packages/config-eslint/node_modules/ajv/lib/dotjs/anyOf.js +0 -73
  63. package/packages/config-eslint/node_modules/ajv/lib/dotjs/comment.js +0 -14
  64. package/packages/config-eslint/node_modules/ajv/lib/dotjs/const.js +0 -56
  65. package/packages/config-eslint/node_modules/ajv/lib/dotjs/contains.js +0 -81
  66. package/packages/config-eslint/node_modules/ajv/lib/dotjs/custom.js +0 -228
  67. package/packages/config-eslint/node_modules/ajv/lib/dotjs/dependencies.js +0 -168
  68. package/packages/config-eslint/node_modules/ajv/lib/dotjs/enum.js +0 -66
  69. package/packages/config-eslint/node_modules/ajv/lib/dotjs/format.js +0 -150
  70. package/packages/config-eslint/node_modules/ajv/lib/dotjs/if.js +0 -103
  71. package/packages/config-eslint/node_modules/ajv/lib/dotjs/index.js +0 -33
  72. package/packages/config-eslint/node_modules/ajv/lib/dotjs/items.js +0 -140
  73. package/packages/config-eslint/node_modules/ajv/lib/dotjs/multipleOf.js +0 -80
  74. package/packages/config-eslint/node_modules/ajv/lib/dotjs/not.js +0 -84
  75. package/packages/config-eslint/node_modules/ajv/lib/dotjs/oneOf.js +0 -73
  76. package/packages/config-eslint/node_modules/ajv/lib/dotjs/pattern.js +0 -85
  77. package/packages/config-eslint/node_modules/ajv/lib/dotjs/properties.js +0 -335
  78. package/packages/config-eslint/node_modules/ajv/lib/dotjs/propertyNames.js +0 -81
  79. package/packages/config-eslint/node_modules/ajv/lib/dotjs/ref.js +0 -124
  80. package/packages/config-eslint/node_modules/ajv/lib/dotjs/required.js +0 -270
  81. package/packages/config-eslint/node_modules/ajv/lib/dotjs/uniqueItems.js +0 -86
  82. package/packages/config-eslint/node_modules/ajv/lib/dotjs/validate.js +0 -482
  83. package/packages/config-eslint/node_modules/ajv/lib/keyword.js +0 -146
  84. package/packages/config-eslint/node_modules/ajv/lib/refs/data.json +0 -17
  85. package/packages/config-eslint/node_modules/ajv/lib/refs/json-schema-draft-04.json +0 -149
  86. package/packages/config-eslint/node_modules/ajv/lib/refs/json-schema-draft-06.json +0 -154
  87. package/packages/config-eslint/node_modules/ajv/lib/refs/json-schema-draft-07.json +0 -168
  88. package/packages/config-eslint/node_modules/ajv/lib/refs/json-schema-secure.json +0 -94
  89. package/packages/config-eslint/node_modules/ajv/package.json +0 -107
  90. package/packages/config-eslint/node_modules/ajv/scripts/.eslintrc.yml +0 -3
  91. package/packages/config-eslint/node_modules/ajv/scripts/bundle.js +0 -61
  92. package/packages/config-eslint/node_modules/ajv/scripts/compile-dots.js +0 -73
  93. package/packages/config-eslint/node_modules/ajv/scripts/info +0 -10
  94. package/packages/config-eslint/node_modules/ajv/scripts/prepare-tests +0 -12
  95. package/packages/config-eslint/node_modules/ajv/scripts/publish-built-version +0 -32
  96. package/packages/config-eslint/node_modules/ajv/scripts/travis-gh-pages +0 -23
  97. package/packages/config-eslint/node_modules/balanced-match/LICENSE.md +0 -23
  98. package/packages/config-eslint/node_modules/balanced-match/README.md +0 -57
  99. package/packages/config-eslint/node_modules/balanced-match/dist/commonjs/index.d.ts +0 -9
  100. package/packages/config-eslint/node_modules/balanced-match/dist/commonjs/index.d.ts.map +0 -1
  101. package/packages/config-eslint/node_modules/balanced-match/dist/commonjs/index.js +0 -59
  102. package/packages/config-eslint/node_modules/balanced-match/dist/commonjs/index.js.map +0 -1
  103. package/packages/config-eslint/node_modules/balanced-match/dist/commonjs/package.json +0 -3
  104. package/packages/config-eslint/node_modules/balanced-match/dist/esm/index.d.ts +0 -9
  105. package/packages/config-eslint/node_modules/balanced-match/dist/esm/index.d.ts.map +0 -1
  106. package/packages/config-eslint/node_modules/balanced-match/dist/esm/index.js +0 -54
  107. package/packages/config-eslint/node_modules/balanced-match/dist/esm/index.js.map +0 -1
  108. package/packages/config-eslint/node_modules/balanced-match/dist/esm/package.json +0 -3
  109. package/packages/config-eslint/node_modules/balanced-match/package.json +0 -68
  110. package/packages/config-eslint/node_modules/brace-expansion/LICENSE +0 -23
  111. package/packages/config-eslint/node_modules/brace-expansion/README.md +0 -94
  112. package/packages/config-eslint/node_modules/brace-expansion/dist/commonjs/index.d.ts +0 -6
  113. package/packages/config-eslint/node_modules/brace-expansion/dist/commonjs/index.d.ts.map +0 -1
  114. package/packages/config-eslint/node_modules/brace-expansion/dist/commonjs/index.js +0 -199
  115. package/packages/config-eslint/node_modules/brace-expansion/dist/commonjs/index.js.map +0 -1
  116. package/packages/config-eslint/node_modules/brace-expansion/dist/commonjs/package.json +0 -3
  117. package/packages/config-eslint/node_modules/brace-expansion/dist/esm/index.d.ts +0 -6
  118. package/packages/config-eslint/node_modules/brace-expansion/dist/esm/index.d.ts.map +0 -1
  119. package/packages/config-eslint/node_modules/brace-expansion/dist/esm/index.js +0 -195
  120. package/packages/config-eslint/node_modules/brace-expansion/dist/esm/index.js.map +0 -1
  121. package/packages/config-eslint/node_modules/brace-expansion/dist/esm/package.json +0 -3
  122. package/packages/config-eslint/node_modules/brace-expansion/package.json +0 -64
  123. package/packages/config-eslint/node_modules/eslint/LICENSE +0 -19
  124. package/packages/config-eslint/node_modules/eslint/README.md +0 -369
  125. package/packages/config-eslint/node_modules/eslint/bin/eslint.js +0 -195
  126. package/packages/config-eslint/node_modules/eslint/conf/ecma-version.js +0 -16
  127. package/packages/config-eslint/node_modules/eslint/conf/globals.js +0 -169
  128. package/packages/config-eslint/node_modules/eslint/conf/replacements.json +0 -26
  129. package/packages/config-eslint/node_modules/eslint/conf/rule-type-list.json +0 -91
  130. package/packages/config-eslint/node_modules/eslint/lib/api.js +0 -39
  131. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/formatters/formatters-meta.json +0 -18
  132. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/formatters/html.js +0 -359
  133. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/formatters/json-with-metadata.js +0 -16
  134. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/formatters/json.js +0 -13
  135. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/formatters/stylish.js +0 -153
  136. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/hash.js +0 -35
  137. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/lint-result-cache.js +0 -220
  138. package/packages/config-eslint/node_modules/eslint/lib/cli.js +0 -521
  139. package/packages/config-eslint/node_modules/eslint/lib/config/config-loader.js +0 -668
  140. package/packages/config-eslint/node_modules/eslint/lib/config/config.js +0 -674
  141. package/packages/config-eslint/node_modules/eslint/lib/config/default-config.js +0 -78
  142. package/packages/config-eslint/node_modules/eslint/lib/config/flat-config-array.js +0 -217
  143. package/packages/config-eslint/node_modules/eslint/lib/config/flat-config-schema.js +0 -598
  144. package/packages/config-eslint/node_modules/eslint/lib/config-api.js +0 -12
  145. package/packages/config-eslint/node_modules/eslint/lib/eslint/eslint-helpers.js +0 -1462
  146. package/packages/config-eslint/node_modules/eslint/lib/eslint/eslint.js +0 -1364
  147. package/packages/config-eslint/node_modules/eslint/lib/eslint/index.js +0 -7
  148. package/packages/config-eslint/node_modules/eslint/lib/eslint/worker.js +0 -173
  149. package/packages/config-eslint/node_modules/eslint/lib/languages/js/index.js +0 -336
  150. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/index.js +0 -7
  151. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/source-code.js +0 -1178
  152. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/backward-token-comment-cursor.js +0 -61
  153. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/backward-token-cursor.js +0 -57
  154. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/cursor.js +0 -76
  155. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/cursors.js +0 -120
  156. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/decorative-cursor.js +0 -38
  157. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/filter-cursor.js +0 -42
  158. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/forward-token-comment-cursor.js +0 -65
  159. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/forward-token-cursor.js +0 -62
  160. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/index.js +0 -695
  161. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/limit-cursor.js +0 -39
  162. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/padded-token-cursor.js +0 -45
  163. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/skip-cursor.js +0 -41
  164. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/utils.js +0 -131
  165. package/packages/config-eslint/node_modules/eslint/lib/languages/js/validate-language-options.js +0 -196
  166. package/packages/config-eslint/node_modules/eslint/lib/linter/apply-disable-directives.js +0 -583
  167. package/packages/config-eslint/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js +0 -828
  168. package/packages/config-eslint/node_modules/eslint/lib/linter/code-path-analysis/code-path-segment.js +0 -262
  169. package/packages/config-eslint/node_modules/eslint/lib/linter/code-path-analysis/code-path-state.js +0 -2370
  170. package/packages/config-eslint/node_modules/eslint/lib/linter/code-path-analysis/code-path.js +0 -332
  171. package/packages/config-eslint/node_modules/eslint/lib/linter/code-path-analysis/debug-helpers.js +0 -223
  172. package/packages/config-eslint/node_modules/eslint/lib/linter/code-path-analysis/fork-context.js +0 -374
  173. package/packages/config-eslint/node_modules/eslint/lib/linter/code-path-analysis/id-generator.js +0 -44
  174. package/packages/config-eslint/node_modules/eslint/lib/linter/esquery.js +0 -332
  175. package/packages/config-eslint/node_modules/eslint/lib/linter/file-context.js +0 -88
  176. package/packages/config-eslint/node_modules/eslint/lib/linter/file-report.js +0 -604
  177. package/packages/config-eslint/node_modules/eslint/lib/linter/index.js +0 -11
  178. package/packages/config-eslint/node_modules/eslint/lib/linter/interpolate.js +0 -50
  179. package/packages/config-eslint/node_modules/eslint/lib/linter/linter.js +0 -1614
  180. package/packages/config-eslint/node_modules/eslint/lib/linter/rule-fixer.js +0 -199
  181. package/packages/config-eslint/node_modules/eslint/lib/linter/source-code-fixer.js +0 -154
  182. package/packages/config-eslint/node_modules/eslint/lib/linter/source-code-traverser.js +0 -333
  183. package/packages/config-eslint/node_modules/eslint/lib/linter/source-code-visitor.js +0 -81
  184. package/packages/config-eslint/node_modules/eslint/lib/linter/timing.js +0 -209
  185. package/packages/config-eslint/node_modules/eslint/lib/linter/vfile.js +0 -115
  186. package/packages/config-eslint/node_modules/eslint/lib/options.js +0 -416
  187. package/packages/config-eslint/node_modules/eslint/lib/rule-tester/index.js +0 -7
  188. package/packages/config-eslint/node_modules/eslint/lib/rule-tester/rule-tester.js +0 -1996
  189. package/packages/config-eslint/node_modules/eslint/lib/rules/accessor-pairs.js +0 -420
  190. package/packages/config-eslint/node_modules/eslint/lib/rules/array-bracket-newline.js +0 -291
  191. package/packages/config-eslint/node_modules/eslint/lib/rules/array-bracket-spacing.js +0 -301
  192. package/packages/config-eslint/node_modules/eslint/lib/rules/array-callback-return.js +0 -510
  193. package/packages/config-eslint/node_modules/eslint/lib/rules/array-element-newline.js +0 -374
  194. package/packages/config-eslint/node_modules/eslint/lib/rules/arrow-body-style.js +0 -418
  195. package/packages/config-eslint/node_modules/eslint/lib/rules/arrow-parens.js +0 -237
  196. package/packages/config-eslint/node_modules/eslint/lib/rules/arrow-spacing.js +0 -188
  197. package/packages/config-eslint/node_modules/eslint/lib/rules/block-scoped-var.js +0 -144
  198. package/packages/config-eslint/node_modules/eslint/lib/rules/block-spacing.js +0 -202
  199. package/packages/config-eslint/node_modules/eslint/lib/rules/brace-style.js +0 -278
  200. package/packages/config-eslint/node_modules/eslint/lib/rules/callback-return.js +0 -216
  201. package/packages/config-eslint/node_modules/eslint/lib/rules/camelcase.js +0 -422
  202. package/packages/config-eslint/node_modules/eslint/lib/rules/capitalized-comments.js +0 -325
  203. package/packages/config-eslint/node_modules/eslint/lib/rules/class-methods-use-this.js +0 -250
  204. package/packages/config-eslint/node_modules/eslint/lib/rules/comma-dangle.js +0 -424
  205. package/packages/config-eslint/node_modules/eslint/lib/rules/comma-spacing.js +0 -205
  206. package/packages/config-eslint/node_modules/eslint/lib/rules/comma-style.js +0 -391
  207. package/packages/config-eslint/node_modules/eslint/lib/rules/complexity.js +0 -201
  208. package/packages/config-eslint/node_modules/eslint/lib/rules/computed-property-spacing.js +0 -251
  209. package/packages/config-eslint/node_modules/eslint/lib/rules/consistent-return.js +0 -221
  210. package/packages/config-eslint/node_modules/eslint/lib/rules/consistent-this.js +0 -179
  211. package/packages/config-eslint/node_modules/eslint/lib/rules/constructor-super.js +0 -453
  212. package/packages/config-eslint/node_modules/eslint/lib/rules/curly.js +0 -425
  213. package/packages/config-eslint/node_modules/eslint/lib/rules/default-case-last.js +0 -51
  214. package/packages/config-eslint/node_modules/eslint/lib/rules/default-case.js +0 -103
  215. package/packages/config-eslint/node_modules/eslint/lib/rules/default-param-last.js +0 -78
  216. package/packages/config-eslint/node_modules/eslint/lib/rules/dot-location.js +0 -138
  217. package/packages/config-eslint/node_modules/eslint/lib/rules/dot-notation.js +0 -216
  218. package/packages/config-eslint/node_modules/eslint/lib/rules/eol-last.js +0 -135
  219. package/packages/config-eslint/node_modules/eslint/lib/rules/eqeqeq.js +0 -210
  220. package/packages/config-eslint/node_modules/eslint/lib/rules/for-direction.js +0 -168
  221. package/packages/config-eslint/node_modules/eslint/lib/rules/func-call-spacing.js +0 -281
  222. package/packages/config-eslint/node_modules/eslint/lib/rules/func-name-matching.js +0 -338
  223. package/packages/config-eslint/node_modules/eslint/lib/rules/func-names.js +0 -204
  224. package/packages/config-eslint/node_modules/eslint/lib/rules/func-style.js +0 -221
  225. package/packages/config-eslint/node_modules/eslint/lib/rules/function-call-argument-newline.js +0 -166
  226. package/packages/config-eslint/node_modules/eslint/lib/rules/function-paren-newline.js +0 -368
  227. package/packages/config-eslint/node_modules/eslint/lib/rules/generator-star-spacing.js +0 -246
  228. package/packages/config-eslint/node_modules/eslint/lib/rules/getter-return.js +0 -242
  229. package/packages/config-eslint/node_modules/eslint/lib/rules/global-require.js +0 -117
  230. package/packages/config-eslint/node_modules/eslint/lib/rules/grouped-accessor-pairs.js +0 -268
  231. package/packages/config-eslint/node_modules/eslint/lib/rules/guard-for-in.js +0 -85
  232. package/packages/config-eslint/node_modules/eslint/lib/rules/handle-callback-err.js +0 -122
  233. package/packages/config-eslint/node_modules/eslint/lib/rules/id-blacklist.js +0 -241
  234. package/packages/config-eslint/node_modules/eslint/lib/rules/id-denylist.js +0 -223
  235. package/packages/config-eslint/node_modules/eslint/lib/rules/id-length.js +0 -217
  236. package/packages/config-eslint/node_modules/eslint/lib/rules/id-match.js +0 -363
  237. package/packages/config-eslint/node_modules/eslint/lib/rules/implicit-arrow-linebreak.js +0 -125
  238. package/packages/config-eslint/node_modules/eslint/lib/rules/indent-legacy.js +0 -1369
  239. package/packages/config-eslint/node_modules/eslint/lib/rules/indent.js +0 -2334
  240. package/packages/config-eslint/node_modules/eslint/lib/rules/index.js +0 -332
  241. package/packages/config-eslint/node_modules/eslint/lib/rules/init-declarations.js +0 -172
  242. package/packages/config-eslint/node_modules/eslint/lib/rules/jsx-quotes.js +0 -128
  243. package/packages/config-eslint/node_modules/eslint/lib/rules/key-spacing.js +0 -822
  244. package/packages/config-eslint/node_modules/eslint/lib/rules/keyword-spacing.js +0 -701
  245. package/packages/config-eslint/node_modules/eslint/lib/rules/line-comment-position.js +0 -157
  246. package/packages/config-eslint/node_modules/eslint/lib/rules/linebreak-style.js +0 -135
  247. package/packages/config-eslint/node_modules/eslint/lib/rules/lines-around-comment.js +0 -581
  248. package/packages/config-eslint/node_modules/eslint/lib/rules/lines-around-directive.js +0 -249
  249. package/packages/config-eslint/node_modules/eslint/lib/rules/lines-between-class-members.js +0 -358
  250. package/packages/config-eslint/node_modules/eslint/lib/rules/logical-assignment-operators.js +0 -688
  251. package/packages/config-eslint/node_modules/eslint/lib/rules/max-classes-per-file.js +0 -90
  252. package/packages/config-eslint/node_modules/eslint/lib/rules/max-depth.js +0 -159
  253. package/packages/config-eslint/node_modules/eslint/lib/rules/max-len.js +0 -497
  254. package/packages/config-eslint/node_modules/eslint/lib/rules/max-lines-per-function.js +0 -238
  255. package/packages/config-eslint/node_modules/eslint/lib/rules/max-lines.js +0 -189
  256. package/packages/config-eslint/node_modules/eslint/lib/rules/max-nested-callbacks.js +0 -115
  257. package/packages/config-eslint/node_modules/eslint/lib/rules/max-params.js +0 -148
  258. package/packages/config-eslint/node_modules/eslint/lib/rules/max-statements-per-line.js +0 -224
  259. package/packages/config-eslint/node_modules/eslint/lib/rules/max-statements.js +0 -188
  260. package/packages/config-eslint/node_modules/eslint/lib/rules/multiline-comment-style.js +0 -652
  261. package/packages/config-eslint/node_modules/eslint/lib/rules/multiline-ternary.js +0 -257
  262. package/packages/config-eslint/node_modules/eslint/lib/rules/new-cap.js +0 -277
  263. package/packages/config-eslint/node_modules/eslint/lib/rules/new-parens.js +0 -120
  264. package/packages/config-eslint/node_modules/eslint/lib/rules/newline-after-var.js +0 -307
  265. package/packages/config-eslint/node_modules/eslint/lib/rules/newline-before-return.js +0 -242
  266. package/packages/config-eslint/node_modules/eslint/lib/rules/newline-per-chained-call.js +0 -159
  267. package/packages/config-eslint/node_modules/eslint/lib/rules/no-alert.js +0 -149
  268. package/packages/config-eslint/node_modules/eslint/lib/rules/no-array-constructor.js +0 -195
  269. package/packages/config-eslint/node_modules/eslint/lib/rules/no-async-promise-executor.js +0 -45
  270. package/packages/config-eslint/node_modules/eslint/lib/rules/no-await-in-loop.js +0 -115
  271. package/packages/config-eslint/node_modules/eslint/lib/rules/no-bitwise.js +0 -145
  272. package/packages/config-eslint/node_modules/eslint/lib/rules/no-buffer-constructor.js +0 -74
  273. package/packages/config-eslint/node_modules/eslint/lib/rules/no-caller.js +0 -52
  274. package/packages/config-eslint/node_modules/eslint/lib/rules/no-case-declarations.js +0 -80
  275. package/packages/config-eslint/node_modules/eslint/lib/rules/no-catch-shadow.js +0 -96
  276. package/packages/config-eslint/node_modules/eslint/lib/rules/no-class-assign.js +0 -66
  277. package/packages/config-eslint/node_modules/eslint/lib/rules/no-compare-neg-zero.js +0 -74
  278. package/packages/config-eslint/node_modules/eslint/lib/rules/no-cond-assign.js +0 -175
  279. package/packages/config-eslint/node_modules/eslint/lib/rules/no-confusing-arrow.js +0 -127
  280. package/packages/config-eslint/node_modules/eslint/lib/rules/no-console.js +0 -227
  281. package/packages/config-eslint/node_modules/eslint/lib/rules/no-const-assign.js +0 -73
  282. package/packages/config-eslint/node_modules/eslint/lib/rules/no-constant-binary-expression.js +0 -603
  283. package/packages/config-eslint/node_modules/eslint/lib/rules/no-constant-condition.js +0 -177
  284. package/packages/config-eslint/node_modules/eslint/lib/rules/no-constructor-return.js +0 -62
  285. package/packages/config-eslint/node_modules/eslint/lib/rules/no-continue.js +0 -38
  286. package/packages/config-eslint/node_modules/eslint/lib/rules/no-control-regex.js +0 -142
  287. package/packages/config-eslint/node_modules/eslint/lib/rules/no-debugger.js +0 -41
  288. package/packages/config-eslint/node_modules/eslint/lib/rules/no-delete-var.js +0 -42
  289. package/packages/config-eslint/node_modules/eslint/lib/rules/no-div-regex.js +0 -60
  290. package/packages/config-eslint/node_modules/eslint/lib/rules/no-dupe-args.js +0 -98
  291. package/packages/config-eslint/node_modules/eslint/lib/rules/no-dupe-class-members.js +0 -117
  292. package/packages/config-eslint/node_modules/eslint/lib/rules/no-dupe-else-if.js +0 -145
  293. package/packages/config-eslint/node_modules/eslint/lib/rules/no-dupe-keys.js +0 -165
  294. package/packages/config-eslint/node_modules/eslint/lib/rules/no-duplicate-case.js +0 -78
  295. package/packages/config-eslint/node_modules/eslint/lib/rules/no-duplicate-imports.js +0 -368
  296. package/packages/config-eslint/node_modules/eslint/lib/rules/no-else-return.js +0 -456
  297. package/packages/config-eslint/node_modules/eslint/lib/rules/no-empty-character-class.js +0 -83
  298. package/packages/config-eslint/node_modules/eslint/lib/rules/no-empty-function.js +0 -236
  299. package/packages/config-eslint/node_modules/eslint/lib/rules/no-empty-pattern.js +0 -85
  300. package/packages/config-eslint/node_modules/eslint/lib/rules/no-empty-static-block.js +0 -73
  301. package/packages/config-eslint/node_modules/eslint/lib/rules/no-empty.js +0 -153
  302. package/packages/config-eslint/node_modules/eslint/lib/rules/no-eq-null.js +0 -51
  303. package/packages/config-eslint/node_modules/eslint/lib/rules/no-eval.js +0 -301
  304. package/packages/config-eslint/node_modules/eslint/lib/rules/no-ex-assign.js +0 -57
  305. package/packages/config-eslint/node_modules/eslint/lib/rules/no-extend-native.js +0 -180
  306. package/packages/config-eslint/node_modules/eslint/lib/rules/no-extra-bind.js +0 -224
  307. package/packages/config-eslint/node_modules/eslint/lib/rules/no-extra-boolean-cast.js +0 -420
  308. package/packages/config-eslint/node_modules/eslint/lib/rules/no-extra-label.js +0 -169
  309. package/packages/config-eslint/node_modules/eslint/lib/rules/no-extra-parens.js +0 -1669
  310. package/packages/config-eslint/node_modules/eslint/lib/rules/no-extra-semi.js +0 -167
  311. package/packages/config-eslint/node_modules/eslint/lib/rules/no-fallthrough.js +0 -260
  312. package/packages/config-eslint/node_modules/eslint/lib/rules/no-floating-decimal.js +0 -99
  313. package/packages/config-eslint/node_modules/eslint/lib/rules/no-func-assign.js +0 -77
  314. package/packages/config-eslint/node_modules/eslint/lib/rules/no-global-assign.js +0 -101
  315. package/packages/config-eslint/node_modules/eslint/lib/rules/no-implicit-coercion.js +0 -468
  316. package/packages/config-eslint/node_modules/eslint/lib/rules/no-implicit-globals.js +0 -187
  317. package/packages/config-eslint/node_modules/eslint/lib/rules/no-implied-eval.js +0 -171
  318. package/packages/config-eslint/node_modules/eslint/lib/rules/no-import-assign.js +0 -227
  319. package/packages/config-eslint/node_modules/eslint/lib/rules/no-inline-comments.js +0 -115
  320. package/packages/config-eslint/node_modules/eslint/lib/rules/no-inner-declarations.js +0 -147
  321. package/packages/config-eslint/node_modules/eslint/lib/rules/no-invalid-regexp.js +0 -244
  322. package/packages/config-eslint/node_modules/eslint/lib/rules/no-invalid-this.js +0 -178
  323. package/packages/config-eslint/node_modules/eslint/lib/rules/no-irregular-whitespace.js +0 -292
  324. package/packages/config-eslint/node_modules/eslint/lib/rules/no-iterator.js +0 -48
  325. package/packages/config-eslint/node_modules/eslint/lib/rules/no-label-var.js +0 -78
  326. package/packages/config-eslint/node_modules/eslint/lib/rules/no-labels.js +0 -156
  327. package/packages/config-eslint/node_modules/eslint/lib/rules/no-lone-blocks.js +0 -140
  328. package/packages/config-eslint/node_modules/eslint/lib/rules/no-lonely-if.js +0 -126
  329. package/packages/config-eslint/node_modules/eslint/lib/rules/no-loop-func.js +0 -273
  330. package/packages/config-eslint/node_modules/eslint/lib/rules/no-loss-of-precision.js +0 -249
  331. package/packages/config-eslint/node_modules/eslint/lib/rules/no-magic-numbers.js +0 -365
  332. package/packages/config-eslint/node_modules/eslint/lib/rules/no-misleading-character-class.js +0 -595
  333. package/packages/config-eslint/node_modules/eslint/lib/rules/no-mixed-operators.js +0 -253
  334. package/packages/config-eslint/node_modules/eslint/lib/rules/no-mixed-requires.js +0 -267
  335. package/packages/config-eslint/node_modules/eslint/lib/rules/no-mixed-spaces-and-tabs.js +0 -148
  336. package/packages/config-eslint/node_modules/eslint/lib/rules/no-multi-assign.js +0 -66
  337. package/packages/config-eslint/node_modules/eslint/lib/rules/no-multi-spaces.js +0 -179
  338. package/packages/config-eslint/node_modules/eslint/lib/rules/no-multi-str.js +0 -67
  339. package/packages/config-eslint/node_modules/eslint/lib/rules/no-multiple-empty-lines.js +0 -210
  340. package/packages/config-eslint/node_modules/eslint/lib/rules/no-native-reassign.js +0 -114
  341. package/packages/config-eslint/node_modules/eslint/lib/rules/no-negated-condition.js +0 -100
  342. package/packages/config-eslint/node_modules/eslint/lib/rules/no-negated-in-lhs.js +0 -59
  343. package/packages/config-eslint/node_modules/eslint/lib/rules/no-nested-ternary.js +0 -46
  344. package/packages/config-eslint/node_modules/eslint/lib/rules/no-new-func.js +0 -96
  345. package/packages/config-eslint/node_modules/eslint/lib/rules/no-new-native-nonconstructor.js +0 -70
  346. package/packages/config-eslint/node_modules/eslint/lib/rules/no-new-object.js +0 -76
  347. package/packages/config-eslint/node_modules/eslint/lib/rules/no-new-require.js +0 -67
  348. package/packages/config-eslint/node_modules/eslint/lib/rules/no-new-symbol.js +0 -74
  349. package/packages/config-eslint/node_modules/eslint/lib/rules/no-new-wrappers.js +0 -62
  350. package/packages/config-eslint/node_modules/eslint/lib/rules/no-new.js +0 -42
  351. package/packages/config-eslint/node_modules/eslint/lib/rules/no-nonoctal-decimal-escape.js +0 -176
  352. package/packages/config-eslint/node_modules/eslint/lib/rules/no-obj-calls.js +0 -99
  353. package/packages/config-eslint/node_modules/eslint/lib/rules/no-object-constructor.js +0 -124
  354. package/packages/config-eslint/node_modules/eslint/lib/rules/no-octal-escape.js +0 -53
  355. package/packages/config-eslint/node_modules/eslint/lib/rules/no-octal.js +0 -42
  356. package/packages/config-eslint/node_modules/eslint/lib/rules/no-param-reassign.js +0 -248
  357. package/packages/config-eslint/node_modules/eslint/lib/rules/no-path-concat.js +0 -79
  358. package/packages/config-eslint/node_modules/eslint/lib/rules/no-plusplus.js +0 -102
  359. package/packages/config-eslint/node_modules/eslint/lib/rules/no-process-env.js +0 -68
  360. package/packages/config-eslint/node_modules/eslint/lib/rules/no-process-exit.js +0 -67
  361. package/packages/config-eslint/node_modules/eslint/lib/rules/no-promise-executor-return.js +0 -264
  362. package/packages/config-eslint/node_modules/eslint/lib/rules/no-proto.js +0 -45
  363. package/packages/config-eslint/node_modules/eslint/lib/rules/no-prototype-builtins.js +0 -181
  364. package/packages/config-eslint/node_modules/eslint/lib/rules/no-redeclare.js +0 -173
  365. package/packages/config-eslint/node_modules/eslint/lib/rules/no-regex-spaces.js +0 -219
  366. package/packages/config-eslint/node_modules/eslint/lib/rules/no-restricted-exports.js +0 -227
  367. package/packages/config-eslint/node_modules/eslint/lib/rules/no-restricted-globals.js +0 -266
  368. package/packages/config-eslint/node_modules/eslint/lib/rules/no-restricted-imports.js +0 -892
  369. package/packages/config-eslint/node_modules/eslint/lib/rules/no-restricted-modules.js +0 -249
  370. package/packages/config-eslint/node_modules/eslint/lib/rules/no-restricted-properties.js +0 -233
  371. package/packages/config-eslint/node_modules/eslint/lib/rules/no-restricted-syntax.js +0 -74
  372. package/packages/config-eslint/node_modules/eslint/lib/rules/no-return-assign.js +0 -87
  373. package/packages/config-eslint/node_modules/eslint/lib/rules/no-return-await.js +0 -162
  374. package/packages/config-eslint/node_modules/eslint/lib/rules/no-script-url.js +0 -68
  375. package/packages/config-eslint/node_modules/eslint/lib/rules/no-self-assign.js +0 -186
  376. package/packages/config-eslint/node_modules/eslint/lib/rules/no-self-compare.js +0 -77
  377. package/packages/config-eslint/node_modules/eslint/lib/rules/no-sequences.js +0 -158
  378. package/packages/config-eslint/node_modules/eslint/lib/rules/no-setter-return.js +0 -224
  379. package/packages/config-eslint/node_modules/eslint/lib/rules/no-shadow-restricted-names.js +0 -113
  380. package/packages/config-eslint/node_modules/eslint/lib/rules/no-shadow.js +0 -695
  381. package/packages/config-eslint/node_modules/eslint/lib/rules/no-spaced-func.js +0 -105
  382. package/packages/config-eslint/node_modules/eslint/lib/rules/no-sparse-arrays.js +0 -68
  383. package/packages/config-eslint/node_modules/eslint/lib/rules/no-sync.js +0 -81
  384. package/packages/config-eslint/node_modules/eslint/lib/rules/no-tabs.js +0 -110
  385. package/packages/config-eslint/node_modules/eslint/lib/rules/no-template-curly-in-string.js +0 -45
  386. package/packages/config-eslint/node_modules/eslint/lib/rules/no-ternary.js +0 -38
  387. package/packages/config-eslint/node_modules/eslint/lib/rules/no-this-before-super.js +0 -365
  388. package/packages/config-eslint/node_modules/eslint/lib/rules/no-throw-literal.js +0 -46
  389. package/packages/config-eslint/node_modules/eslint/lib/rules/no-trailing-spaces.js +0 -227
  390. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unassigned-vars.js +0 -80
  391. package/packages/config-eslint/node_modules/eslint/lib/rules/no-undef-init.js +0 -101
  392. package/packages/config-eslint/node_modules/eslint/lib/rules/no-undef.js +0 -84
  393. package/packages/config-eslint/node_modules/eslint/lib/rules/no-undefined.js +0 -91
  394. package/packages/config-eslint/node_modules/eslint/lib/rules/no-underscore-dangle.js +0 -383
  395. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unexpected-multiline.js +0 -130
  396. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unmodified-loop-condition.js +0 -367
  397. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unneeded-ternary.js +0 -232
  398. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unreachable-loop.js +0 -190
  399. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unreachable.js +0 -300
  400. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unsafe-finally.js +0 -119
  401. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unsafe-negation.js +0 -152
  402. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unsafe-optional-chaining.js +0 -221
  403. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unused-expressions.js +0 -227
  404. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unused-labels.js +0 -158
  405. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unused-private-class-members.js +0 -219
  406. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unused-vars.js +0 -1746
  407. package/packages/config-eslint/node_modules/eslint/lib/rules/no-use-before-define.js +0 -453
  408. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-assignment.js +0 -658
  409. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-backreference.js +0 -263
  410. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-call.js +0 -95
  411. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-catch.js +0 -57
  412. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-computed-key.js +0 -204
  413. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-concat.js +0 -121
  414. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-constructor.js +0 -262
  415. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-escape.js +0 -406
  416. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-rename.js +0 -202
  417. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-return.js +0 -401
  418. package/packages/config-eslint/node_modules/eslint/lib/rules/no-var.js +0 -375
  419. package/packages/config-eslint/node_modules/eslint/lib/rules/no-void.js +0 -69
  420. package/packages/config-eslint/node_modules/eslint/lib/rules/no-warning-comments.js +0 -209
  421. package/packages/config-eslint/node_modules/eslint/lib/rules/no-whitespace-before-property.js +0 -150
  422. package/packages/config-eslint/node_modules/eslint/lib/rules/no-with.js +0 -37
  423. package/packages/config-eslint/node_modules/eslint/lib/rules/nonblock-statement-body-position.js +0 -164
  424. package/packages/config-eslint/node_modules/eslint/lib/rules/object-curly-newline.js +0 -383
  425. package/packages/config-eslint/node_modules/eslint/lib/rules/object-curly-spacing.js +0 -369
  426. package/packages/config-eslint/node_modules/eslint/lib/rules/object-property-newline.js +0 -151
  427. package/packages/config-eslint/node_modules/eslint/lib/rules/object-shorthand.js +0 -652
  428. package/packages/config-eslint/node_modules/eslint/lib/rules/one-var-declaration-per-line.js +0 -117
  429. package/packages/config-eslint/node_modules/eslint/lib/rules/one-var.js +0 -717
  430. package/packages/config-eslint/node_modules/eslint/lib/rules/operator-assignment.js +0 -270
  431. package/packages/config-eslint/node_modules/eslint/lib/rules/operator-linebreak.js +0 -315
  432. package/packages/config-eslint/node_modules/eslint/lib/rules/padded-blocks.js +0 -366
  433. package/packages/config-eslint/node_modules/eslint/lib/rules/padding-line-between-statements.js +0 -612
  434. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-arrow-callback.js +0 -444
  435. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-const.js +0 -554
  436. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-destructuring.js +0 -332
  437. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-exponentiation-operator.js +0 -235
  438. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-named-capture-group.js +0 -197
  439. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-numeric-literals.js +0 -157
  440. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-object-has-own.js +0 -148
  441. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-object-spread.js +0 -319
  442. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-promise-reject-errors.js +0 -154
  443. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-reflect.js +0 -150
  444. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-regex-literals.js +0 -605
  445. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-rest-params.js +0 -125
  446. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-spread.js +0 -91
  447. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-template.js +0 -347
  448. package/packages/config-eslint/node_modules/eslint/lib/rules/preserve-caught-error.js +0 -535
  449. package/packages/config-eslint/node_modules/eslint/lib/rules/quote-props.js +0 -394
  450. package/packages/config-eslint/node_modules/eslint/lib/rules/quotes.js +0 -416
  451. package/packages/config-eslint/node_modules/eslint/lib/rules/radix.js +0 -199
  452. package/packages/config-eslint/node_modules/eslint/lib/rules/require-atomic-updates.js +0 -365
  453. package/packages/config-eslint/node_modules/eslint/lib/rules/require-await.js +0 -184
  454. package/packages/config-eslint/node_modules/eslint/lib/rules/require-unicode-regexp.js +0 -317
  455. package/packages/config-eslint/node_modules/eslint/lib/rules/require-yield.js +0 -86
  456. package/packages/config-eslint/node_modules/eslint/lib/rules/rest-spread-spacing.js +0 -150
  457. package/packages/config-eslint/node_modules/eslint/lib/rules/semi-spacing.js +0 -297
  458. package/packages/config-eslint/node_modules/eslint/lib/rules/semi-style.js +0 -218
  459. package/packages/config-eslint/node_modules/eslint/lib/rules/semi.js +0 -476
  460. package/packages/config-eslint/node_modules/eslint/lib/rules/sort-imports.js +0 -319
  461. package/packages/config-eslint/node_modules/eslint/lib/rules/sort-keys.js +0 -268
  462. package/packages/config-eslint/node_modules/eslint/lib/rules/sort-vars.js +0 -140
  463. package/packages/config-eslint/node_modules/eslint/lib/rules/space-before-blocks.js +0 -232
  464. package/packages/config-eslint/node_modules/eslint/lib/rules/space-before-function-paren.js +0 -202
  465. package/packages/config-eslint/node_modules/eslint/lib/rules/space-in-parens.js +0 -374
  466. package/packages/config-eslint/node_modules/eslint/lib/rules/space-infix-ops.js +0 -249
  467. package/packages/config-eslint/node_modules/eslint/lib/rules/space-unary-ops.js +0 -400
  468. package/packages/config-eslint/node_modules/eslint/lib/rules/spaced-comment.js +0 -447
  469. package/packages/config-eslint/node_modules/eslint/lib/rules/strict.js +0 -324
  470. package/packages/config-eslint/node_modules/eslint/lib/rules/switch-colon-spacing.js +0 -158
  471. package/packages/config-eslint/node_modules/eslint/lib/rules/symbol-description.js +0 -70
  472. package/packages/config-eslint/node_modules/eslint/lib/rules/template-curly-spacing.js +0 -168
  473. package/packages/config-eslint/node_modules/eslint/lib/rules/template-tag-spacing.js +0 -121
  474. package/packages/config-eslint/node_modules/eslint/lib/rules/unicode-bom.js +0 -73
  475. package/packages/config-eslint/node_modules/eslint/lib/rules/use-isnan.js +0 -268
  476. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/ast-utils.js +0 -2848
  477. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/char-source.js +0 -247
  478. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/fix-tracker.js +0 -125
  479. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/keywords.js +0 -67
  480. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/lazy-loading-rule-map.js +0 -118
  481. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/regular-expressions.js +0 -58
  482. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/unicode/index.js +0 -16
  483. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/unicode/is-combining-character.js +0 -13
  484. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/unicode/is-emoji-modifier.js +0 -13
  485. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/unicode/is-regional-indicator-symbol.js +0 -13
  486. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/unicode/is-surrogate-pair.js +0 -14
  487. package/packages/config-eslint/node_modules/eslint/lib/rules/valid-typeof.js +0 -171
  488. package/packages/config-eslint/node_modules/eslint/lib/rules/vars-on-top.js +0 -165
  489. package/packages/config-eslint/node_modules/eslint/lib/rules/wrap-iife.js +0 -238
  490. package/packages/config-eslint/node_modules/eslint/lib/rules/wrap-regex.js +0 -91
  491. package/packages/config-eslint/node_modules/eslint/lib/rules/yield-star-spacing.js +0 -158
  492. package/packages/config-eslint/node_modules/eslint/lib/rules/yoda.js +0 -362
  493. package/packages/config-eslint/node_modules/eslint/lib/services/parser-service.js +0 -64
  494. package/packages/config-eslint/node_modules/eslint/lib/services/processor-service.js +0 -100
  495. package/packages/config-eslint/node_modules/eslint/lib/services/suppressions-service.js +0 -302
  496. package/packages/config-eslint/node_modules/eslint/lib/services/warning-service.js +0 -87
  497. package/packages/config-eslint/node_modules/eslint/lib/shared/ajv.js +0 -34
  498. package/packages/config-eslint/node_modules/eslint/lib/shared/assert.js +0 -21
  499. package/packages/config-eslint/node_modules/eslint/lib/shared/ast-utils.js +0 -30
  500. package/packages/config-eslint/node_modules/eslint/lib/shared/deep-merge-arrays.js +0 -62
  501. package/packages/config-eslint/node_modules/eslint/lib/shared/directives.js +0 -16
  502. package/packages/config-eslint/node_modules/eslint/lib/shared/flags.js +0 -89
  503. package/packages/config-eslint/node_modules/eslint/lib/shared/logging.js +0 -38
  504. package/packages/config-eslint/node_modules/eslint/lib/shared/naming.js +0 -109
  505. package/packages/config-eslint/node_modules/eslint/lib/shared/option-utils.js +0 -63
  506. package/packages/config-eslint/node_modules/eslint/lib/shared/relative-module-resolver.js +0 -28
  507. package/packages/config-eslint/node_modules/eslint/lib/shared/runtime-info.js +0 -177
  508. package/packages/config-eslint/node_modules/eslint/lib/shared/serialization.js +0 -78
  509. package/packages/config-eslint/node_modules/eslint/lib/shared/severity.js +0 -49
  510. package/packages/config-eslint/node_modules/eslint/lib/shared/stats.js +0 -30
  511. package/packages/config-eslint/node_modules/eslint/lib/shared/string-utils.js +0 -58
  512. package/packages/config-eslint/node_modules/eslint/lib/shared/text-table.js +0 -68
  513. package/packages/config-eslint/node_modules/eslint/lib/shared/translate-cli-options.js +0 -223
  514. package/packages/config-eslint/node_modules/eslint/lib/shared/traverser.js +0 -202
  515. package/packages/config-eslint/node_modules/eslint/lib/types/config-api.d.ts +0 -12
  516. package/packages/config-eslint/node_modules/eslint/lib/types/index.d.ts +0 -1475
  517. package/packages/config-eslint/node_modules/eslint/lib/types/rules.d.ts +0 -5603
  518. package/packages/config-eslint/node_modules/eslint/lib/types/universal.d.ts +0 -6
  519. package/packages/config-eslint/node_modules/eslint/lib/types/use-at-your-own-risk.d.ts +0 -34
  520. package/packages/config-eslint/node_modules/eslint/lib/universal.js +0 -10
  521. package/packages/config-eslint/node_modules/eslint/lib/unsupported-api.js +0 -21
  522. package/packages/config-eslint/node_modules/eslint/messages/all-matched-files-ignored.js +0 -21
  523. package/packages/config-eslint/node_modules/eslint/messages/config-file-missing.js +0 -16
  524. package/packages/config-eslint/node_modules/eslint/messages/config-plugin-missing.js +0 -14
  525. package/packages/config-eslint/node_modules/eslint/messages/config-serialize-function.js +0 -30
  526. package/packages/config-eslint/node_modules/eslint/messages/eslintrc-incompat.js +0 -117
  527. package/packages/config-eslint/node_modules/eslint/messages/eslintrc-plugins.js +0 -27
  528. package/packages/config-eslint/node_modules/eslint/messages/extend-config-missing.js +0 -13
  529. package/packages/config-eslint/node_modules/eslint/messages/failed-to-read-json.js +0 -11
  530. package/packages/config-eslint/node_modules/eslint/messages/file-not-found.js +0 -10
  531. package/packages/config-eslint/node_modules/eslint/messages/invalid-rule-options.js +0 -17
  532. package/packages/config-eslint/node_modules/eslint/messages/invalid-rule-severity.js +0 -13
  533. package/packages/config-eslint/node_modules/eslint/messages/no-config-found.js +0 -15
  534. package/packages/config-eslint/node_modules/eslint/messages/plugin-conflict.js +0 -22
  535. package/packages/config-eslint/node_modules/eslint/messages/plugin-invalid.js +0 -16
  536. package/packages/config-eslint/node_modules/eslint/messages/plugin-missing.js +0 -19
  537. package/packages/config-eslint/node_modules/eslint/messages/shared.js +0 -23
  538. package/packages/config-eslint/node_modules/eslint/messages/whitespace-found.js +0 -11
  539. package/packages/config-eslint/node_modules/eslint/package.json +0 -220
  540. package/packages/config-eslint/node_modules/eslint-visitor-keys/LICENSE +0 -201
  541. package/packages/config-eslint/node_modules/eslint-visitor-keys/README.md +0 -123
  542. package/packages/config-eslint/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.cjs +0 -187
  543. package/packages/config-eslint/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.d.cts +0 -28
  544. package/packages/config-eslint/node_modules/eslint-visitor-keys/dist/index.d.ts +0 -16
  545. package/packages/config-eslint/node_modules/eslint-visitor-keys/dist/visitor-keys.d.ts +0 -12
  546. package/packages/config-eslint/node_modules/eslint-visitor-keys/lib/index.js +0 -67
  547. package/packages/config-eslint/node_modules/eslint-visitor-keys/lib/visitor-keys.js +0 -118
  548. package/packages/config-eslint/node_modules/eslint-visitor-keys/package.json +0 -57
  549. package/packages/config-eslint/node_modules/espree/LICENSE +0 -25
  550. package/packages/config-eslint/node_modules/espree/README.md +0 -261
  551. package/packages/config-eslint/node_modules/espree/dist/espree.cjs +0 -1284
  552. package/packages/config-eslint/node_modules/espree/dist/espree.d.cts +0 -3
  553. package/packages/config-eslint/node_modules/espree/dist/espree.d.cts.map +0 -1
  554. package/packages/config-eslint/node_modules/espree/dist/espree.d.ts +0 -67
  555. package/packages/config-eslint/node_modules/espree/dist/espree.d.ts.map +0 -1
  556. package/packages/config-eslint/node_modules/espree/espree.js +0 -287
  557. package/packages/config-eslint/node_modules/espree/lib/espree.js +0 -493
  558. package/packages/config-eslint/node_modules/espree/lib/options.js +0 -176
  559. package/packages/config-eslint/node_modules/espree/lib/token-translator.js +0 -306
  560. package/packages/config-eslint/node_modules/espree/lib/types.js +0 -118
  561. package/packages/config-eslint/node_modules/espree/package.json +0 -70
  562. package/packages/config-eslint/node_modules/ignore/LICENSE-MIT +0 -21
  563. package/packages/config-eslint/node_modules/ignore/README.md +0 -412
  564. package/packages/config-eslint/node_modules/ignore/index.d.ts +0 -61
  565. package/packages/config-eslint/node_modules/ignore/index.js +0 -636
  566. package/packages/config-eslint/node_modules/ignore/legacy.js +0 -559
  567. package/packages/config-eslint/node_modules/ignore/package.json +0 -74
  568. package/packages/config-eslint/node_modules/json-schema-traverse/.eslintrc.yml +0 -27
  569. package/packages/config-eslint/node_modules/json-schema-traverse/.travis.yml +0 -8
  570. package/packages/config-eslint/node_modules/json-schema-traverse/LICENSE +0 -21
  571. package/packages/config-eslint/node_modules/json-schema-traverse/README.md +0 -83
  572. package/packages/config-eslint/node_modules/json-schema-traverse/index.js +0 -89
  573. package/packages/config-eslint/node_modules/json-schema-traverse/package.json +0 -43
  574. package/packages/config-eslint/node_modules/json-schema-traverse/spec/.eslintrc.yml +0 -6
  575. package/packages/config-eslint/node_modules/json-schema-traverse/spec/fixtures/schema.js +0 -125
  576. package/packages/config-eslint/node_modules/json-schema-traverse/spec/index.spec.js +0 -171
  577. package/packages/config-eslint/node_modules/minimatch/LICENSE.md +0 -55
  578. package/packages/config-eslint/node_modules/minimatch/README.md +0 -528
  579. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts +0 -2
  580. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts.map +0 -1
  581. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js +0 -14
  582. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js.map +0 -1
  583. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/ast.d.ts +0 -22
  584. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/ast.d.ts.map +0 -1
  585. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/ast.js +0 -846
  586. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/ast.js.map +0 -1
  587. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts +0 -8
  588. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts.map +0 -1
  589. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/brace-expressions.js +0 -150
  590. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/brace-expressions.js.map +0 -1
  591. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/escape.d.ts +0 -15
  592. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/escape.d.ts.map +0 -1
  593. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/escape.js +0 -30
  594. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/escape.js.map +0 -1
  595. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/index.d.ts +0 -174
  596. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/index.d.ts.map +0 -1
  597. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/index.js +0 -1121
  598. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/index.js.map +0 -1
  599. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/package.json +0 -3
  600. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/unescape.d.ts +0 -22
  601. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/unescape.d.ts.map +0 -1
  602. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/unescape.js +0 -38
  603. package/packages/config-eslint/node_modules/minimatch/dist/commonjs/unescape.js.map +0 -1
  604. package/packages/config-eslint/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts +0 -2
  605. package/packages/config-eslint/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts.map +0 -1
  606. package/packages/config-eslint/node_modules/minimatch/dist/esm/assert-valid-pattern.js +0 -10
  607. package/packages/config-eslint/node_modules/minimatch/dist/esm/assert-valid-pattern.js.map +0 -1
  608. package/packages/config-eslint/node_modules/minimatch/dist/esm/ast.d.ts +0 -22
  609. package/packages/config-eslint/node_modules/minimatch/dist/esm/ast.d.ts.map +0 -1
  610. package/packages/config-eslint/node_modules/minimatch/dist/esm/ast.js +0 -842
  611. package/packages/config-eslint/node_modules/minimatch/dist/esm/ast.js.map +0 -1
  612. package/packages/config-eslint/node_modules/minimatch/dist/esm/brace-expressions.d.ts +0 -8
  613. package/packages/config-eslint/node_modules/minimatch/dist/esm/brace-expressions.d.ts.map +0 -1
  614. package/packages/config-eslint/node_modules/minimatch/dist/esm/brace-expressions.js +0 -146
  615. package/packages/config-eslint/node_modules/minimatch/dist/esm/brace-expressions.js.map +0 -1
  616. package/packages/config-eslint/node_modules/minimatch/dist/esm/escape.d.ts +0 -15
  617. package/packages/config-eslint/node_modules/minimatch/dist/esm/escape.d.ts.map +0 -1
  618. package/packages/config-eslint/node_modules/minimatch/dist/esm/escape.js +0 -26
  619. package/packages/config-eslint/node_modules/minimatch/dist/esm/escape.js.map +0 -1
  620. package/packages/config-eslint/node_modules/minimatch/dist/esm/index.d.ts +0 -174
  621. package/packages/config-eslint/node_modules/minimatch/dist/esm/index.d.ts.map +0 -1
  622. package/packages/config-eslint/node_modules/minimatch/dist/esm/index.js +0 -1108
  623. package/packages/config-eslint/node_modules/minimatch/dist/esm/index.js.map +0 -1
  624. package/packages/config-eslint/node_modules/minimatch/dist/esm/package.json +0 -3
  625. package/packages/config-eslint/node_modules/minimatch/dist/esm/unescape.d.ts +0 -22
  626. package/packages/config-eslint/node_modules/minimatch/dist/esm/unescape.d.ts.map +0 -1
  627. package/packages/config-eslint/node_modules/minimatch/dist/esm/unescape.js +0 -34
  628. package/packages/config-eslint/node_modules/minimatch/dist/esm/unescape.js.map +0 -1
  629. package/packages/config-eslint/node_modules/minimatch/package.json +0 -67
@@ -1,1614 +0,0 @@
1
- /**
2
- * @fileoverview Main Linter Class
3
- * @author Gyandeep Singh
4
- * @author aladdin-add
5
- */
6
-
7
- "use strict";
8
-
9
- //------------------------------------------------------------------------------
10
- // Requirements
11
- //------------------------------------------------------------------------------
12
-
13
- const path = require("node:path"),
14
- eslintScope = require("eslint-scope"),
15
- evk = require("eslint-visitor-keys"),
16
- pkg = require("../../package.json"),
17
- Traverser = require("../shared/traverser"),
18
- { SourceCode } = require("../languages/js/source-code"),
19
- applyDisableDirectives = require("./apply-disable-directives"),
20
- { ConfigCommentParser } = require("@eslint/plugin-kit"),
21
- SourceCodeFixer = require("./source-code-fixer"),
22
- { SourceCodeVisitor } = require("./source-code-visitor"),
23
- timing = require("./timing");
24
- const { FlatConfigArray } = require("../config/flat-config-array");
25
- const { startTime, endTime } = require("../shared/stats");
26
- const { assertIsRuleSeverity } = require("../config/flat-config-schema");
27
- const {
28
- normalizeSeverityToString,
29
- normalizeSeverityToNumber,
30
- } = require("../shared/severity");
31
- const { deepMergeArrays } = require("../shared/deep-merge-arrays");
32
- const {
33
- activeFlags,
34
- inactiveFlags,
35
- getInactivityReasonMessage,
36
- } = require("../shared/flags");
37
- const debug = require("debug")("eslint:linter");
38
- const MAX_AUTOFIX_PASSES = 10;
39
- const DEFAULT_ECMA_VERSION = 5;
40
- const commentParser = new ConfigCommentParser();
41
- const { VFile } = require("./vfile");
42
- const { ParserService } = require("../services/parser-service");
43
- const { FileContext } = require("./file-context");
44
- const { ProcessorService } = require("../services/processor-service");
45
- const { containsDifferentProperty } = require("../shared/option-utils");
46
- const { Config } = require("../config/config");
47
- const { WarningService } = require("../services/warning-service");
48
- const { SourceCodeTraverser } = require("./source-code-traverser");
49
- const { FileReport, updateLocationInformation } = require("./file-report");
50
-
51
- //------------------------------------------------------------------------------
52
- // Typedefs
53
- //------------------------------------------------------------------------------
54
-
55
- /** @import { Language, LanguageOptions, RuleConfig, RuleDefinition } from "@eslint/core" */
56
-
57
- /** @typedef {import("../types").Linter.Config} ConfigObject */
58
- /** @typedef {import("../types").Linter.LanguageOptions} JSLanguageOptions */
59
- /** @typedef {import("../types").Linter.LintMessage} LintMessage */
60
- /** @typedef {import("../types").Linter.Parser} Parser */
61
- /** @typedef {import("../types").Linter.ParserOptions} ParserOptions */
62
- /** @typedef {import("../types").Linter.Processor} Processor */
63
- /** @typedef {import("../types").Rule.RuleModule} Rule */
64
- /** @typedef {import("../types").Linter.StringSeverity} StringSeverity */
65
- /** @typedef {import("../types").Linter.SuppressedLintMessage} SuppressedLintMessage */
66
- /** @typedef {import("../types").Linter.TimePass} TimePass */
67
-
68
- /* eslint-disable jsdoc/valid-types -- https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/4#issuecomment-778805577 */
69
- /**
70
- * @template T
71
- * @typedef {{ [P in keyof T]-?: T[P] }} Required
72
- */
73
- /* eslint-enable jsdoc/valid-types -- https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/4#issuecomment-778805577 */
74
-
75
- /**
76
- * @typedef {Object} DisableDirective
77
- * @property {("disable"|"enable"|"disable-line"|"disable-next-line")} type Type of directive
78
- * @property {number} line The line number
79
- * @property {number} column The column number
80
- * @property {(string|null)} ruleId The rule ID
81
- * @property {string} justification The justification of directive
82
- */
83
-
84
- /**
85
- * The private data for `Linter` instance.
86
- * @typedef {Object} LinterInternalSlots
87
- * @property {FlatConfigArray|null} lastConfigArray The `ConfigArray` instance that the last `verify()` call used.
88
- * @property {SourceCode|null} lastSourceCode The `SourceCode` instance that the last `verify()` call used.
89
- * @property {SuppressedLintMessage[]} lastSuppressedMessages The `SuppressedLintMessage[]` instance that the last `verify()` call produced.
90
- * @property {{ passes: TimePass[]; }} times The times spent on applying a rule to a file (see `stats` option).
91
- * @property {WarningService} warningService The warning service.
92
- */
93
-
94
- /**
95
- * @typedef {Object} VerifyOptions
96
- * @property {boolean} [allowInlineConfig] Allow/disallow inline comments' ability
97
- * to change config once it is set. Defaults to true if not supplied.
98
- * Useful if you want to validate JS without comments overriding rules.
99
- * @property {boolean} [disableFixes] if `true` then the linter doesn't make `fix`
100
- * properties into the lint result.
101
- * @property {string} [filename] the filename of the source code.
102
- * @property {boolean | "off" | "warn" | "error"} [reportUnusedDisableDirectives] Adds reported errors for
103
- * unused `eslint-disable` directives.
104
- * @property {Function} [ruleFilter] A predicate function that determines whether a given rule should run.
105
- */
106
-
107
- /**
108
- * @typedef {Object} ProcessorOptions
109
- * @property {(filename:string, text:string) => boolean} [filterCodeBlock] the
110
- * predicate function that selects adopt code blocks.
111
- * @property {Processor.postprocess} [postprocess] postprocessor for report
112
- * messages. If provided, this should accept an array of the message lists
113
- * for each code block returned from the preprocessor, apply a mapping to
114
- * the messages as appropriate, and return a one-dimensional array of
115
- * messages.
116
- * @property {Processor.preprocess} [preprocess] preprocessor for source text.
117
- * If provided, this should accept a string of source text, and return an
118
- * array of code blocks to lint.
119
- */
120
-
121
- /**
122
- * @typedef {Object} FixOptions
123
- * @property {boolean | ((message: LintMessage) => boolean)} [fix] Determines
124
- * whether fixes should be applied.
125
- */
126
-
127
- /**
128
- * @typedef {Object} InternalOptions
129
- * @property {string | null} warnInlineConfig The config name what `noInlineConfig` setting came from. If `noInlineConfig` setting didn't exist, this is null. If this is a config name, then the linter warns directive comments.
130
- * @property {StringSeverity} reportUnusedDisableDirectives Severity to report unused disable directives, if not "off" (boolean values were normalized).
131
- * @property {StringSeverity} reportUnusedInlineConfigs Severity to report unused inline configs, if not "off".
132
- */
133
-
134
- //------------------------------------------------------------------------------
135
- // Helpers
136
- //------------------------------------------------------------------------------
137
-
138
- /**
139
- * Wraps the value in an Array if it isn't already one.
140
- * @template T
141
- * @param {T|T[]} value Value to be wrapped.
142
- * @returns {Array} The value as an array.
143
- */
144
- function asArray(value) {
145
- return Array.isArray(value) ? value : [value];
146
- }
147
-
148
- /**
149
- * Pushes a problem to inlineConfigProblems if ruleOptions are redundant.
150
- * @param {Config} config Provided config.
151
- * @param {Object} loc A line/column location
152
- * @param {FileReport} report Report that may be added to.
153
- * @param {string} ruleId The rule ID.
154
- * @param {Array} ruleOptions The rule options, merged with the config's.
155
- * @param {Array} ruleOptionsInline The rule options from the comment.
156
- * @param {"error"|"warn"} severity The severity to report.
157
- * @returns {void}
158
- */
159
- function addProblemIfSameSeverityAndOptions(
160
- config,
161
- loc,
162
- report,
163
- ruleId,
164
- ruleOptions,
165
- ruleOptionsInline,
166
- severity,
167
- ) {
168
- const existingConfigRaw = config.rules?.[ruleId];
169
- const existingConfig = existingConfigRaw
170
- ? asArray(existingConfigRaw)
171
- : ["off"];
172
- const existingSeverity = normalizeSeverityToString(existingConfig[0]);
173
- const inlineSeverity = normalizeSeverityToString(ruleOptions[0]);
174
- const sameSeverity = existingSeverity === inlineSeverity;
175
-
176
- if (!sameSeverity) {
177
- return;
178
- }
179
-
180
- const alreadyConfigured = existingConfigRaw
181
- ? `is already configured to '${existingSeverity}'`
182
- : "is not enabled so can't be turned off";
183
- let message;
184
-
185
- if (
186
- (existingConfig.length === 1 && ruleOptions.length === 1) ||
187
- existingSeverity === "off"
188
- ) {
189
- message = `Unused inline config ('${ruleId}' ${alreadyConfigured}).`;
190
- } else if (
191
- !containsDifferentProperty(
192
- ruleOptions.slice(1),
193
- existingConfig.slice(1),
194
- )
195
- ) {
196
- message =
197
- ruleOptionsInline.length === 1
198
- ? `Unused inline config ('${ruleId}' ${alreadyConfigured}).`
199
- : `Unused inline config ('${ruleId}' ${alreadyConfigured} with the same options).`;
200
- }
201
-
202
- if (message) {
203
- const numericSeverity = normalizeSeverityToNumber(severity);
204
- const descriptor = {
205
- message,
206
- loc,
207
- };
208
-
209
- if (numericSeverity === 1) {
210
- report.addWarning(descriptor);
211
- } else if (numericSeverity === 2) {
212
- report.addError(descriptor);
213
- }
214
- }
215
- }
216
-
217
- /**
218
- * Creates a collection of disable directives from a comment
219
- * @param {Object} options to create disable directives
220
- * @param {("disable"|"enable"|"disable-line"|"disable-next-line")} options.type The type of directive comment
221
- * @param {string} options.value The value after the directive in the comment
222
- * comment specified no specific rules, so it applies to all rules (e.g. `eslint-disable`)
223
- * @param {string} options.justification The justification of the directive
224
- * @param {ASTNode|token} options.node The Comment node/token.
225
- * @param {function(string): {create: Function}} ruleMapper A map from rule IDs to defined rules
226
- * @param {Language} language The language to use to adjust the location information.
227
- * @param {SourceCode} sourceCode The SourceCode object to get comments from.
228
- * @param {FileReport} report The report to add problems to.
229
- * @returns {Object[]} Directives from the comment
230
- */
231
- function createDisableDirectives(
232
- { type, value, justification, node },
233
- ruleMapper,
234
- language,
235
- sourceCode,
236
- report,
237
- ) {
238
- const ruleIds = Object.keys(commentParser.parseListConfig(value));
239
- const directiveRules = ruleIds.length ? ruleIds : [null];
240
- const directives = []; // valid disable directives
241
- const parentDirective = { node, value, ruleIds };
242
-
243
- for (const ruleId of directiveRules) {
244
- const loc = sourceCode.getLoc(node);
245
-
246
- // push to directives, if the rule is defined(including null, e.g. /*eslint enable*/)
247
- if (ruleId === null || !!ruleMapper(ruleId)) {
248
- if (type === "disable-next-line") {
249
- const { line, column } = updateLocationInformation(
250
- loc.end,
251
- language,
252
- );
253
-
254
- directives.push({
255
- parentDirective,
256
- type,
257
- line,
258
- column,
259
- ruleId,
260
- justification,
261
- });
262
- } else {
263
- const { line, column } = updateLocationInformation(
264
- loc.start,
265
- language,
266
- );
267
-
268
- directives.push({
269
- parentDirective,
270
- type,
271
- line,
272
- column,
273
- ruleId,
274
- justification,
275
- });
276
- }
277
- } else {
278
- report.addError({ ruleId, loc });
279
- }
280
- }
281
-
282
- return directives;
283
- }
284
-
285
- /**
286
- * Parses comments in file to extract disable directives.
287
- * @param {SourceCode} sourceCode The SourceCode object to get comments from.
288
- * @param {function(string): {create: Function}} ruleMapper A map from rule IDs to defined rules
289
- * @param {Language} language The language to use to adjust the location information
290
- * @param {FileReport} report The report to add problems to.
291
- * @returns {DisableDirective[]}
292
- * A collection of the directive comments that were found, along with any problems that occurred when parsing
293
- */
294
- function getDirectiveCommentsForFlatConfig(
295
- sourceCode,
296
- ruleMapper,
297
- language,
298
- report,
299
- ) {
300
- const disableDirectives = [];
301
-
302
- if (sourceCode.getDisableDirectives) {
303
- const { directives: directivesSources, problems: directivesProblems } =
304
- sourceCode.getDisableDirectives();
305
-
306
- if (Array.isArray(directivesProblems)) {
307
- directivesProblems.forEach(problem => report.addError(problem));
308
- }
309
-
310
- directivesSources.forEach(directive => {
311
- const directives = createDisableDirectives(
312
- directive,
313
- ruleMapper,
314
- language,
315
- sourceCode,
316
- report,
317
- );
318
-
319
- disableDirectives.push(...directives);
320
- });
321
- }
322
-
323
- return disableDirectives;
324
- }
325
-
326
- /**
327
- * Convert "/path/to/<text>" to "<text>".
328
- * `CLIEngine#executeOnText()` method gives "/path/to/<text>" if the filename
329
- * was omitted because `configArray.extractConfig()` requires an absolute path.
330
- * But the linter should pass `<text>` to `RuleContext#filename` in that
331
- * case.
332
- * Also, code blocks can have their virtual filename. If the parent filename was
333
- * `<text>`, the virtual filename is `<text>/0_foo.js` or something like (i.e.,
334
- * it's not an absolute path).
335
- * @param {string} filename The filename to normalize.
336
- * @returns {string} The normalized filename.
337
- */
338
- function normalizeFilename(filename) {
339
- const parts = filename.split(path.sep);
340
- const index = parts.lastIndexOf("<text>");
341
-
342
- return index === -1 ? filename : parts.slice(index).join(path.sep);
343
- }
344
-
345
- /**
346
- * Normalizes the possible options for `linter.verify` and `linter.verifyAndFix` to a
347
- * consistent shape.
348
- * @param {VerifyOptions} providedOptions Options
349
- * @param {Config} config Config.
350
- * @returns {Required<VerifyOptions> & InternalOptions} Normalized options
351
- */
352
- function normalizeVerifyOptions(providedOptions, config) {
353
- const linterOptions = config.linterOptions || config;
354
- const disableInlineConfig = linterOptions.noInlineConfig === true;
355
- const ignoreInlineConfig = providedOptions.allowInlineConfig === false;
356
- const configNameOfNoInlineConfig = config.configNameOfNoInlineConfig
357
- ? ` (${config.configNameOfNoInlineConfig})`
358
- : "";
359
-
360
- let reportUnusedDisableDirectives =
361
- providedOptions.reportUnusedDisableDirectives;
362
-
363
- if (typeof reportUnusedDisableDirectives === "boolean") {
364
- reportUnusedDisableDirectives = reportUnusedDisableDirectives
365
- ? "error"
366
- : "off";
367
- }
368
- if (typeof reportUnusedDisableDirectives !== "string") {
369
- if (typeof linterOptions.reportUnusedDisableDirectives === "boolean") {
370
- reportUnusedDisableDirectives =
371
- linterOptions.reportUnusedDisableDirectives ? "warn" : "off";
372
- } else {
373
- reportUnusedDisableDirectives =
374
- linterOptions.reportUnusedDisableDirectives === void 0
375
- ? "off"
376
- : normalizeSeverityToString(
377
- linterOptions.reportUnusedDisableDirectives,
378
- );
379
- }
380
- }
381
-
382
- const reportUnusedInlineConfigs =
383
- linterOptions.reportUnusedInlineConfigs === void 0
384
- ? "off"
385
- : normalizeSeverityToString(
386
- linterOptions.reportUnusedInlineConfigs,
387
- );
388
-
389
- let ruleFilter = providedOptions.ruleFilter;
390
-
391
- if (typeof ruleFilter !== "function") {
392
- ruleFilter = () => true;
393
- }
394
-
395
- return {
396
- filename: normalizeFilename(providedOptions.filename || "<input>"),
397
- allowInlineConfig: !ignoreInlineConfig,
398
- warnInlineConfig:
399
- disableInlineConfig && !ignoreInlineConfig
400
- ? `your config${configNameOfNoInlineConfig}`
401
- : null,
402
- reportUnusedDisableDirectives,
403
- reportUnusedInlineConfigs,
404
- disableFixes: Boolean(providedOptions.disableFixes),
405
- stats: providedOptions.stats,
406
- ruleFilter,
407
- };
408
- }
409
-
410
- /**
411
- * Store time measurements in map
412
- * @param {number} time Time measurement
413
- * @param {Object} timeOpts Options relating which time was measured
414
- * @param {WeakMap<Linter, LinterInternalSlots>} slots Linter internal slots map
415
- * @returns {void}
416
- */
417
- function storeTime(time, timeOpts, slots) {
418
- const { type, key } = timeOpts;
419
-
420
- if (!slots.times) {
421
- slots.times = { passes: [{}] };
422
- }
423
-
424
- const passIndex = slots.fixPasses;
425
-
426
- if (passIndex > slots.times.passes.length - 1) {
427
- slots.times.passes.push({});
428
- }
429
-
430
- if (key) {
431
- slots.times.passes[passIndex][type] ??= {};
432
- slots.times.passes[passIndex][type][key] ??= { total: 0 };
433
- slots.times.passes[passIndex][type][key].total += time;
434
- } else {
435
- slots.times.passes[passIndex][type] ??= { total: 0 };
436
- slots.times.passes[passIndex][type].total += time;
437
- }
438
- }
439
-
440
- /**
441
- * Get the options for a rule (not including severity), if any
442
- * @param {RuleConfig} ruleConfig rule configuration
443
- * @param {Object|undefined} defaultOptions rule.meta.defaultOptions
444
- * @returns {Array} of rule options, empty Array if none
445
- */
446
- function getRuleOptions(ruleConfig, defaultOptions) {
447
- if (Array.isArray(ruleConfig)) {
448
- return deepMergeArrays(defaultOptions, ruleConfig.slice(1));
449
- }
450
- return defaultOptions ?? [];
451
- }
452
-
453
- /**
454
- * Analyze scope of the given AST.
455
- * @param {ASTNode} ast The `Program` node to analyze.
456
- * @param {JSLanguageOptions} languageOptions The language options.
457
- * @param {Record<string, string[]>} visitorKeys The visitor keys.
458
- * @returns {ScopeManager} The analysis result.
459
- */
460
- function analyzeScope(ast, languageOptions, visitorKeys) {
461
- const parserOptions = languageOptions.parserOptions;
462
- const ecmaFeatures = parserOptions.ecmaFeatures || {};
463
- const ecmaVersion = languageOptions.ecmaVersion || DEFAULT_ECMA_VERSION;
464
-
465
- return eslintScope.analyze(ast, {
466
- ignoreEval: true,
467
- nodejsScope: ecmaFeatures.globalReturn,
468
- impliedStrict: ecmaFeatures.impliedStrict,
469
- ecmaVersion: typeof ecmaVersion === "number" ? ecmaVersion : 6,
470
- sourceType: languageOptions.sourceType || "script",
471
- childVisitorKeys: visitorKeys || evk.KEYS,
472
- fallback: Traverser.getKeys,
473
- jsx: ecmaFeatures.jsx,
474
- });
475
- }
476
-
477
- /**
478
- * Runs a rule, and gets its listeners
479
- * @param {RuleDefinition} rule A rule object
480
- * @param {Context} ruleContext The context that should be passed to the rule
481
- * @throws {TypeError} If `rule` is not an object with a `create` method
482
- * @throws {any} Any error during the rule's `create`
483
- * @returns {Object} A map of selector listeners provided by the rule
484
- */
485
- function createRuleListeners(rule, ruleContext) {
486
- if (
487
- !rule ||
488
- typeof rule !== "object" ||
489
- typeof rule.create !== "function"
490
- ) {
491
- throw new TypeError(
492
- `Error while loading rule '${ruleContext.id}': Rule must be an object with a \`create\` method`,
493
- );
494
- }
495
-
496
- try {
497
- return rule.create(ruleContext);
498
- } catch (ex) {
499
- ex.message = `Error while loading rule '${ruleContext.id}': ${ex.message}`;
500
- throw ex;
501
- }
502
- }
503
-
504
- /**
505
- * Runs the given rules on the given SourceCode object
506
- * @param {SourceCode} sourceCode A SourceCode object for the given text
507
- * @param {Object} configuredRules The rules configuration
508
- * @param {function(string): RuleDefinition} ruleMapper A mapper function from rule names to rules
509
- * @param {Language} language The language object used for parsing.
510
- * @param {LanguageOptions} languageOptions The options for parsing the code.
511
- * @param {Object} settings The settings that were enabled in the config
512
- * @param {string} filename The reported filename of the code
513
- * @param {boolean} applyDefaultOptions If true, apply rules' meta.defaultOptions in computing their config options.
514
- * @param {string | undefined} cwd cwd of the cli
515
- * @param {string} physicalFilename The full path of the file on disk without any code block information
516
- * @param {Function} ruleFilter A predicate function to filter which rules should be executed.
517
- * @param {boolean} stats If true, stats are collected appended to the result
518
- * @param {WeakMap<Linter, LinterInternalSlots>} slots InternalSlotsMap of linter
519
- * @param {FileReport} report The report to add problems to
520
- * @returns {FileReport} report The report with added problems
521
- * @throws {Error} If traversal into a node fails.
522
- */
523
- function runRules(
524
- sourceCode,
525
- configuredRules,
526
- ruleMapper,
527
- language,
528
- languageOptions,
529
- settings,
530
- filename,
531
- applyDefaultOptions,
532
- cwd,
533
- physicalFilename,
534
- ruleFilter,
535
- stats,
536
- slots,
537
- report,
538
- ) {
539
- const visitor = new SourceCodeVisitor();
540
-
541
- /*
542
- * Create a frozen object with the ruleContext properties and methods that are shared by all rules.
543
- * All rule contexts will inherit from this object. This avoids the performance penalty of copying all the
544
- * properties once for each rule.
545
- */
546
- const fileContext = new FileContext({
547
- cwd,
548
- filename,
549
- physicalFilename: physicalFilename || filename,
550
- sourceCode,
551
- languageOptions,
552
- settings,
553
- });
554
-
555
- const steps = sourceCode.traverse();
556
-
557
- Object.keys(configuredRules).forEach(ruleId => {
558
- const severity = Config.getRuleNumericSeverity(configuredRules[ruleId]);
559
-
560
- // not load disabled rules
561
- if (severity === 0) {
562
- return;
563
- }
564
-
565
- if (ruleFilter && !ruleFilter({ ruleId, severity })) {
566
- return;
567
- }
568
-
569
- const rule = ruleMapper(ruleId);
570
-
571
- if (!rule) {
572
- report.addError({ ruleId });
573
- return;
574
- }
575
-
576
- const ruleContext = fileContext.extend({
577
- id: ruleId,
578
- options: getRuleOptions(
579
- configuredRules[ruleId],
580
- applyDefaultOptions ? rule.meta?.defaultOptions : void 0,
581
- ),
582
- report(...args) {
583
- const problem = report.addRuleMessage(
584
- ruleId,
585
- severity,
586
- ...args,
587
- );
588
-
589
- if (problem.fix && !(rule.meta && rule.meta.fixable)) {
590
- throw new Error(
591
- 'Fixable rules must set the `meta.fixable` property to "code" or "whitespace".',
592
- );
593
- }
594
-
595
- if (
596
- problem.suggestions &&
597
- !(rule.meta && rule.meta.hasSuggestions === true)
598
- ) {
599
- if (
600
- rule.meta &&
601
- rule.meta.docs &&
602
- typeof rule.meta.docs.suggestion !== "undefined"
603
- ) {
604
- // Encourage migration from the former property name.
605
- throw new Error(
606
- "Rules with suggestions must set the `meta.hasSuggestions` property to `true`. `meta.docs.suggestion` is ignored by ESLint.",
607
- );
608
- }
609
- throw new Error(
610
- "Rules with suggestions must set the `meta.hasSuggestions` property to `true`.",
611
- );
612
- }
613
- },
614
- });
615
-
616
- const ruleListenersReturn =
617
- timing.enabled || stats
618
- ? timing.time(
619
- ruleId,
620
- createRuleListeners,
621
- stats,
622
- )(rule, ruleContext)
623
- : createRuleListeners(rule, ruleContext);
624
-
625
- const ruleListeners = stats
626
- ? ruleListenersReturn.result
627
- : ruleListenersReturn;
628
-
629
- if (stats) {
630
- storeTime(
631
- ruleListenersReturn.tdiff,
632
- { type: "rules", key: ruleId },
633
- slots,
634
- );
635
- }
636
-
637
- /**
638
- * Include `ruleId` in error logs
639
- * @param {Function} ruleListener A rule method that listens for a node.
640
- * @returns {Function} ruleListener wrapped in error handler
641
- */
642
- function addRuleErrorHandler(ruleListener) {
643
- return function ruleErrorHandler(...listenerArgs) {
644
- try {
645
- const ruleListenerReturn = ruleListener(...listenerArgs);
646
-
647
- const ruleListenerResult = stats
648
- ? ruleListenerReturn.result
649
- : ruleListenerReturn;
650
-
651
- if (stats) {
652
- storeTime(
653
- ruleListenerReturn.tdiff,
654
- { type: "rules", key: ruleId },
655
- slots,
656
- );
657
- }
658
-
659
- return ruleListenerResult;
660
- } catch (e) {
661
- e.ruleId = ruleId;
662
- throw e;
663
- }
664
- };
665
- }
666
-
667
- if (typeof ruleListeners === "undefined" || ruleListeners === null) {
668
- throw new Error(
669
- `The create() function for rule '${ruleId}' did not return an object.`,
670
- );
671
- }
672
-
673
- // add all the selectors from the rule as listeners
674
- Object.keys(ruleListeners).forEach(selector => {
675
- const ruleListener =
676
- timing.enabled || stats
677
- ? timing.time(ruleId, ruleListeners[selector], stats)
678
- : ruleListeners[selector];
679
-
680
- visitor.add(selector, addRuleErrorHandler(ruleListener));
681
- });
682
- });
683
-
684
- const traverser = SourceCodeTraverser.getInstance(language);
685
-
686
- traverser.traverseSync(sourceCode, visitor, { steps });
687
-
688
- return report;
689
- }
690
-
691
- /**
692
- * Ensure the source code to be a string.
693
- * @param {string|SourceCode} textOrSourceCode The text or source code object.
694
- * @returns {string} The source code text.
695
- */
696
- function ensureText(textOrSourceCode) {
697
- if (typeof textOrSourceCode === "object") {
698
- const { hasBOM, text } = textOrSourceCode;
699
- const bom = hasBOM ? "\uFEFF" : "";
700
-
701
- return bom + text;
702
- }
703
-
704
- return String(textOrSourceCode);
705
- }
706
-
707
- /**
708
- * Normalize the value of the cwd
709
- * @param {string | undefined} cwd raw value of the cwd, path to a directory that should be considered as the current working directory, can be undefined.
710
- * @returns {string | undefined} normalized cwd
711
- */
712
- function normalizeCwd(cwd) {
713
- if (cwd) {
714
- return cwd;
715
- }
716
- if (typeof process === "object") {
717
- return process.cwd();
718
- }
719
-
720
- // It's more explicit to assign the undefined
721
- // eslint-disable-next-line no-undefined -- Consistently returning a value
722
- return undefined;
723
- }
724
-
725
- /**
726
- * The map to store private data.
727
- * @type {WeakMap<Linter, LinterInternalSlots>}
728
- */
729
- const internalSlotsMap = new WeakMap();
730
-
731
- //------------------------------------------------------------------------------
732
- // Public Interface
733
- //------------------------------------------------------------------------------
734
-
735
- /**
736
- * Object that is responsible for verifying JavaScript text
737
- * @name Linter
738
- */
739
- class Linter {
740
- /**
741
- * Initialize the Linter.
742
- * @param {Object} [config] the config object
743
- * @param {string} [config.cwd] path to a directory that should be considered as the current working directory, can be undefined.
744
- * @param {Array<string>} [config.flags] the feature flags to enable.
745
- * @param {"flat"} [config.configType="flat"] the type of config used. Retrained for backwards compatibility, will be removed in future.
746
- * @param {WarningService} [config.warningService] The warning service to use.
747
- */
748
- constructor({
749
- cwd,
750
- configType = "flat",
751
- flags = [],
752
- warningService = new WarningService(),
753
- } = {}) {
754
- const processedFlags = [];
755
-
756
- if (configType !== "flat") {
757
- throw new TypeError(
758
- `The 'configType' option value must be 'flat'. The value '${configType}' is not supported.`,
759
- );
760
- }
761
-
762
- flags.forEach(flag => {
763
- if (inactiveFlags.has(flag)) {
764
- const inactiveFlagData = inactiveFlags.get(flag);
765
- const inactivityReason =
766
- getInactivityReasonMessage(inactiveFlagData);
767
- const message = `The flag '${flag}' is inactive: ${inactivityReason}`;
768
-
769
- if (typeof inactiveFlagData.replacedBy === "undefined") {
770
- throw new Error(message);
771
- }
772
-
773
- // if there's a replacement, enable it instead of original
774
- if (typeof inactiveFlagData.replacedBy === "string") {
775
- processedFlags.push(inactiveFlagData.replacedBy);
776
- }
777
-
778
- warningService.emitInactiveFlagWarning(flag, message);
779
-
780
- return;
781
- }
782
-
783
- if (!activeFlags.has(flag)) {
784
- throw new Error(`Unknown flag '${flag}'.`);
785
- }
786
-
787
- processedFlags.push(flag);
788
- });
789
-
790
- internalSlotsMap.set(this, {
791
- cwd: normalizeCwd(cwd),
792
- flags: processedFlags,
793
- lastConfigArray: null,
794
- lastSourceCode: null,
795
- lastSuppressedMessages: [],
796
- warningService,
797
- });
798
-
799
- this.version = pkg.version;
800
- }
801
-
802
- /**
803
- * Getter for package version.
804
- * @static
805
- * @returns {string} The version from package.json.
806
- */
807
- static get version() {
808
- return pkg.version;
809
- }
810
-
811
- /**
812
- * Indicates if the given feature flag is enabled for this instance.
813
- * @param {string} flag The feature flag to check.
814
- * @returns {boolean} `true` if the feature flag is enabled, `false` if not.
815
- */
816
- hasFlag(flag) {
817
- return internalSlotsMap.get(this).flags.includes(flag);
818
- }
819
-
820
- /**
821
- * Verifies the text against the rules specified by the second argument.
822
- * @param {string|SourceCode} textOrSourceCode The text to parse or a SourceCode object.
823
- * @param {ConfigObject|ConfigObject[]} config The ESLint config object or array to use.
824
- * @param {(string|(VerifyOptions&ProcessorOptions))} [filenameOrOptions] The optional filename of the file being checked.
825
- * If this is not set, the filename will default to '<input>' in the rule context. If
826
- * an object, then it has "filename", "allowInlineConfig", and some properties.
827
- * @returns {LintMessage[]} The results as an array of messages or an empty array if no messages.
828
- */
829
- verify(textOrSourceCode, config, filenameOrOptions) {
830
- debug("Verify");
831
-
832
- const { cwd } = internalSlotsMap.get(this);
833
-
834
- const options =
835
- typeof filenameOrOptions === "string"
836
- ? { filename: filenameOrOptions }
837
- : filenameOrOptions || {};
838
-
839
- const configToUse = config ?? {};
840
-
841
- /*
842
- * Because of how Webpack packages up the files, we can't
843
- * compare directly to `FlatConfigArray` using `instanceof`
844
- * because it's not the same `FlatConfigArray` as in the tests.
845
- * So, we work around it by assuming an array is, in fact, a
846
- * `FlatConfigArray` if it has a `getConfig()` method.
847
- */
848
- let configArray = configToUse;
849
-
850
- if (
851
- !Array.isArray(configToUse) ||
852
- typeof configToUse.getConfig !== "function"
853
- ) {
854
- configArray = new FlatConfigArray(configToUse, {
855
- basePath: cwd,
856
- });
857
- configArray.normalizeSync();
858
- }
859
-
860
- return this._distinguishSuppressedMessages(
861
- this._verifyWithFlatConfigArray(
862
- textOrSourceCode,
863
- configArray,
864
- options,
865
- true,
866
- ),
867
- );
868
- }
869
-
870
- /**
871
- * Verify with a processor.
872
- * @param {string|SourceCode} textOrSourceCode The source code.
873
- * @param {Config} config The config array.
874
- * @param {VerifyOptions&ProcessorOptions} options The options.
875
- * @param {FlatConfigArray} [configForRecursive] The `ConfigArray` object to apply multiple processors recursively.
876
- * @returns {(LintMessage|SuppressedLintMessage)[]} The found problems.
877
- */
878
- _verifyWithFlatConfigArrayAndProcessor(
879
- textOrSourceCode,
880
- config,
881
- options,
882
- configForRecursive,
883
- ) {
884
- const slots = internalSlotsMap.get(this);
885
- const filename = options.filename || "<input>";
886
- const filenameToExpose = normalizeFilename(filename);
887
- const physicalFilename = options.physicalFilename || filenameToExpose;
888
- const text = ensureText(textOrSourceCode);
889
- const file = new VFile(filenameToExpose, text, {
890
- physicalPath: physicalFilename,
891
- });
892
-
893
- const preprocess = options.preprocess || (rawText => [rawText]);
894
- const postprocess =
895
- options.postprocess || (messagesList => messagesList.flat());
896
-
897
- const processorService = new ProcessorService();
898
- const preprocessResult = processorService.preprocessSync(file, {
899
- processor: {
900
- preprocess,
901
- postprocess,
902
- },
903
- });
904
-
905
- if (!preprocessResult.ok) {
906
- return preprocessResult.errors;
907
- }
908
-
909
- const filterCodeBlock =
910
- options.filterCodeBlock ||
911
- (blockFilename => blockFilename.endsWith(".js"));
912
- const originalExtname = path.extname(filename);
913
- const { files } = preprocessResult;
914
-
915
- const messageLists = files.map(block => {
916
- debug("A code block was found: %o", block.path || "(unnamed)");
917
-
918
- // Keep the legacy behavior.
919
- if (typeof block === "string") {
920
- return this._verifyWithFlatConfigArrayAndWithoutProcessors(
921
- block,
922
- config,
923
- options,
924
- );
925
- }
926
-
927
- // Skip this block if filtered.
928
- if (!filterCodeBlock(block.path, block.body)) {
929
- debug("This code block was skipped.");
930
- return [];
931
- }
932
-
933
- // Resolve configuration again if the file content or extension was changed.
934
- if (
935
- configForRecursive &&
936
- (text !== block.rawBody ||
937
- path.extname(block.path) !== originalExtname)
938
- ) {
939
- debug(
940
- "Resolving configuration again because the file content or extension was changed.",
941
- );
942
- return this._verifyWithFlatConfigArray(
943
- block.rawBody,
944
- configForRecursive,
945
- {
946
- ...options,
947
- filename: block.path,
948
- physicalFilename: block.physicalPath,
949
- },
950
- );
951
- }
952
-
953
- slots.lastSourceCode = null;
954
-
955
- // Does lint.
956
- return this.#flatVerifyWithoutProcessors(block, config, {
957
- ...options,
958
- filename: block.path,
959
- physicalFilename: block.physicalPath,
960
- });
961
- });
962
-
963
- return processorService.postprocessSync(file, messageLists, {
964
- processor: {
965
- preprocess,
966
- postprocess,
967
- },
968
- });
969
- }
970
-
971
- /**
972
- * Verify using flat config and without any processors.
973
- * @param {VFile} file The file to lint.
974
- * @param {Config} providedConfig An ESLintConfig instance to configure everything.
975
- * @param {VerifyOptions} [providedOptions] The optional filename of the file being checked.
976
- * @throws {Error} If during rule execution.
977
- * @returns {(LintMessage|SuppressedLintMessage)[]} The results as an array of messages or an empty array if no messages.
978
- */
979
- #flatVerifyWithoutProcessors(file, providedConfig, providedOptions) {
980
- const slots = internalSlotsMap.get(this);
981
- const config = providedConfig || {};
982
- const { settings = {}, languageOptions } = config;
983
- const options = normalizeVerifyOptions(providedOptions, config);
984
-
985
- if (!slots.lastSourceCode) {
986
- let t;
987
-
988
- if (options.stats) {
989
- t = startTime();
990
- }
991
-
992
- const parserService = new ParserService();
993
- const parseResult = parserService.parseSync(file, config);
994
-
995
- if (options.stats) {
996
- const time = endTime(t);
997
-
998
- storeTime(time, { type: "parse" }, slots);
999
- }
1000
-
1001
- if (!parseResult.ok) {
1002
- return parseResult.errors;
1003
- }
1004
-
1005
- slots.lastSourceCode = parseResult.sourceCode;
1006
- } else {
1007
- /*
1008
- * If the given source code object as the first argument does not have scopeManager, analyze the scope.
1009
- * This is for backward compatibility (SourceCode is frozen so it cannot rebind).
1010
- *
1011
- * We check explicitly for `null` to ensure that this is a JS-flavored language.
1012
- * For non-JS languages we don't want to do this.
1013
- *
1014
- * TODO: Remove this check when we stop exporting the `SourceCode` object.
1015
- */
1016
- if (slots.lastSourceCode.scopeManager === null) {
1017
- slots.lastSourceCode = new SourceCode({
1018
- text: slots.lastSourceCode.text,
1019
- ast: slots.lastSourceCode.ast,
1020
- hasBOM: slots.lastSourceCode.hasBOM,
1021
- parserServices: slots.lastSourceCode.parserServices,
1022
- visitorKeys: slots.lastSourceCode.visitorKeys,
1023
- scopeManager: analyzeScope(
1024
- slots.lastSourceCode.ast,
1025
- languageOptions,
1026
- ),
1027
- });
1028
- }
1029
- }
1030
-
1031
- const sourceCode = slots.lastSourceCode;
1032
- const report = new FileReport({
1033
- ruleMapper: ruleId => config.getRuleDefinition(ruleId),
1034
- language: config.language,
1035
- sourceCode,
1036
- disableFixes: options.disableFixes,
1037
- });
1038
-
1039
- /*
1040
- * Make adjustments based on the language options. For JavaScript,
1041
- * this is primarily about adding variables into the global scope
1042
- * to account for ecmaVersion and configured globals.
1043
- */
1044
- sourceCode.applyLanguageOptions?.(languageOptions);
1045
-
1046
- const mergedInlineConfig = {
1047
- rules: {},
1048
- };
1049
-
1050
- /*
1051
- * Inline config can be either enabled or disabled. If disabled, it's possible
1052
- * to detect the inline config and emit a warning (though this is not required).
1053
- * So we first check to see if inline config is allowed at all, and if so, we
1054
- * need to check if it's a warning or not.
1055
- */
1056
- if (options.allowInlineConfig) {
1057
- // if inline config should warn then add the warnings
1058
- if (options.warnInlineConfig) {
1059
- if (sourceCode.getInlineConfigNodes) {
1060
- sourceCode.getInlineConfigNodes().forEach(node => {
1061
- const loc = sourceCode.getLoc(node);
1062
- const range = sourceCode.getRange(node);
1063
-
1064
- report.addWarning({
1065
- message: `'${sourceCode.text.slice(range[0], range[1])}' has no effect because you have 'noInlineConfig' setting in ${options.warnInlineConfig}.`,
1066
- loc,
1067
- });
1068
- });
1069
- }
1070
- } else {
1071
- const inlineConfigResult = sourceCode.applyInlineConfig?.();
1072
-
1073
- if (inlineConfigResult) {
1074
- inlineConfigResult.problems.forEach(problem => {
1075
- report.addFatal(problem);
1076
- });
1077
-
1078
- for (const {
1079
- config: inlineConfig,
1080
- loc,
1081
- } of inlineConfigResult.configs) {
1082
- Object.keys(inlineConfig.rules).forEach(ruleId => {
1083
- const rule = config.getRuleDefinition(ruleId);
1084
- const ruleValue = inlineConfig.rules[ruleId];
1085
-
1086
- if (!rule) {
1087
- report.addError({
1088
- ruleId,
1089
- loc,
1090
- });
1091
- return;
1092
- }
1093
-
1094
- if (
1095
- Object.hasOwn(mergedInlineConfig.rules, ruleId)
1096
- ) {
1097
- report.addError({
1098
- message: `Rule "${ruleId}" is already configured by another configuration comment in the preceding code. This configuration is ignored.`,
1099
- loc,
1100
- });
1101
- return;
1102
- }
1103
-
1104
- try {
1105
- const ruleOptionsInline = asArray(ruleValue);
1106
- let ruleOptions = ruleOptionsInline;
1107
-
1108
- assertIsRuleSeverity(ruleId, ruleOptions[0]);
1109
-
1110
- /*
1111
- * If the rule was already configured, inline rule configuration that
1112
- * only has severity should retain options from the config and just override the severity.
1113
- *
1114
- * Example:
1115
- *
1116
- * {
1117
- * rules: {
1118
- * curly: ["error", "multi"]
1119
- * }
1120
- * }
1121
- *
1122
- * /* eslint curly: ["warn"] * /
1123
- *
1124
- * Results in:
1125
- *
1126
- * curly: ["warn", "multi"]
1127
- */
1128
-
1129
- let shouldValidateOptions = true;
1130
-
1131
- if (
1132
- /*
1133
- * If inline config for the rule has only severity
1134
- */
1135
- ruleOptions.length === 1 &&
1136
- /*
1137
- * And the rule was already configured
1138
- */
1139
- config.rules &&
1140
- Object.hasOwn(config.rules, ruleId)
1141
- ) {
1142
- /*
1143
- * Then use severity from the inline config and options from the provided config
1144
- */
1145
- ruleOptions = [
1146
- ruleOptions[0], // severity from the inline config
1147
- ...config.rules[ruleId].slice(1), // options from the provided config
1148
- ];
1149
-
1150
- // if the rule was enabled, the options have already been validated
1151
- if (config.rules[ruleId][0] > 0) {
1152
- shouldValidateOptions = false;
1153
- }
1154
- } else {
1155
- /**
1156
- * Since we know the user provided options, apply defaults on top of them
1157
- */
1158
- const slicedOptions = ruleOptions.slice(1);
1159
- const mergedOptions = deepMergeArrays(
1160
- rule.meta?.defaultOptions,
1161
- slicedOptions,
1162
- );
1163
-
1164
- if (mergedOptions.length) {
1165
- ruleOptions = [
1166
- ruleOptions[0],
1167
- ...mergedOptions,
1168
- ];
1169
- }
1170
- }
1171
-
1172
- if (
1173
- options.reportUnusedInlineConfigs !== "off"
1174
- ) {
1175
- addProblemIfSameSeverityAndOptions(
1176
- config,
1177
- loc,
1178
- report,
1179
- ruleId,
1180
- ruleOptions,
1181
- ruleOptionsInline,
1182
- options.reportUnusedInlineConfigs,
1183
- );
1184
- }
1185
-
1186
- if (shouldValidateOptions) {
1187
- config.validateRulesConfig({
1188
- [ruleId]: ruleOptions,
1189
- });
1190
- }
1191
-
1192
- mergedInlineConfig.rules[ruleId] = ruleOptions;
1193
- } catch (err) {
1194
- /*
1195
- * If the rule has invalid `meta.schema`, throw the error because
1196
- * this is not an invalid inline configuration but an invalid rule.
1197
- */
1198
- if (
1199
- err.code ===
1200
- "ESLINT_INVALID_RULE_OPTIONS_SCHEMA"
1201
- ) {
1202
- throw err;
1203
- }
1204
-
1205
- let baseMessage = err.message
1206
- .slice(
1207
- err.message.startsWith('Key "rules":')
1208
- ? err.message.indexOf(":", 12) + 1
1209
- : err.message.indexOf(":") + 1,
1210
- )
1211
- .trim();
1212
-
1213
- if (err.messageTemplate) {
1214
- baseMessage += ` You passed "${ruleValue}".`;
1215
- }
1216
-
1217
- report.addError({
1218
- ruleId,
1219
- message: `Inline configuration for rule "${ruleId}" is invalid:\n\t${baseMessage}\n`,
1220
- loc,
1221
- });
1222
- }
1223
- });
1224
- }
1225
- }
1226
- }
1227
- }
1228
-
1229
- const commentDirectives =
1230
- options.allowInlineConfig && !options.warnInlineConfig
1231
- ? getDirectiveCommentsForFlatConfig(
1232
- sourceCode,
1233
- ruleId => config.getRuleDefinition(ruleId),
1234
- config.language,
1235
- report,
1236
- )
1237
- : [];
1238
-
1239
- const configuredRules = Object.assign(
1240
- {},
1241
- config.rules,
1242
- mergedInlineConfig.rules,
1243
- );
1244
-
1245
- sourceCode.finalize?.();
1246
-
1247
- try {
1248
- runRules(
1249
- sourceCode,
1250
- configuredRules,
1251
- ruleId => config.getRuleDefinition(ruleId),
1252
- config.language,
1253
- languageOptions,
1254
- settings,
1255
- options.filename,
1256
- false,
1257
- slots.cwd,
1258
- providedOptions.physicalFilename,
1259
- options.ruleFilter,
1260
- options.stats,
1261
- slots,
1262
- report,
1263
- );
1264
- } catch (err) {
1265
- err.message += `\nOccurred while linting ${options.filename}`;
1266
- debug("An error occurred while traversing");
1267
- debug("Filename:", options.filename);
1268
- if (err.currentNode) {
1269
- const { line } = sourceCode.getLoc(err.currentNode).start;
1270
-
1271
- debug("Line:", line);
1272
- err.message += `:${line}`;
1273
- }
1274
- debug("Parser Options:", languageOptions.parserOptions);
1275
- debug("Settings:", settings);
1276
-
1277
- if (err.ruleId) {
1278
- err.message += `\nRule: "${err.ruleId}"`;
1279
- }
1280
-
1281
- throw err;
1282
- }
1283
-
1284
- return applyDisableDirectives({
1285
- language: config.language,
1286
- sourceCode,
1287
- directives: commentDirectives,
1288
- disableFixes: options.disableFixes,
1289
- problems: report.messages.sort(
1290
- (problemA, problemB) =>
1291
- problemA.line - problemB.line ||
1292
- problemA.column - problemB.column,
1293
- ),
1294
- reportUnusedDisableDirectives:
1295
- options.reportUnusedDisableDirectives,
1296
- ruleFilter: options.ruleFilter,
1297
- configuredRules,
1298
- });
1299
- }
1300
-
1301
- /**
1302
- * Same as linter.verify, except without support for processors.
1303
- * @param {string|SourceCode} textOrSourceCode The text to parse or a SourceCode object.
1304
- * @param {Config} providedConfig An ESLintConfig instance to configure everything.
1305
- * @param {VerifyOptions} [providedOptions] The optional filename of the file being checked.
1306
- * @throws {Error} If during rule execution.
1307
- * @returns {(LintMessage|SuppressedLintMessage)[]} The results as an array of messages or an empty array if no messages.
1308
- */
1309
- _verifyWithFlatConfigArrayAndWithoutProcessors(
1310
- textOrSourceCode,
1311
- providedConfig,
1312
- providedOptions,
1313
- ) {
1314
- const slots = internalSlotsMap.get(this);
1315
- const filename = normalizeFilename(
1316
- providedOptions.filename || "<input>",
1317
- );
1318
- let text;
1319
-
1320
- // evaluate arguments
1321
- if (typeof textOrSourceCode === "string") {
1322
- slots.lastSourceCode = null;
1323
- text = textOrSourceCode;
1324
- } else {
1325
- slots.lastSourceCode = textOrSourceCode;
1326
- text = textOrSourceCode.text;
1327
- }
1328
-
1329
- const file = new VFile(filename, text, {
1330
- physicalPath: providedOptions.physicalFilename,
1331
- });
1332
-
1333
- return this.#flatVerifyWithoutProcessors(
1334
- file,
1335
- providedConfig,
1336
- providedOptions,
1337
- );
1338
- }
1339
-
1340
- /**
1341
- * Verify a given code with a flat config.
1342
- * @param {string|SourceCode} textOrSourceCode The source code.
1343
- * @param {FlatConfigArray} configArray The config array.
1344
- * @param {VerifyOptions&ProcessorOptions} options The options.
1345
- * @param {boolean} firstCall Indicates if this is the first call in `verify()`
1346
- * to determine processor behavior.
1347
- * @returns {(LintMessage|SuppressedLintMessage)[]} The found problems.
1348
- */
1349
- _verifyWithFlatConfigArray(
1350
- textOrSourceCode,
1351
- configArray,
1352
- options,
1353
- firstCall = false,
1354
- ) {
1355
- debug("With flat config: %s", options.filename);
1356
-
1357
- // we need a filename to match configs against
1358
- const filename = options.filename || "__placeholder__.js";
1359
-
1360
- // Store the config array in order to get plugin envs and rules later.
1361
- internalSlotsMap.get(this).lastConfigArray = configArray;
1362
- const config = configArray.getConfig(filename);
1363
-
1364
- if (!config) {
1365
- return [
1366
- {
1367
- ruleId: null,
1368
- severity: 1,
1369
- message: `No matching configuration found for ${filename}.`,
1370
- line: 0,
1371
- column: 0,
1372
- },
1373
- ];
1374
- }
1375
-
1376
- // Verify.
1377
- if (config.processor) {
1378
- debug("Apply the processor: %o", config.processor);
1379
- const { preprocess, postprocess, supportsAutofix } =
1380
- config.processor;
1381
- const disableFixes = options.disableFixes || !supportsAutofix;
1382
-
1383
- return this._verifyWithFlatConfigArrayAndProcessor(
1384
- textOrSourceCode,
1385
- config,
1386
- { ...options, filename, disableFixes, postprocess, preprocess },
1387
- configArray,
1388
- );
1389
- }
1390
-
1391
- // check for options-based processing
1392
- if (firstCall && (options.preprocess || options.postprocess)) {
1393
- return this._verifyWithFlatConfigArrayAndProcessor(
1394
- textOrSourceCode,
1395
- config,
1396
- options,
1397
- );
1398
- }
1399
-
1400
- return this._verifyWithFlatConfigArrayAndWithoutProcessors(
1401
- textOrSourceCode,
1402
- config,
1403
- options,
1404
- );
1405
- }
1406
-
1407
- /**
1408
- * Given a list of reported problems, distinguish problems between normal messages and suppressed messages.
1409
- * The normal messages will be returned and the suppressed messages will be stored as lastSuppressedMessages.
1410
- * @param {Array<LintMessage|SuppressedLintMessage>} problems A list of reported problems.
1411
- * @returns {LintMessage[]} A list of LintMessage.
1412
- */
1413
- _distinguishSuppressedMessages(problems) {
1414
- const messages = [];
1415
- const suppressedMessages = [];
1416
- const slots = internalSlotsMap.get(this);
1417
-
1418
- for (const problem of problems) {
1419
- if (problem.suppressions) {
1420
- suppressedMessages.push(problem);
1421
- } else {
1422
- messages.push(problem);
1423
- }
1424
- }
1425
-
1426
- slots.lastSuppressedMessages = suppressedMessages;
1427
-
1428
- return messages;
1429
- }
1430
-
1431
- /**
1432
- * Gets the SourceCode object representing the parsed source.
1433
- * @returns {SourceCode} The SourceCode object.
1434
- */
1435
- getSourceCode() {
1436
- return internalSlotsMap.get(this).lastSourceCode;
1437
- }
1438
-
1439
- /**
1440
- * Gets the times spent on (parsing, fixing, linting) a file.
1441
- * @returns {{ passes: TimePass[]; }} The times.
1442
- */
1443
- getTimes() {
1444
- return internalSlotsMap.get(this).times ?? { passes: [] };
1445
- }
1446
-
1447
- /**
1448
- * Gets the number of autofix passes that were made in the last run.
1449
- * @returns {number} The number of autofix passes.
1450
- */
1451
- getFixPassCount() {
1452
- return internalSlotsMap.get(this).fixPasses ?? 0;
1453
- }
1454
-
1455
- /**
1456
- * Gets the list of SuppressedLintMessage produced in the last running.
1457
- * @returns {SuppressedLintMessage[]} The list of SuppressedLintMessage
1458
- */
1459
- getSuppressedMessages() {
1460
- return internalSlotsMap.get(this).lastSuppressedMessages;
1461
- }
1462
-
1463
- /**
1464
- * Performs multiple autofix passes over the text until as many fixes as possible
1465
- * have been applied.
1466
- * @param {string} text The source text to apply fixes to.
1467
- * @param {ConfigObject|ConfigObject[]} config The ESLint config object or array to use.
1468
- * @param {string|(VerifyOptions&ProcessorOptions&FixOptions)} [filenameOrOptions] The filename or ESLint options object to use.
1469
- * @returns {{fixed:boolean,messages:LintMessage[],output:string}} The result of the fix operation as returned from the
1470
- * SourceCodeFixer.
1471
- */
1472
- verifyAndFix(text, config, filenameOrOptions) {
1473
- let messages,
1474
- fixedResult,
1475
- fixed = false,
1476
- passNumber = 0,
1477
- currentText = text,
1478
- secondPreviousText,
1479
- previousText;
1480
- const options =
1481
- typeof filenameOrOptions === "string"
1482
- ? { filename: filenameOrOptions }
1483
- : filenameOrOptions || {};
1484
- const debugTextDescription =
1485
- options.filename || `${text.slice(0, 10)}...`;
1486
- const shouldFix =
1487
- typeof options.fix !== "undefined" ? options.fix : true;
1488
- const stats = options?.stats;
1489
-
1490
- const slots = internalSlotsMap.get(this);
1491
-
1492
- // Remove lint times from the last run.
1493
- if (stats) {
1494
- delete slots.times;
1495
- slots.fixPasses = 0;
1496
- }
1497
-
1498
- /**
1499
- * This loop continues until one of the following is true:
1500
- *
1501
- * 1. No more fixes have been applied.
1502
- * 2. Ten passes have been made.
1503
- *
1504
- * That means anytime a fix is successfully applied, there will be another pass.
1505
- * Essentially, guaranteeing a minimum of two passes.
1506
- */
1507
- do {
1508
- passNumber++;
1509
- let tTotal;
1510
-
1511
- if (stats) {
1512
- tTotal = startTime();
1513
- }
1514
-
1515
- debug(
1516
- `Linting code for ${debugTextDescription} (pass ${passNumber})`,
1517
- );
1518
- messages = this.verify(currentText, config, options);
1519
-
1520
- debug(
1521
- `Generating fixed text for ${debugTextDescription} (pass ${passNumber})`,
1522
- );
1523
- let t;
1524
-
1525
- if (stats) {
1526
- t = startTime();
1527
- }
1528
-
1529
- fixedResult = SourceCodeFixer.applyFixes(
1530
- currentText,
1531
- messages,
1532
- shouldFix,
1533
- );
1534
-
1535
- if (stats) {
1536
- if (fixedResult.fixed) {
1537
- const time = endTime(t);
1538
-
1539
- storeTime(time, { type: "fix" }, slots);
1540
- slots.fixPasses++;
1541
- } else {
1542
- storeTime(0, { type: "fix" }, slots);
1543
- }
1544
- }
1545
-
1546
- /*
1547
- * stop if there are any syntax errors.
1548
- * 'fixedResult.output' is a empty string.
1549
- */
1550
- if (messages.length === 1 && messages[0].fatal) {
1551
- break;
1552
- }
1553
-
1554
- // keep track if any fixes were ever applied - important for return value
1555
- fixed = fixed || fixedResult.fixed;
1556
-
1557
- // update to use the fixed output instead of the original text
1558
- secondPreviousText = previousText;
1559
- previousText = currentText;
1560
- currentText = fixedResult.output;
1561
-
1562
- if (stats) {
1563
- tTotal = endTime(tTotal);
1564
- const passIndex = slots.times.passes.length - 1;
1565
-
1566
- slots.times.passes[passIndex].total = tTotal;
1567
- }
1568
-
1569
- // Stop if we've made a circular fix
1570
- if (
1571
- passNumber > 1 &&
1572
- currentText.length === secondPreviousText.length &&
1573
- currentText === secondPreviousText
1574
- ) {
1575
- debug(
1576
- `Circular fixes detected after pass ${passNumber}. Exiting fix loop.`,
1577
- );
1578
- slots.warningService.emitCircularFixesWarning(
1579
- options.filename ?? "text",
1580
- );
1581
- break;
1582
- }
1583
- } while (fixedResult.fixed && passNumber < MAX_AUTOFIX_PASSES);
1584
-
1585
- /*
1586
- * If the last result had fixes, we need to lint again to be sure we have
1587
- * the most up-to-date information.
1588
- */
1589
- if (fixedResult.fixed) {
1590
- let tTotal;
1591
-
1592
- if (stats) {
1593
- tTotal = startTime();
1594
- }
1595
-
1596
- fixedResult.messages = this.verify(currentText, config, options);
1597
-
1598
- if (stats) {
1599
- storeTime(0, { type: "fix" }, slots);
1600
- slots.times.passes.at(-1).total = endTime(tTotal);
1601
- }
1602
- }
1603
-
1604
- // ensure the last result properly reflects if fixes were done
1605
- fixedResult.fixed = fixed;
1606
- fixedResult.output = currentText;
1607
-
1608
- return fixedResult;
1609
- }
1610
- }
1611
-
1612
- module.exports = {
1613
- Linter,
1614
- };