@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,1746 +0,0 @@
1
- /**
2
- * @fileoverview Rule to flag declared but unused variables
3
- * @author Ilya Volodin
4
- */
5
-
6
- "use strict";
7
-
8
- //------------------------------------------------------------------------------
9
- // Requirements
10
- //------------------------------------------------------------------------------
11
-
12
- const astUtils = require("./utils/ast-utils");
13
-
14
- //------------------------------------------------------------------------------
15
- // Types
16
- //------------------------------------------------------------------------------
17
-
18
- /** @typedef {import("eslint-scope").Variable} Variable */
19
- /** @typedef {import("eslint-scope").Reference} Reference */
20
-
21
- //------------------------------------------------------------------------------
22
- // Typedefs
23
- //------------------------------------------------------------------------------
24
-
25
- /**
26
- * A simple name for the types of variables that this rule supports
27
- * @typedef {'array-destructure'|'catch-clause'|'parameter'|'variable'} VariableType
28
- */
29
-
30
- /**
31
- * Bag of data used for formatting the `unusedVar` lint message.
32
- * @typedef {Object} UnusedVarMessageData
33
- * @property {string} varName The name of the unused var.
34
- * @property {'defined'|'assigned a value'} action Description of the vars state.
35
- * @property {string} additional Any additional info to be appended at the end.
36
- */
37
-
38
- /**
39
- * Bag of data used for formatting the `usedIgnoredVar` lint message.
40
- * @typedef {Object} UsedIgnoredVarMessageData
41
- * @property {string} varName The name of the unused var.
42
- * @property {string} additional Any additional info to be appended at the end.
43
- */
44
-
45
- //------------------------------------------------------------------------------
46
- // Rule Definition
47
- //------------------------------------------------------------------------------
48
-
49
- /** @type {import('../types').Rule.RuleModule} */
50
- module.exports = {
51
- meta: {
52
- type: "problem",
53
-
54
- docs: {
55
- description: "Disallow unused variables",
56
- recommended: true,
57
- url: "https://eslint.org/docs/latest/rules/no-unused-vars",
58
- },
59
-
60
- hasSuggestions: true,
61
-
62
- schema: [
63
- {
64
- oneOf: [
65
- {
66
- enum: ["all", "local"],
67
- },
68
- {
69
- type: "object",
70
- properties: {
71
- vars: {
72
- enum: ["all", "local"],
73
- },
74
- varsIgnorePattern: {
75
- type: "string",
76
- },
77
- args: {
78
- enum: ["all", "after-used", "none"],
79
- },
80
- ignoreRestSiblings: {
81
- type: "boolean",
82
- },
83
- argsIgnorePattern: {
84
- type: "string",
85
- },
86
- caughtErrors: {
87
- enum: ["all", "none"],
88
- },
89
- caughtErrorsIgnorePattern: {
90
- type: "string",
91
- },
92
- destructuredArrayIgnorePattern: {
93
- type: "string",
94
- },
95
- ignoreClassWithStaticInitBlock: {
96
- type: "boolean",
97
- },
98
- ignoreUsingDeclarations: {
99
- type: "boolean",
100
- },
101
- reportUsedIgnorePattern: {
102
- type: "boolean",
103
- },
104
- },
105
- additionalProperties: false,
106
- },
107
- ],
108
- },
109
- ],
110
-
111
- messages: {
112
- unusedVar:
113
- "'{{varName}}' is {{action}} but never used{{additional}}.",
114
- usedIgnoredVar:
115
- "'{{varName}}' is marked as ignored but is used{{additional}}.",
116
- removeVar: "Remove unused variable '{{varName}}'.",
117
- },
118
- },
119
-
120
- create(context) {
121
- const sourceCode = context.sourceCode;
122
-
123
- const REST_PROPERTY_TYPE =
124
- /^(?:RestElement|(?:Experimental)?RestProperty)$/u;
125
-
126
- const config = {
127
- vars: "all",
128
- args: "after-used",
129
- ignoreRestSiblings: false,
130
- caughtErrors: "all",
131
- ignoreClassWithStaticInitBlock: false,
132
- ignoreUsingDeclarations: false,
133
- reportUsedIgnorePattern: false,
134
- };
135
-
136
- const firstOption = context.options[0];
137
-
138
- if (firstOption) {
139
- if (typeof firstOption === "string") {
140
- config.vars = firstOption;
141
- } else {
142
- config.vars = firstOption.vars || config.vars;
143
- config.args = firstOption.args || config.args;
144
- config.ignoreRestSiblings =
145
- firstOption.ignoreRestSiblings || config.ignoreRestSiblings;
146
- config.caughtErrors =
147
- firstOption.caughtErrors || config.caughtErrors;
148
- config.ignoreClassWithStaticInitBlock =
149
- firstOption.ignoreClassWithStaticInitBlock ||
150
- config.ignoreClassWithStaticInitBlock;
151
- config.ignoreUsingDeclarations =
152
- firstOption.ignoreUsingDeclarations ||
153
- config.ignoreUsingDeclarations;
154
- config.reportUsedIgnorePattern =
155
- firstOption.reportUsedIgnorePattern ||
156
- config.reportUsedIgnorePattern;
157
-
158
- if (firstOption.varsIgnorePattern) {
159
- config.varsIgnorePattern = new RegExp(
160
- firstOption.varsIgnorePattern,
161
- "u",
162
- );
163
- }
164
-
165
- if (firstOption.argsIgnorePattern) {
166
- config.argsIgnorePattern = new RegExp(
167
- firstOption.argsIgnorePattern,
168
- "u",
169
- );
170
- }
171
-
172
- if (firstOption.caughtErrorsIgnorePattern) {
173
- config.caughtErrorsIgnorePattern = new RegExp(
174
- firstOption.caughtErrorsIgnorePattern,
175
- "u",
176
- );
177
- }
178
-
179
- if (firstOption.destructuredArrayIgnorePattern) {
180
- config.destructuredArrayIgnorePattern = new RegExp(
181
- firstOption.destructuredArrayIgnorePattern,
182
- "u",
183
- );
184
- }
185
- }
186
- }
187
-
188
- /**
189
- * Determines what variable type a def is.
190
- * @param {Object} def the declaration to check
191
- * @returns {VariableType} a simple name for the types of variables that this rule supports
192
- */
193
- function defToVariableType(def) {
194
- /*
195
- * This `destructuredArrayIgnorePattern` error report works differently from the catch
196
- * clause and parameter error reports. _Both_ the `varsIgnorePattern` and the
197
- * `destructuredArrayIgnorePattern` will be checked for array destructuring. However,
198
- * for the purposes of the report, the currently defined behavior is to only inform the
199
- * user of the `destructuredArrayIgnorePattern` if it's present (regardless of the fact
200
- * that the `varsIgnorePattern` would also apply). If it's not present, the user will be
201
- * informed of the `varsIgnorePattern`, assuming that's present.
202
- */
203
- if (
204
- config.destructuredArrayIgnorePattern &&
205
- def.name.parent.type === "ArrayPattern"
206
- ) {
207
- return "array-destructure";
208
- }
209
-
210
- switch (def.type) {
211
- case "CatchClause":
212
- return "catch-clause";
213
- case "Parameter":
214
- return "parameter";
215
-
216
- default:
217
- return "variable";
218
- }
219
- }
220
-
221
- /**
222
- * Gets a given variable's description and configured ignore pattern
223
- * based on the provided variableType
224
- * @param {VariableType} variableType a simple name for the types of variables that this rule supports
225
- * @throws {Error} (Unreachable)
226
- * @returns {[string | undefined, string | undefined]} the given variable's description and
227
- * ignore pattern
228
- */
229
- function getVariableDescription(variableType) {
230
- let pattern;
231
- let variableDescription;
232
-
233
- switch (variableType) {
234
- case "array-destructure":
235
- pattern = config.destructuredArrayIgnorePattern;
236
- variableDescription = "elements of array destructuring";
237
- break;
238
-
239
- case "catch-clause":
240
- pattern = config.caughtErrorsIgnorePattern;
241
- variableDescription = "caught errors";
242
- break;
243
-
244
- case "parameter":
245
- pattern = config.argsIgnorePattern;
246
- variableDescription = "args";
247
- break;
248
-
249
- case "variable":
250
- pattern = config.varsIgnorePattern;
251
- variableDescription = "vars";
252
- break;
253
-
254
- default:
255
- throw new Error(
256
- `Unexpected variable type: ${variableType}`,
257
- );
258
- }
259
-
260
- if (pattern) {
261
- pattern = pattern.toString();
262
- }
263
-
264
- return [variableDescription, pattern];
265
- }
266
-
267
- /**
268
- * Generates the message data about the variable being defined and unused,
269
- * including the ignore pattern if configured.
270
- * @param {Variable} unusedVar eslint-scope variable object.
271
- * @returns {UnusedVarMessageData} The message data to be used with this unused variable.
272
- */
273
- function getDefinedMessageData(unusedVar) {
274
- const def = unusedVar.defs && unusedVar.defs[0];
275
- let additionalMessageData = "";
276
-
277
- if (def) {
278
- const [variableDescription, pattern] = getVariableDescription(
279
- defToVariableType(def),
280
- );
281
-
282
- if (pattern && variableDescription) {
283
- additionalMessageData = `. Allowed unused ${variableDescription} must match ${pattern}`;
284
- }
285
- }
286
-
287
- return {
288
- varName: unusedVar.name,
289
- action: "defined",
290
- additional: additionalMessageData,
291
- };
292
- }
293
-
294
- /**
295
- * Generate the warning message about the variable being
296
- * assigned and unused, including the ignore pattern if configured.
297
- * @param {Variable} unusedVar eslint-scope variable object.
298
- * @returns {UnusedVarMessageData} The message data to be used with this unused variable.
299
- */
300
- function getAssignedMessageData(unusedVar) {
301
- const def = unusedVar.defs && unusedVar.defs[0];
302
- let additionalMessageData = "";
303
-
304
- if (def) {
305
- const [variableDescription, pattern] = getVariableDescription(
306
- defToVariableType(def),
307
- );
308
-
309
- if (pattern && variableDescription) {
310
- additionalMessageData = `. Allowed unused ${variableDescription} must match ${pattern}`;
311
- }
312
- }
313
-
314
- return {
315
- varName: unusedVar.name,
316
- action: "assigned a value",
317
- additional: additionalMessageData,
318
- };
319
- }
320
-
321
- /**
322
- * Generate the warning message about a variable being used even though
323
- * it is marked as being ignored.
324
- * @param {Variable} variable eslint-scope variable object
325
- * @param {VariableType} variableType a simple name for the types of variables that this rule supports
326
- * @returns {UsedIgnoredVarMessageData} The message data to be used with
327
- * this used ignored variable.
328
- */
329
- function getUsedIgnoredMessageData(variable, variableType) {
330
- const [variableDescription, pattern] =
331
- getVariableDescription(variableType);
332
-
333
- let additionalMessageData = "";
334
-
335
- if (pattern && variableDescription) {
336
- additionalMessageData = `. Used ${variableDescription} must not match ${pattern}`;
337
- }
338
-
339
- return {
340
- varName: variable.name,
341
- additional: additionalMessageData,
342
- };
343
- }
344
-
345
- //--------------------------------------------------------------------------
346
- // Helpers
347
- //--------------------------------------------------------------------------
348
-
349
- const STATEMENT_TYPE = /(?:Statement|Declaration)$/u;
350
-
351
- /**
352
- * Determines if a given variable is being exported from a module.
353
- * @param {Variable} variable eslint-scope variable object.
354
- * @returns {boolean} True if the variable is exported, false if not.
355
- * @private
356
- */
357
- function isExported(variable) {
358
- const definition = variable.defs[0];
359
-
360
- if (definition) {
361
- let node = definition.node;
362
-
363
- if (node.type === "VariableDeclarator") {
364
- node = node.parent;
365
- } else if (definition.type === "Parameter") {
366
- return false;
367
- }
368
-
369
- return node.parent.type.indexOf("Export") === 0;
370
- }
371
- return false;
372
- }
373
-
374
- /**
375
- * Determines if a given variable uses the explicit resource management protocol.
376
- * @param {Variable} variable eslint-scope variable object.
377
- * @returns {boolean} True if the variable is declared with "using" or "await using"
378
- * @private
379
- */
380
- function usesExplicitResourceManagement(variable) {
381
- const [definition] = variable.defs;
382
-
383
- return (
384
- definition?.type === "Variable" &&
385
- (definition.parent.kind === "using" ||
386
- definition.parent.kind === "await using")
387
- );
388
- }
389
-
390
- /**
391
- * Checks whether a node is a sibling of the rest property or not.
392
- * @param {ASTNode} node a node to check
393
- * @returns {boolean} True if the node is a sibling of the rest property, otherwise false.
394
- */
395
- function hasRestSibling(node) {
396
- return (
397
- node.type === "Property" &&
398
- node.parent.type === "ObjectPattern" &&
399
- REST_PROPERTY_TYPE.test(node.parent.properties.at(-1).type)
400
- );
401
- }
402
-
403
- /**
404
- * Determines if a variable has a sibling rest property
405
- * @param {Variable} variable eslint-scope variable object.
406
- * @returns {boolean} True if the variable has a sibling rest property, false if not.
407
- * @private
408
- */
409
- function hasRestSpreadSibling(variable) {
410
- if (config.ignoreRestSiblings) {
411
- const hasRestSiblingDefinition = variable.defs.some(def =>
412
- hasRestSibling(def.name.parent),
413
- );
414
- const hasRestSiblingReference = variable.references.some(ref =>
415
- hasRestSibling(ref.identifier.parent),
416
- );
417
-
418
- return hasRestSiblingDefinition || hasRestSiblingReference;
419
- }
420
-
421
- return false;
422
- }
423
-
424
- /**
425
- * Determines if a reference is a read operation.
426
- * @param {Reference} ref An eslint-scope Reference
427
- * @returns {boolean} whether the given reference represents a read operation
428
- * @private
429
- */
430
- function isReadRef(ref) {
431
- return ref.isRead();
432
- }
433
-
434
- /**
435
- * Determine if an identifier is referencing an enclosing function name.
436
- * @param {Reference} ref The reference to check.
437
- * @param {ASTNode[]} nodes The candidate function nodes.
438
- * @returns {boolean} True if it's a self-reference, false if not.
439
- * @private
440
- */
441
- function isSelfReference(ref, nodes) {
442
- let scope = ref.from;
443
-
444
- while (scope) {
445
- if (nodes.includes(scope.block)) {
446
- return true;
447
- }
448
-
449
- scope = scope.upper;
450
- }
451
-
452
- return false;
453
- }
454
-
455
- /**
456
- * Gets a list of function definitions for a specified variable.
457
- * @param {Variable} variable eslint-scope variable object.
458
- * @returns {ASTNode[]} Function nodes.
459
- * @private
460
- */
461
- function getFunctionDefinitions(variable) {
462
- const functionDefinitions = [];
463
-
464
- variable.defs.forEach(def => {
465
- const { type, node } = def;
466
-
467
- // FunctionDeclarations
468
- if (type === "FunctionName") {
469
- functionDefinitions.push(node);
470
- }
471
-
472
- // FunctionExpressions
473
- if (
474
- type === "Variable" &&
475
- node.init &&
476
- (node.init.type === "FunctionExpression" ||
477
- node.init.type === "ArrowFunctionExpression")
478
- ) {
479
- functionDefinitions.push(node.init);
480
- }
481
- });
482
- return functionDefinitions;
483
- }
484
-
485
- /**
486
- * Checks the position of given nodes.
487
- * @param {ASTNode} inner A node which is expected as inside.
488
- * @param {ASTNode} outer A node which is expected as outside.
489
- * @returns {boolean} `true` if the `inner` node exists in the `outer` node.
490
- * @private
491
- */
492
- function isInside(inner, outer) {
493
- return (
494
- inner.range[0] >= outer.range[0] &&
495
- inner.range[1] <= outer.range[1]
496
- );
497
- }
498
-
499
- /**
500
- * Checks whether a given node is unused expression or not.
501
- * @param {ASTNode} node The node itself
502
- * @returns {boolean} The node is an unused expression.
503
- * @private
504
- */
505
- function isUnusedExpression(node) {
506
- const parent = node.parent;
507
-
508
- if (parent.type === "ExpressionStatement") {
509
- return true;
510
- }
511
-
512
- if (parent.type === "SequenceExpression") {
513
- const isLastExpression = parent.expressions.at(-1) === node;
514
-
515
- if (!isLastExpression) {
516
- return true;
517
- }
518
- return isUnusedExpression(parent);
519
- }
520
-
521
- return false;
522
- }
523
-
524
- /**
525
- * If a given reference is left-hand side of an assignment, this gets
526
- * the right-hand side node of the assignment.
527
- *
528
- * In the following cases, this returns null.
529
- *
530
- * - The reference is not the LHS of an assignment expression.
531
- * - The reference is inside of a loop.
532
- * - The reference is inside of a function scope which is different from
533
- * the declaration.
534
- * @param {Reference} ref A reference to check.
535
- * @param {ASTNode} prevRhsNode The previous RHS node.
536
- * @returns {ASTNode|null} The RHS node or null.
537
- * @private
538
- */
539
- function getRhsNode(ref, prevRhsNode) {
540
- const id = ref.identifier;
541
- const parent = id.parent;
542
- const refScope = ref.from.variableScope;
543
- const varScope = ref.resolved.scope.variableScope;
544
- const canBeUsedLater =
545
- refScope !== varScope || astUtils.isInLoop(id);
546
-
547
- /*
548
- * Inherits the previous node if this reference is in the node.
549
- * This is for `a = a + a`-like code.
550
- */
551
- if (prevRhsNode && isInside(id, prevRhsNode)) {
552
- return prevRhsNode;
553
- }
554
-
555
- if (
556
- parent.type === "AssignmentExpression" &&
557
- isUnusedExpression(parent) &&
558
- id === parent.left &&
559
- !canBeUsedLater
560
- ) {
561
- return parent.right;
562
- }
563
- return null;
564
- }
565
-
566
- /**
567
- * Checks whether a given function node is stored to somewhere or not.
568
- * If the function node is stored, the function can be used later.
569
- * @param {ASTNode} funcNode A function node to check.
570
- * @param {ASTNode} rhsNode The RHS node of the previous assignment.
571
- * @returns {boolean} `true` if under the following conditions:
572
- * - the funcNode is assigned to a variable.
573
- * - the funcNode is bound as an argument of a function call.
574
- * - the function is bound to a property and the object satisfies above conditions.
575
- * @private
576
- */
577
- function isStorableFunction(funcNode, rhsNode) {
578
- let node = funcNode;
579
- let parent = funcNode.parent;
580
-
581
- while (parent && isInside(parent, rhsNode)) {
582
- switch (parent.type) {
583
- case "SequenceExpression":
584
- if (parent.expressions.at(-1) !== node) {
585
- return false;
586
- }
587
- break;
588
-
589
- case "CallExpression":
590
- case "NewExpression":
591
- return parent.callee !== node;
592
-
593
- case "AssignmentExpression":
594
- case "TaggedTemplateExpression":
595
- case "YieldExpression":
596
- return true;
597
-
598
- default:
599
- if (STATEMENT_TYPE.test(parent.type)) {
600
- /*
601
- * If it encountered statements, this is a complex pattern.
602
- * Since analyzing complex patterns is hard, this returns `true` to avoid false positive.
603
- */
604
- return true;
605
- }
606
- }
607
-
608
- node = parent;
609
- parent = parent.parent;
610
- }
611
-
612
- return false;
613
- }
614
-
615
- /**
616
- * Checks whether a given Identifier node exists inside of a function node which can be used later.
617
- *
618
- * "can be used later" means:
619
- * - the function is assigned to a variable.
620
- * - the function is bound to a property and the object can be used later.
621
- * - the function is bound as an argument of a function call.
622
- *
623
- * If a reference exists in a function which can be used later, the reference is read when the function is called.
624
- * @param {ASTNode} id An Identifier node to check.
625
- * @param {ASTNode} rhsNode The RHS node of the previous assignment.
626
- * @returns {boolean} `true` if the `id` node exists inside of a function node which can be used later.
627
- * @private
628
- */
629
- function isInsideOfStorableFunction(id, rhsNode) {
630
- const funcNode = astUtils.getUpperFunction(id);
631
-
632
- return (
633
- funcNode &&
634
- isInside(funcNode, rhsNode) &&
635
- isStorableFunction(funcNode, rhsNode)
636
- );
637
- }
638
-
639
- /**
640
- * Checks whether a given reference is a read to update itself or not.
641
- * @param {Reference} ref A reference to check.
642
- * @param {ASTNode} rhsNode The RHS node of the previous assignment.
643
- * @returns {boolean} The reference is a read to update itself.
644
- * @private
645
- */
646
- function isReadForItself(ref, rhsNode) {
647
- const id = ref.identifier;
648
- const parent = id.parent;
649
-
650
- return (
651
- ref.isRead() &&
652
- // self update. e.g. `a += 1`, `a++`
653
- ((parent.type === "AssignmentExpression" &&
654
- parent.left === id &&
655
- isUnusedExpression(parent) &&
656
- !astUtils.isLogicalAssignmentOperator(parent.operator)) ||
657
- (parent.type === "UpdateExpression" &&
658
- isUnusedExpression(parent)) ||
659
- // in RHS of an assignment for itself. e.g. `a = a + 1`
660
- (rhsNode &&
661
- isInside(id, rhsNode) &&
662
- !isInsideOfStorableFunction(id, rhsNode)))
663
- );
664
- }
665
-
666
- /**
667
- * Determine if an identifier is used either in for-in or for-of loops.
668
- * @param {Reference} ref The reference to check.
669
- * @returns {boolean} whether reference is used in the for-in loops
670
- * @private
671
- */
672
- function isForInOfRef(ref) {
673
- let target = ref.identifier.parent;
674
-
675
- // "for (var ...) { return; }"
676
- if (target.type === "VariableDeclarator") {
677
- target = target.parent.parent;
678
- }
679
-
680
- if (
681
- target.type !== "ForInStatement" &&
682
- target.type !== "ForOfStatement"
683
- ) {
684
- return false;
685
- }
686
-
687
- // "for (...) { return; }"
688
- if (target.body.type === "BlockStatement") {
689
- target = target.body.body[0];
690
-
691
- // "for (...) return;"
692
- } else {
693
- target = target.body;
694
- }
695
-
696
- // For empty loop body
697
- if (!target) {
698
- return false;
699
- }
700
-
701
- return target.type === "ReturnStatement";
702
- }
703
-
704
- /**
705
- * Determines if the variable is used.
706
- * @param {Variable} variable The variable to check.
707
- * @returns {boolean} True if the variable is used
708
- * @private
709
- */
710
- function isUsedVariable(variable) {
711
- if (variable.eslintUsed) {
712
- return true;
713
- }
714
-
715
- const functionNodes = getFunctionDefinitions(variable);
716
- const isFunctionDefinition = functionNodes.length > 0;
717
-
718
- let rhsNode = null;
719
-
720
- return variable.references.some(ref => {
721
- if (isForInOfRef(ref)) {
722
- return true;
723
- }
724
-
725
- const forItself = isReadForItself(ref, rhsNode);
726
-
727
- rhsNode = getRhsNode(ref, rhsNode);
728
-
729
- return (
730
- isReadRef(ref) &&
731
- !forItself &&
732
- !(
733
- isFunctionDefinition &&
734
- isSelfReference(ref, functionNodes)
735
- )
736
- );
737
- });
738
- }
739
-
740
- /**
741
- * Checks whether the given variable is after the last used parameter.
742
- * @param {Variable} variable The variable to check.
743
- * @returns {boolean} `true` if the variable is defined after the last
744
- * used parameter.
745
- */
746
- function isAfterLastUsedArg(variable) {
747
- const def = variable.defs[0];
748
- const params = sourceCode.getDeclaredVariables(def.node);
749
- const posteriorParams = params.slice(params.indexOf(variable) + 1);
750
-
751
- // If any used parameters occur after this parameter, do not report.
752
- return !posteriorParams.some(
753
- v => v.references.length > 0 || v.eslintUsed,
754
- );
755
- }
756
-
757
- /**
758
- * Gets an array of variables without read references.
759
- * @param {Scope} scope an eslint-scope Scope object.
760
- * @param {Variable[]} unusedVars an array that saving result.
761
- * @returns {Variable[]} unused variables of the scope and descendant scopes.
762
- * @private
763
- */
764
- function collectUnusedVariables(scope, unusedVars) {
765
- const variables = scope.variables;
766
- const childScopes = scope.childScopes;
767
- let i, l;
768
-
769
- if (scope.type !== "global" || config.vars === "all") {
770
- for (i = 0, l = variables.length; i < l; ++i) {
771
- const variable = variables[i];
772
-
773
- // skip a variable of class itself name in the class scope
774
- if (
775
- scope.type === "class" &&
776
- scope.block.id === variable.identifiers[0]
777
- ) {
778
- continue;
779
- }
780
-
781
- // skip function expression names
782
- if (scope.functionExpressionScope) {
783
- continue;
784
- }
785
-
786
- // skip variables marked with markVariableAsUsed()
787
- if (
788
- !config.reportUsedIgnorePattern &&
789
- variable.eslintUsed
790
- ) {
791
- continue;
792
- }
793
-
794
- // skip implicit "arguments" variable
795
- if (
796
- scope.type === "function" &&
797
- variable.name === "arguments" &&
798
- variable.identifiers.length === 0
799
- ) {
800
- continue;
801
- }
802
-
803
- // explicit global variables don't have definitions.
804
- const def = variable.defs[0];
805
-
806
- if (def) {
807
- const type = def.type;
808
- const refUsedInArrayPatterns = variable.references.some(
809
- ref =>
810
- ref.identifier.parent.type === "ArrayPattern",
811
- );
812
-
813
- // skip elements of array destructuring patterns
814
- if (
815
- (def.name.parent.type === "ArrayPattern" ||
816
- refUsedInArrayPatterns) &&
817
- config.destructuredArrayIgnorePattern &&
818
- config.destructuredArrayIgnorePattern.test(
819
- def.name.name,
820
- )
821
- ) {
822
- if (
823
- config.reportUsedIgnorePattern &&
824
- isUsedVariable(variable)
825
- ) {
826
- context.report({
827
- node: def.name,
828
- messageId: "usedIgnoredVar",
829
- data: getUsedIgnoredMessageData(
830
- variable,
831
- "array-destructure",
832
- ),
833
- });
834
- }
835
-
836
- continue;
837
- }
838
-
839
- if (type === "ClassName") {
840
- const hasStaticBlock = def.node.body.body.some(
841
- node => node.type === "StaticBlock",
842
- );
843
-
844
- if (
845
- config.ignoreClassWithStaticInitBlock &&
846
- hasStaticBlock
847
- ) {
848
- continue;
849
- }
850
- }
851
-
852
- // skip catch variables
853
- if (type === "CatchClause") {
854
- if (config.caughtErrors === "none") {
855
- continue;
856
- }
857
-
858
- // skip ignored parameters
859
- if (
860
- config.caughtErrorsIgnorePattern &&
861
- config.caughtErrorsIgnorePattern.test(
862
- def.name.name,
863
- )
864
- ) {
865
- if (
866
- config.reportUsedIgnorePattern &&
867
- isUsedVariable(variable)
868
- ) {
869
- context.report({
870
- node: def.name,
871
- messageId: "usedIgnoredVar",
872
- data: getUsedIgnoredMessageData(
873
- variable,
874
- "catch-clause",
875
- ),
876
- });
877
- }
878
-
879
- continue;
880
- }
881
- } else if (type === "Parameter") {
882
- // skip any setter argument
883
- if (
884
- (def.node.parent.type === "Property" ||
885
- def.node.parent.type ===
886
- "MethodDefinition") &&
887
- def.node.parent.kind === "set"
888
- ) {
889
- continue;
890
- }
891
-
892
- // if "args" option is "none", skip any parameter
893
- if (config.args === "none") {
894
- continue;
895
- }
896
-
897
- // skip ignored parameters
898
- if (
899
- config.argsIgnorePattern &&
900
- config.argsIgnorePattern.test(def.name.name)
901
- ) {
902
- if (
903
- config.reportUsedIgnorePattern &&
904
- isUsedVariable(variable)
905
- ) {
906
- context.report({
907
- node: def.name,
908
- messageId: "usedIgnoredVar",
909
- data: getUsedIgnoredMessageData(
910
- variable,
911
- "parameter",
912
- ),
913
- });
914
- }
915
-
916
- continue;
917
- }
918
-
919
- // if "args" option is "after-used", skip used variables
920
- if (
921
- config.args === "after-used" &&
922
- astUtils.isFunction(def.name.parent) &&
923
- !isAfterLastUsedArg(variable)
924
- ) {
925
- continue;
926
- }
927
- } else {
928
- // skip ignored variables
929
- if (
930
- config.varsIgnorePattern &&
931
- config.varsIgnorePattern.test(def.name.name)
932
- ) {
933
- if (
934
- config.reportUsedIgnorePattern &&
935
- isUsedVariable(variable)
936
- ) {
937
- context.report({
938
- node: def.name,
939
- messageId: "usedIgnoredVar",
940
- data: getUsedIgnoredMessageData(
941
- variable,
942
- "variable",
943
- ),
944
- });
945
- }
946
-
947
- continue;
948
- }
949
- }
950
- }
951
-
952
- if (
953
- !isUsedVariable(variable) &&
954
- !isExported(variable) &&
955
- !(
956
- config.ignoreUsingDeclarations &&
957
- usesExplicitResourceManagement(variable)
958
- ) &&
959
- !hasRestSpreadSibling(variable)
960
- ) {
961
- unusedVars.push(variable);
962
- }
963
- }
964
- }
965
-
966
- for (i = 0, l = childScopes.length; i < l; ++i) {
967
- collectUnusedVariables(childScopes[i], unusedVars);
968
- }
969
-
970
- return unusedVars;
971
- }
972
-
973
- /**
974
- * fixes unused variables
975
- * @param {Object} fixer fixer object
976
- * @param {Object} unusedVar unused variable to fix
977
- * @returns {Object} fixer object
978
- */
979
- function handleFixes(fixer, unusedVar) {
980
- const id = unusedVar.identifiers[0];
981
- const parent = id.parent;
982
- const parentType = parent.type;
983
- const tokenBefore = sourceCode.getTokenBefore(id);
984
- const tokenAfter = sourceCode.getTokenAfter(id);
985
- const isFunction = astUtils.isFunction;
986
- const isLoop = astUtils.isLoop;
987
- const allWriteReferences = unusedVar.references.filter(ref =>
988
- ref.isWrite(),
989
- );
990
-
991
- /**
992
- * get range from token before of a given node
993
- * @param {ASTNode} node node of identifier
994
- * @param {number} skips number of token to skip
995
- * @returns {number} start range of token before the identifier
996
- */
997
- function getPreviousTokenStart(node, skips) {
998
- return sourceCode.getTokenBefore(node, skips).range[0];
999
- }
1000
-
1001
- /**
1002
- * get range to token after of a given node
1003
- * @param {ASTNode} node node of identifier
1004
- * @param {number} skips number of token to skip
1005
- * @returns {number} end range of token after the identifier
1006
- */
1007
- function getNextTokenEnd(node, skips) {
1008
- return sourceCode.getTokenAfter(node, skips).range[1];
1009
- }
1010
-
1011
- /**
1012
- * get the value of token before of a given node
1013
- * @param {ASTNode} node node of identifier
1014
- * @returns {string} value of token before the identifier
1015
- */
1016
- function getTokenBeforeValue(node) {
1017
- return sourceCode.getTokenBefore(node).value;
1018
- }
1019
-
1020
- /**
1021
- * get the value of token after of a given node
1022
- * @param {ASTNode} node node of identifier
1023
- * @returns {string} value of token after the identifier
1024
- */
1025
- function getTokenAfterValue(node) {
1026
- return sourceCode.getTokenAfter(node).value;
1027
- }
1028
-
1029
- /**
1030
- * Check if an array has a single element with null as other element.
1031
- * @param {ASTNode} node ArrayPattern node
1032
- * @returns {boolean} true if array has single element with other null elements
1033
- */
1034
- function hasSingleElement(node) {
1035
- return node.elements.filter(e => e !== null).length === 1;
1036
- }
1037
-
1038
- /**
1039
- * check whether import specifier has an import of particular type
1040
- * @param {ASTNode} node ImportDeclaration node
1041
- * @param {string} type type of import to check
1042
- * @returns {boolean} true if import specifier has import of specified type
1043
- */
1044
- function hasImportOfCertainType(node, type) {
1045
- return node.specifiers.some(e => e.type === type);
1046
- }
1047
-
1048
- /**
1049
- * Check whether declaration is safe to remove or not
1050
- * @param {ASTNode} nextToken next token of unused variable
1051
- * @param {ASTNode} prevToken previous token of unused variable
1052
- * @returns {boolean} true if declaration is not safe to remove
1053
- */
1054
- function isDeclarationNotSafeToRemove(nextToken, prevToken) {
1055
- return (
1056
- nextToken.type === "String" ||
1057
- (prevToken &&
1058
- !astUtils.isSemicolonToken(prevToken) &&
1059
- !astUtils.isOpeningBraceToken(prevToken))
1060
- );
1061
- }
1062
-
1063
- /**
1064
- * give fixes for unused variables in function parameters
1065
- * @param {ASTNode} node node to check
1066
- * @returns {Object} fixer object
1067
- */
1068
- function fixFunctionParameters(node) {
1069
- const parentNode = node.parent;
1070
-
1071
- if (isFunction(parentNode)) {
1072
- // remove unused function parameter if there is only a single parameter
1073
- if (parentNode.params.length === 1) {
1074
- return fixer.removeRange(node.range);
1075
- }
1076
-
1077
- // remove first unused function parameter when there are multiple parameters
1078
- if (
1079
- getTokenBeforeValue(node) === "(" &&
1080
- getTokenAfterValue(node) === ","
1081
- ) {
1082
- return fixer.removeRange([
1083
- node.range[0],
1084
- getNextTokenEnd(node),
1085
- ]);
1086
- }
1087
-
1088
- // remove unused function parameters except first one when there are multiple parameters
1089
- return fixer.removeRange([
1090
- getPreviousTokenStart(node),
1091
- node.range[1],
1092
- ]);
1093
- }
1094
-
1095
- return null;
1096
- }
1097
-
1098
- /**
1099
- * fix unused variable declarations and function parameters
1100
- * @param {ASTNode} node parent node to identifier
1101
- * @returns {Object} fixer object
1102
- */
1103
- function fixVariables(node) {
1104
- const parentNode = node.parent;
1105
-
1106
- // remove unused declared variables such as var a = b; or var a = b, c;
1107
- if (parentNode.type === "VariableDeclarator") {
1108
- // skip variable in for (const [ foo ] of bar);
1109
- if (isLoop(parentNode.parent.parent)) {
1110
- return null;
1111
- }
1112
-
1113
- /*
1114
- * remove unused declared variable with single declaration such as 'var a = b;'
1115
- * remove complete declaration when there is an unused variable in 'const { a } = foo;', same for arrays.
1116
- */
1117
- if (parentNode.parent.declarations.length === 1) {
1118
- // if next token is a string it could become a directive if node is removed -> no suggestion.
1119
- const nextToken = sourceCode.getTokenAfter(
1120
- parentNode.parent,
1121
- );
1122
-
1123
- // if previous token exists and is not ";" or "{" not sure about ASI rules -> no suggestion.
1124
- const prevToken = sourceCode.getTokenBefore(
1125
- parentNode.parent,
1126
- );
1127
-
1128
- if (
1129
- nextToken &&
1130
- isDeclarationNotSafeToRemove(nextToken, prevToken)
1131
- ) {
1132
- return null;
1133
- }
1134
-
1135
- return fixer.removeRange(parentNode.parent.range);
1136
- }
1137
-
1138
- /*
1139
- * remove unused declared variable with multiple declaration except first one such as 'var a = b, c = d;'
1140
- * fix 'let bar = "hello", { a } = foo;' to 'let bar = "hello";' if 'a' is unused, same for arrays.
1141
- */
1142
- if (getTokenBeforeValue(parentNode) === ",") {
1143
- return fixer.removeRange([
1144
- getPreviousTokenStart(parentNode),
1145
- parentNode.range[1],
1146
- ]);
1147
- }
1148
-
1149
- /*
1150
- * remove first unused declared variable when there are multiple declarations
1151
- * fix 'let { a } = foo, bar = "hello";' to 'let bar = "hello";' if 'a' is unused, same for arrays.
1152
- */
1153
- return fixer.removeRange([
1154
- parentNode.range[0],
1155
- getNextTokenEnd(parentNode),
1156
- ]);
1157
- }
1158
-
1159
- // fixes [{a: {k}}], [{a: [k]}]
1160
- if (getTokenBeforeValue(node) === ":") {
1161
- if (parentNode.parent.type === "ObjectPattern") {
1162
- // eslint-disable-next-line no-use-before-define -- due to interdependency of functions
1163
- return fixObjectWithValueSeparator(node);
1164
- }
1165
- }
1166
-
1167
- // fix unused function parameters
1168
- return fixFunctionParameters(node);
1169
- }
1170
-
1171
- /**
1172
- * fix nested object like { a: { b } }
1173
- * @param {ASTNode} node parent node to check
1174
- * @returns {Object} fixer object
1175
- */
1176
- function fixNestedObjectVariable(node) {
1177
- const parentNode = node.parent;
1178
-
1179
- // fix for { a: { b: { c: { d } } } }
1180
- if (
1181
- parentNode.parent.parent.parent.type === "ObjectPattern" &&
1182
- parentNode.parent.properties.length === 1
1183
- ) {
1184
- return fixNestedObjectVariable(parentNode.parent);
1185
- }
1186
-
1187
- // fix for { a: { b } }
1188
- if (parentNode.parent.type === "ObjectPattern") {
1189
- // fix for unused variables in destructured object with single property in variable declaration and function parameter
1190
- if (parentNode.parent.properties.length === 1) {
1191
- return fixVariables(parentNode.parent);
1192
- }
1193
-
1194
- // fix for first unused property when there are multiple properties such as '{ a: { b }, c }'
1195
- if (getTokenBeforeValue(parentNode) === "{") {
1196
- return fixer.removeRange([
1197
- parentNode.range[0],
1198
- getNextTokenEnd(parentNode),
1199
- ]);
1200
- }
1201
-
1202
- // fix for unused property except first one when there are multiple properties such as '{ k, a: { b } }'
1203
- return fixer.removeRange([
1204
- getPreviousTokenStart(parentNode),
1205
- parentNode.range[1],
1206
- ]);
1207
- }
1208
-
1209
- return null;
1210
- }
1211
-
1212
- /**
1213
- * fix unused variables in array and nested array
1214
- * @param {ASTNode} node parent node to check
1215
- * @returns {Object} fixer object
1216
- */
1217
- function fixNestedArrayVariable(node) {
1218
- const parentNode = node.parent;
1219
-
1220
- // fix for nested arrays [[ a ]]
1221
- if (
1222
- parentNode.parent.type === "ArrayPattern" &&
1223
- hasSingleElement(parentNode)
1224
- ) {
1225
- return fixNestedArrayVariable(parentNode);
1226
- }
1227
-
1228
- if (hasSingleElement(parentNode)) {
1229
- // fixes { a: [{ b }] } or { a: [[ b ]] }
1230
- if (getTokenBeforeValue(parentNode) === ":") {
1231
- return fixVariables(parentNode);
1232
- }
1233
-
1234
- // fixes [a, ...[[ b ]]] or [a, ...[{ b }]]
1235
- if (parentNode.parent.type === "RestElement") {
1236
- // eslint-disable-next-line no-use-before-define -- due to interdependency of functions
1237
- return fixRestInPattern(parentNode.parent);
1238
- }
1239
-
1240
- // fix unused variables in destructured array in variable declaration or function parameter
1241
- return fixVariables(parentNode);
1242
- }
1243
-
1244
- // remove last unused array element
1245
- if (
1246
- getTokenBeforeValue(node) === "," &&
1247
- getTokenAfterValue(node) === "]"
1248
- ) {
1249
- return fixer.removeRange([
1250
- getPreviousTokenStart(node),
1251
- node.range[1],
1252
- ]);
1253
- }
1254
-
1255
- // remove unused array element
1256
- return fixer.removeRange(node.range);
1257
- }
1258
-
1259
- /**
1260
- * fix cases like {a: {k}} or {a: [k]}
1261
- * @param {ASTNode} node parent node to check
1262
- * @returns {Object} fixer object
1263
- */
1264
- function fixObjectWithValueSeparator(node) {
1265
- const parentNode = node.parent.parent;
1266
-
1267
- // fix cases like [{a : { b }}] or [{a : [ b ]}]
1268
- if (
1269
- parentNode.parent.type === "ArrayPattern" &&
1270
- parentNode.properties.length === 1
1271
- ) {
1272
- return fixNestedArrayVariable(parentNode);
1273
- }
1274
-
1275
- // fix cases like {a: {k}} or {a: [k]}
1276
- return fixNestedObjectVariable(node);
1277
- }
1278
-
1279
- /**
1280
- * fix ...[[a]] or ...[{a}] like patterns
1281
- * @param {ASTNode} node parent node to check
1282
- * @returns {Object} fixer object
1283
- */
1284
- function fixRestInPattern(node) {
1285
- const parentNode = node.parent;
1286
-
1287
- // fix ...[[a]] or ...[{a}] in function parameters
1288
- if (isFunction(parentNode)) {
1289
- if (parentNode.params.length === 1) {
1290
- return fixer.removeRange(node.range);
1291
- }
1292
-
1293
- return fixer.removeRange([
1294
- getPreviousTokenStart(node),
1295
- node.range[1],
1296
- ]);
1297
- }
1298
-
1299
- // fix rest in nested array pattern like [[a, ...[b]]]
1300
- if (parentNode.type === "ArrayPattern") {
1301
- // fix [[...[b]]]
1302
- if (hasSingleElement(parentNode)) {
1303
- if (parentNode.parent.type === "ArrayPattern") {
1304
- return fixNestedArrayVariable(parentNode);
1305
- }
1306
-
1307
- // fix 'const [...[b]] = foo; and function foo([...[b]]) {}
1308
- return fixVariables(parentNode);
1309
- }
1310
-
1311
- // fix [[a, ...[b]]]
1312
- return fixer.removeRange([
1313
- getPreviousTokenStart(node),
1314
- node.range[1],
1315
- ]);
1316
- }
1317
-
1318
- return null;
1319
- }
1320
-
1321
- // skip fix when variable has references that would be left behind
1322
- if (
1323
- allWriteReferences.some(
1324
- ref => ref.identifier.range[0] !== id.range[0],
1325
- )
1326
- ) {
1327
- return null;
1328
- }
1329
-
1330
- // remove declared variables such as var a; or var a, b;
1331
- if (parentType === "VariableDeclarator") {
1332
- if (parent.parent.declarations.length === 1) {
1333
- // prevent fix of variable in forOf and forIn loops.
1334
- if (
1335
- isLoop(parent.parent.parent) &&
1336
- parent.parent.parent.body !== parent.parent
1337
- ) {
1338
- return null;
1339
- }
1340
-
1341
- // removes only variable not semicolon in 'if (foo()) var bar;' or in 'loops' or in 'with' statement.
1342
- if (
1343
- parent.parent.parent.type === "IfStatement" ||
1344
- isLoop(parent.parent.parent) ||
1345
- (parent.parent.parent.type === "WithStatement" &&
1346
- parent.parent.parent.body === parent.parent)
1347
- ) {
1348
- return fixer.replaceText(parent.parent, ";");
1349
- }
1350
-
1351
- // if next token is a string it could become a directive if node is removed -> no suggestion.
1352
- const nextToken = sourceCode.getTokenAfter(parent.parent);
1353
-
1354
- // if previous token exists and is not ";" or "{" not sure about ASI rules -> no suggestion.
1355
- const prevToken = sourceCode.getTokenBefore(parent.parent);
1356
-
1357
- if (
1358
- nextToken &&
1359
- isDeclarationNotSafeToRemove(nextToken, prevToken)
1360
- ) {
1361
- return null;
1362
- }
1363
-
1364
- // remove unused declared variable with single declaration like 'var a = b;'
1365
- return fixer.removeRange(parent.parent.range);
1366
- }
1367
-
1368
- // remove unused declared variable with multiple declaration except first one like 'var a = b, c = d;'
1369
- if (tokenBefore.value === ",") {
1370
- return fixer.removeRange([
1371
- tokenBefore.range[0],
1372
- parent.range[1],
1373
- ]);
1374
- }
1375
-
1376
- // remove first unused declared variable when there are multiple declarations
1377
- return fixer.removeRange([
1378
- parent.range[0],
1379
- getNextTokenEnd(parent),
1380
- ]);
1381
- }
1382
-
1383
- // remove variables in object patterns
1384
- if (parent.parent.type === "ObjectPattern") {
1385
- if (parent.parent.properties.length === 1) {
1386
- // fix [a, ...{b}]
1387
- if (parent.parent.parent.type === "RestElement") {
1388
- return fixRestInPattern(parent.parent.parent);
1389
- }
1390
-
1391
- // fix [{ a }]
1392
- if (parent.parent.parent.type === "ArrayPattern") {
1393
- return fixNestedArrayVariable(parent.parent);
1394
- }
1395
-
1396
- /*
1397
- * var {a} = foo;
1398
- * function a({a}) {}
1399
- * fix const { a: { b } } = foo;
1400
- */
1401
- return fixVariables(parent.parent);
1402
- }
1403
-
1404
- // fix const { a:b } = foo;
1405
- if (tokenBefore.value === ":") {
1406
- // remove first unused variable in const { a:b } = foo;
1407
- if (
1408
- getTokenBeforeValue(parent) === "{" &&
1409
- getTokenAfterValue(parent) === ","
1410
- ) {
1411
- return fixer.removeRange([
1412
- parent.range[0],
1413
- getNextTokenEnd(parent),
1414
- ]);
1415
- }
1416
-
1417
- // remove unused variables in const { a: b, c: d } = foo; except first one
1418
- return fixer.removeRange([
1419
- getPreviousTokenStart(parent),
1420
- id.range[1],
1421
- ]);
1422
- }
1423
- }
1424
-
1425
- // remove unused variables inside an array
1426
- if (parentType === "ArrayPattern") {
1427
- if (hasSingleElement(parent)) {
1428
- // fix [a, ...[b]]
1429
- if (parent.parent.type === "RestElement") {
1430
- return fixRestInPattern(parent.parent);
1431
- }
1432
-
1433
- // fix [ [a] ]
1434
- if (parent.parent.type === "ArrayPattern") {
1435
- return fixNestedArrayVariable(parent);
1436
- }
1437
-
1438
- /*
1439
- * fix var [a] = foo;
1440
- * fix function foo([a]) {}
1441
- * fix const { a: [b] } = foo;
1442
- */
1443
- return fixVariables(parent);
1444
- }
1445
-
1446
- // if "a" is unused in [a, b ,c] fixes to [, b, c]
1447
- if (tokenBefore.value === "," && tokenAfter.value === ",") {
1448
- return fixer.removeRange(id.range);
1449
- }
1450
- }
1451
-
1452
- // remove unused rest elements
1453
- if (parentType === "RestElement") {
1454
- // fix [a, ...rest]
1455
- if (parent.parent.type === "ArrayPattern") {
1456
- if (hasSingleElement(parent.parent)) {
1457
- // fix [[...rest]] when there is only rest element
1458
- if (parent.parent.parent.type === "ArrayPattern") {
1459
- return fixNestedArrayVariable(parent.parent);
1460
- }
1461
-
1462
- // fix 'const [...rest] = foo;' and 'function foo([...rest]) {}'
1463
- return fixVariables(parent.parent);
1464
- }
1465
-
1466
- // fix [a, ...rest]
1467
- return fixer.removeRange([
1468
- getPreviousTokenStart(id, 1),
1469
- id.range[1],
1470
- ]);
1471
- }
1472
-
1473
- // fix { a, ...rest}
1474
- if (parent.parent.type === "ObjectPattern") {
1475
- // fix 'const {...rest} = foo;' and 'function foo({...rest}) {}'
1476
- if (parent.parent.properties.length === 1) {
1477
- return fixVariables(parent.parent);
1478
- }
1479
-
1480
- // fix { a, ...rest} when there are multiple properties
1481
- return fixer.removeRange([
1482
- getPreviousTokenStart(id, 1),
1483
- id.range[1],
1484
- ]);
1485
- }
1486
-
1487
- // fix function foo(...rest) {}
1488
- if (isFunction(parent.parent)) {
1489
- // remove unused rest in function parameter if there is only single parameter
1490
- if (parent.parent.params.length === 1) {
1491
- return fixer.removeRange(parent.range);
1492
- }
1493
-
1494
- // remove unused rest in function parameter if there multiple parameter
1495
- return fixer.removeRange([
1496
- getPreviousTokenStart(parent),
1497
- parent.range[1],
1498
- ]);
1499
- }
1500
- }
1501
-
1502
- if (parentType === "AssignmentPattern") {
1503
- // fix [a = aDefault]
1504
- if (parent.parent.type === "ArrayPattern") {
1505
- return fixNestedArrayVariable(parent);
1506
- }
1507
-
1508
- // fix {a = aDefault}
1509
- if (parent.parent.parent.type === "ObjectPattern") {
1510
- if (parent.parent.parent.properties.length === 1) {
1511
- // fixes [{a = aDefault}]
1512
- if (
1513
- parent.parent.parent.parent.type === "ArrayPattern"
1514
- ) {
1515
- return fixNestedArrayVariable(parent.parent.parent);
1516
- }
1517
-
1518
- // fix 'const {a = aDefault} = foo;' and 'function foo({a = aDefault}) {}'
1519
- return fixVariables(parent.parent.parent);
1520
- }
1521
-
1522
- // fix unused 'a' in {a = aDefault} if it is the first property
1523
- if (
1524
- getTokenBeforeValue(parent.parent) === "{" &&
1525
- getTokenAfterValue(parent.parent) === ","
1526
- ) {
1527
- return fixer.removeRange([
1528
- parent.parent.range[0],
1529
- getNextTokenEnd(parent.parent),
1530
- ]);
1531
- }
1532
-
1533
- // fix unused 'b' in {a, b = aDefault} if it is not the first property
1534
- return fixer.removeRange([
1535
- getPreviousTokenStart(parent.parent),
1536
- parent.parent.range[1],
1537
- ]);
1538
- }
1539
-
1540
- // fix unused assignment patterns in function parameters
1541
- if (isFunction(parent.parent)) {
1542
- return fixFunctionParameters(parent);
1543
- }
1544
- }
1545
-
1546
- // remove unused functions
1547
- if (parentType === "FunctionDeclaration" && parent.id === id) {
1548
- return fixer.removeRange(parent.range);
1549
- }
1550
-
1551
- // remove unused default import
1552
- if (parentType === "ImportDefaultSpecifier") {
1553
- // remove unused default import when there are not other imports
1554
- if (
1555
- !hasImportOfCertainType(parent.parent, "ImportSpecifier") &&
1556
- !hasImportOfCertainType(
1557
- parent.parent,
1558
- "ImportNamespaceSpecifier",
1559
- )
1560
- ) {
1561
- return fixer.removeRange([
1562
- parent.range[0],
1563
- parent.parent.source.range[0],
1564
- ]);
1565
- }
1566
-
1567
- // remove unused default import when there are other imports also
1568
- return fixer.removeRange([id.range[0], tokenAfter.range[1]]);
1569
- }
1570
-
1571
- if (parentType === "ImportSpecifier") {
1572
- // remove unused imports when there is a single import
1573
- if (
1574
- parent.parent.specifiers.filter(
1575
- e => e.type === "ImportSpecifier",
1576
- ).length === 1
1577
- ) {
1578
- // remove unused import when there is no default import
1579
- if (
1580
- !hasImportOfCertainType(
1581
- parent.parent,
1582
- "ImportDefaultSpecifier",
1583
- )
1584
- ) {
1585
- return fixer.removeRange(parent.parent.range);
1586
- }
1587
-
1588
- // fixes "import foo from 'module';" to "import 'module';"
1589
- return fixer.removeRange([
1590
- getPreviousTokenStart(parent, 1),
1591
- tokenAfter.range[1],
1592
- ]);
1593
- }
1594
-
1595
- if (getTokenBeforeValue(parent) === "{") {
1596
- return fixer.removeRange([
1597
- parent.range[0],
1598
- getNextTokenEnd(parent),
1599
- ]);
1600
- }
1601
-
1602
- return fixer.removeRange([
1603
- getPreviousTokenStart(parent),
1604
- parent.range[1],
1605
- ]);
1606
- }
1607
-
1608
- if (parentType === "ImportNamespaceSpecifier") {
1609
- if (
1610
- hasImportOfCertainType(
1611
- parent.parent,
1612
- "ImportDefaultSpecifier",
1613
- )
1614
- ) {
1615
- return fixer.removeRange([
1616
- getPreviousTokenStart(parent),
1617
- parent.range[1],
1618
- ]);
1619
- }
1620
-
1621
- // fixes "import * as foo from 'module';" to "import 'module';"
1622
- return fixer.removeRange([
1623
- parent.range[0],
1624
- parent.parent.source.range[0],
1625
- ]);
1626
- }
1627
-
1628
- // skip error in catch(error) variable
1629
- if (parentType === "CatchClause") {
1630
- return null;
1631
- }
1632
-
1633
- // remove unused declared classes
1634
- if (parentType === "ClassDeclaration") {
1635
- return fixer.removeRange(parent.range);
1636
- }
1637
-
1638
- // remove unused variable that is in a sequence [a,b] fixes to [a]
1639
- if (tokenBefore?.value === ",") {
1640
- return fixer.removeRange([tokenBefore.range[0], id.range[1]]);
1641
- }
1642
-
1643
- // remove unused variable that is in a sequence inside function arguments and object pattern
1644
- if (tokenAfter.value === ",") {
1645
- // fix function foo(a, b) {}
1646
- if (tokenBefore.value === "(") {
1647
- return fixer.removeRange([
1648
- id.range[0],
1649
- tokenAfter.range[1],
1650
- ]);
1651
- }
1652
-
1653
- // fix const {a, b} = foo;
1654
- if (tokenBefore.value === "{") {
1655
- return fixer.removeRange([
1656
- id.range[0],
1657
- tokenAfter.range[1],
1658
- ]);
1659
- }
1660
- }
1661
-
1662
- if (
1663
- parentType === "ArrowFunctionExpression" &&
1664
- parent.params.length === 1 &&
1665
- tokenAfter?.value !== ")"
1666
- ) {
1667
- return fixer.replaceText(id, "()");
1668
- }
1669
-
1670
- return fixer.removeRange(id.range);
1671
- }
1672
-
1673
- //--------------------------------------------------------------------------
1674
- // Public
1675
- //--------------------------------------------------------------------------
1676
-
1677
- return {
1678
- "Program:exit"(programNode) {
1679
- const unusedVars = collectUnusedVariables(
1680
- sourceCode.getScope(programNode),
1681
- [],
1682
- );
1683
-
1684
- for (let i = 0, l = unusedVars.length; i < l; ++i) {
1685
- const unusedVar = unusedVars[i];
1686
-
1687
- // Report the first declaration.
1688
- if (unusedVar.defs.length > 0) {
1689
- // report last write reference, https://github.com/eslint/eslint/issues/14324
1690
- const writeReferences = unusedVar.references.filter(
1691
- ref =>
1692
- ref.isWrite() &&
1693
- ref.from.variableScope ===
1694
- unusedVar.scope.variableScope,
1695
- );
1696
-
1697
- let referenceToReport;
1698
-
1699
- if (writeReferences.length > 0) {
1700
- referenceToReport = writeReferences.at(-1);
1701
- }
1702
-
1703
- context.report({
1704
- node: referenceToReport
1705
- ? referenceToReport.identifier
1706
- : unusedVar.identifiers[0],
1707
- messageId: "unusedVar",
1708
- data: unusedVar.references.some(ref =>
1709
- ref.isWrite(),
1710
- )
1711
- ? getAssignedMessageData(unusedVar)
1712
- : getDefinedMessageData(unusedVar),
1713
- suggest: [
1714
- {
1715
- messageId: "removeVar",
1716
- data: {
1717
- varName: unusedVar.name,
1718
- },
1719
- fix(fixer) {
1720
- return handleFixes(fixer, unusedVar);
1721
- },
1722
- },
1723
- ],
1724
- });
1725
-
1726
- // If there are no regular declaration, report the first `/*globals*/` comment directive.
1727
- } else if (unusedVar.eslintExplicitGlobalComments) {
1728
- const directiveComment =
1729
- unusedVar.eslintExplicitGlobalComments[0];
1730
-
1731
- context.report({
1732
- node: programNode,
1733
- loc: astUtils.getNameLocationInGlobalDirectiveComment(
1734
- sourceCode,
1735
- directiveComment,
1736
- unusedVar.name,
1737
- ),
1738
- messageId: "unusedVar",
1739
- data: getDefinedMessageData(unusedVar),
1740
- });
1741
- }
1742
- }
1743
- },
1744
- };
1745
- },
1746
- };