@alexlit/lint-kit 127.0.0 → 127.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (592) hide show
  1. package/package.json +1 -1
  2. package/packages/config-commitlint/package.json +3 -3
  3. package/packages/config-eslint/package.json +6 -6
  4. package/packages/config-prettier/package.json +2 -2
  5. package/packages/config-stylelint/package.json +3 -3
  6. package/packages/config-stylelint/plugins/scss.js +1 -0
  7. package/scripts/up.sh +6 -2
  8. package/packages/config-eslint/node_modules/ajv/.tonic_example.js +0 -20
  9. package/packages/config-eslint/node_modules/ajv/LICENSE +0 -22
  10. package/packages/config-eslint/node_modules/ajv/README.md +0 -1497
  11. package/packages/config-eslint/node_modules/ajv/dist/ajv.bundle.js +0 -7189
  12. package/packages/config-eslint/node_modules/ajv/dist/ajv.min.js +0 -3
  13. package/packages/config-eslint/node_modules/ajv/dist/ajv.min.js.map +0 -1
  14. package/packages/config-eslint/node_modules/ajv/lib/ajv.d.ts +0 -397
  15. package/packages/config-eslint/node_modules/ajv/lib/ajv.js +0 -506
  16. package/packages/config-eslint/node_modules/ajv/lib/cache.js +0 -26
  17. package/packages/config-eslint/node_modules/ajv/lib/compile/async.js +0 -90
  18. package/packages/config-eslint/node_modules/ajv/lib/compile/equal.js +0 -5
  19. package/packages/config-eslint/node_modules/ajv/lib/compile/error_classes.js +0 -34
  20. package/packages/config-eslint/node_modules/ajv/lib/compile/formats.js +0 -142
  21. package/packages/config-eslint/node_modules/ajv/lib/compile/index.js +0 -387
  22. package/packages/config-eslint/node_modules/ajv/lib/compile/resolve.js +0 -270
  23. package/packages/config-eslint/node_modules/ajv/lib/compile/rules.js +0 -66
  24. package/packages/config-eslint/node_modules/ajv/lib/compile/schema_obj.js +0 -9
  25. package/packages/config-eslint/node_modules/ajv/lib/compile/ucs2length.js +0 -20
  26. package/packages/config-eslint/node_modules/ajv/lib/compile/util.js +0 -239
  27. package/packages/config-eslint/node_modules/ajv/lib/data.js +0 -49
  28. package/packages/config-eslint/node_modules/ajv/lib/definition_schema.js +0 -37
  29. package/packages/config-eslint/node_modules/ajv/lib/dot/_limit.jst +0 -113
  30. package/packages/config-eslint/node_modules/ajv/lib/dot/_limitItems.jst +0 -12
  31. package/packages/config-eslint/node_modules/ajv/lib/dot/_limitLength.jst +0 -12
  32. package/packages/config-eslint/node_modules/ajv/lib/dot/_limitProperties.jst +0 -12
  33. package/packages/config-eslint/node_modules/ajv/lib/dot/allOf.jst +0 -32
  34. package/packages/config-eslint/node_modules/ajv/lib/dot/anyOf.jst +0 -46
  35. package/packages/config-eslint/node_modules/ajv/lib/dot/coerce.def +0 -51
  36. package/packages/config-eslint/node_modules/ajv/lib/dot/comment.jst +0 -9
  37. package/packages/config-eslint/node_modules/ajv/lib/dot/const.jst +0 -11
  38. package/packages/config-eslint/node_modules/ajv/lib/dot/contains.jst +0 -55
  39. package/packages/config-eslint/node_modules/ajv/lib/dot/custom.jst +0 -191
  40. package/packages/config-eslint/node_modules/ajv/lib/dot/defaults.def +0 -47
  41. package/packages/config-eslint/node_modules/ajv/lib/dot/definitions.def +0 -203
  42. package/packages/config-eslint/node_modules/ajv/lib/dot/dependencies.jst +0 -79
  43. package/packages/config-eslint/node_modules/ajv/lib/dot/enum.jst +0 -30
  44. package/packages/config-eslint/node_modules/ajv/lib/dot/errors.def +0 -194
  45. package/packages/config-eslint/node_modules/ajv/lib/dot/format.jst +0 -106
  46. package/packages/config-eslint/node_modules/ajv/lib/dot/if.jst +0 -73
  47. package/packages/config-eslint/node_modules/ajv/lib/dot/items.jst +0 -98
  48. package/packages/config-eslint/node_modules/ajv/lib/dot/missing.def +0 -39
  49. package/packages/config-eslint/node_modules/ajv/lib/dot/multipleOf.jst +0 -22
  50. package/packages/config-eslint/node_modules/ajv/lib/dot/not.jst +0 -43
  51. package/packages/config-eslint/node_modules/ajv/lib/dot/oneOf.jst +0 -54
  52. package/packages/config-eslint/node_modules/ajv/lib/dot/pattern.jst +0 -14
  53. package/packages/config-eslint/node_modules/ajv/lib/dot/properties.jst +0 -245
  54. package/packages/config-eslint/node_modules/ajv/lib/dot/propertyNames.jst +0 -52
  55. package/packages/config-eslint/node_modules/ajv/lib/dot/ref.jst +0 -85
  56. package/packages/config-eslint/node_modules/ajv/lib/dot/required.jst +0 -108
  57. package/packages/config-eslint/node_modules/ajv/lib/dot/uniqueItems.jst +0 -62
  58. package/packages/config-eslint/node_modules/ajv/lib/dot/validate.jst +0 -276
  59. package/packages/config-eslint/node_modules/ajv/lib/dotjs/README.md +0 -3
  60. package/packages/config-eslint/node_modules/ajv/lib/dotjs/_limit.js +0 -163
  61. package/packages/config-eslint/node_modules/ajv/lib/dotjs/_limitItems.js +0 -80
  62. package/packages/config-eslint/node_modules/ajv/lib/dotjs/_limitLength.js +0 -85
  63. package/packages/config-eslint/node_modules/ajv/lib/dotjs/_limitProperties.js +0 -80
  64. package/packages/config-eslint/node_modules/ajv/lib/dotjs/allOf.js +0 -42
  65. package/packages/config-eslint/node_modules/ajv/lib/dotjs/anyOf.js +0 -73
  66. package/packages/config-eslint/node_modules/ajv/lib/dotjs/comment.js +0 -14
  67. package/packages/config-eslint/node_modules/ajv/lib/dotjs/const.js +0 -56
  68. package/packages/config-eslint/node_modules/ajv/lib/dotjs/contains.js +0 -81
  69. package/packages/config-eslint/node_modules/ajv/lib/dotjs/custom.js +0 -228
  70. package/packages/config-eslint/node_modules/ajv/lib/dotjs/dependencies.js +0 -168
  71. package/packages/config-eslint/node_modules/ajv/lib/dotjs/enum.js +0 -66
  72. package/packages/config-eslint/node_modules/ajv/lib/dotjs/format.js +0 -150
  73. package/packages/config-eslint/node_modules/ajv/lib/dotjs/if.js +0 -103
  74. package/packages/config-eslint/node_modules/ajv/lib/dotjs/index.js +0 -33
  75. package/packages/config-eslint/node_modules/ajv/lib/dotjs/items.js +0 -140
  76. package/packages/config-eslint/node_modules/ajv/lib/dotjs/multipleOf.js +0 -80
  77. package/packages/config-eslint/node_modules/ajv/lib/dotjs/not.js +0 -84
  78. package/packages/config-eslint/node_modules/ajv/lib/dotjs/oneOf.js +0 -73
  79. package/packages/config-eslint/node_modules/ajv/lib/dotjs/pattern.js +0 -75
  80. package/packages/config-eslint/node_modules/ajv/lib/dotjs/properties.js +0 -335
  81. package/packages/config-eslint/node_modules/ajv/lib/dotjs/propertyNames.js +0 -81
  82. package/packages/config-eslint/node_modules/ajv/lib/dotjs/ref.js +0 -124
  83. package/packages/config-eslint/node_modules/ajv/lib/dotjs/required.js +0 -270
  84. package/packages/config-eslint/node_modules/ajv/lib/dotjs/uniqueItems.js +0 -86
  85. package/packages/config-eslint/node_modules/ajv/lib/dotjs/validate.js +0 -482
  86. package/packages/config-eslint/node_modules/ajv/lib/keyword.js +0 -146
  87. package/packages/config-eslint/node_modules/ajv/lib/refs/data.json +0 -17
  88. package/packages/config-eslint/node_modules/ajv/lib/refs/json-schema-draft-04.json +0 -149
  89. package/packages/config-eslint/node_modules/ajv/lib/refs/json-schema-draft-06.json +0 -154
  90. package/packages/config-eslint/node_modules/ajv/lib/refs/json-schema-draft-07.json +0 -168
  91. package/packages/config-eslint/node_modules/ajv/lib/refs/json-schema-secure.json +0 -94
  92. package/packages/config-eslint/node_modules/ajv/package.json +0 -106
  93. package/packages/config-eslint/node_modules/ajv/scripts/.eslintrc.yml +0 -3
  94. package/packages/config-eslint/node_modules/ajv/scripts/bundle.js +0 -61
  95. package/packages/config-eslint/node_modules/ajv/scripts/compile-dots.js +0 -73
  96. package/packages/config-eslint/node_modules/ajv/scripts/info +0 -10
  97. package/packages/config-eslint/node_modules/ajv/scripts/prepare-tests +0 -12
  98. package/packages/config-eslint/node_modules/ajv/scripts/publish-built-version +0 -32
  99. package/packages/config-eslint/node_modules/ajv/scripts/travis-gh-pages +0 -23
  100. package/packages/config-eslint/node_modules/ansi-styles/index.d.ts +0 -345
  101. package/packages/config-eslint/node_modules/ansi-styles/index.js +0 -163
  102. package/packages/config-eslint/node_modules/ansi-styles/license +0 -9
  103. package/packages/config-eslint/node_modules/ansi-styles/package.json +0 -56
  104. package/packages/config-eslint/node_modules/ansi-styles/readme.md +0 -152
  105. package/packages/config-eslint/node_modules/chalk/index.d.ts +0 -415
  106. package/packages/config-eslint/node_modules/chalk/license +0 -9
  107. package/packages/config-eslint/node_modules/chalk/package.json +0 -68
  108. package/packages/config-eslint/node_modules/chalk/readme.md +0 -341
  109. package/packages/config-eslint/node_modules/chalk/source/index.js +0 -229
  110. package/packages/config-eslint/node_modules/chalk/source/templates.js +0 -134
  111. package/packages/config-eslint/node_modules/chalk/source/util.js +0 -39
  112. package/packages/config-eslint/node_modules/color-convert/CHANGELOG.md +0 -54
  113. package/packages/config-eslint/node_modules/color-convert/LICENSE +0 -21
  114. package/packages/config-eslint/node_modules/color-convert/README.md +0 -68
  115. package/packages/config-eslint/node_modules/color-convert/conversions.js +0 -839
  116. package/packages/config-eslint/node_modules/color-convert/index.js +0 -81
  117. package/packages/config-eslint/node_modules/color-convert/package.json +0 -48
  118. package/packages/config-eslint/node_modules/color-convert/route.js +0 -97
  119. package/packages/config-eslint/node_modules/color-name/LICENSE +0 -8
  120. package/packages/config-eslint/node_modules/color-name/README.md +0 -11
  121. package/packages/config-eslint/node_modules/color-name/index.js +0 -152
  122. package/packages/config-eslint/node_modules/color-name/package.json +0 -28
  123. package/packages/config-eslint/node_modules/eslint/LICENSE +0 -19
  124. package/packages/config-eslint/node_modules/eslint/README.md +0 -306
  125. package/packages/config-eslint/node_modules/eslint/bin/eslint.js +0 -174
  126. package/packages/config-eslint/node_modules/eslint/conf/default-cli-options.js +0 -32
  127. package/packages/config-eslint/node_modules/eslint/conf/ecma-version.js +0 -16
  128. package/packages/config-eslint/node_modules/eslint/conf/globals.js +0 -160
  129. package/packages/config-eslint/node_modules/eslint/conf/replacements.json +0 -22
  130. package/packages/config-eslint/node_modules/eslint/conf/rule-type-list.json +0 -30
  131. package/packages/config-eslint/node_modules/eslint/lib/api.js +0 -50
  132. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/cli-engine.js +0 -1089
  133. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/file-enumerator.js +0 -547
  134. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/formatters/formatters-meta.json +0 -18
  135. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/formatters/html.js +0 -351
  136. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/formatters/json-with-metadata.js +0 -16
  137. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/formatters/json.js +0 -13
  138. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/formatters/stylish.js +0 -101
  139. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/hash.js +0 -35
  140. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/index.js +0 -7
  141. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/lint-result-cache.js +0 -203
  142. package/packages/config-eslint/node_modules/eslint/lib/cli-engine/load-rules.js +0 -46
  143. package/packages/config-eslint/node_modules/eslint/lib/cli.js +0 -552
  144. package/packages/config-eslint/node_modules/eslint/lib/config/default-config.js +0 -75
  145. package/packages/config-eslint/node_modules/eslint/lib/config/flat-config-array.js +0 -423
  146. package/packages/config-eslint/node_modules/eslint/lib/config/flat-config-helpers.js +0 -132
  147. package/packages/config-eslint/node_modules/eslint/lib/config/flat-config-schema.js +0 -576
  148. package/packages/config-eslint/node_modules/eslint/lib/config/rule-validator.js +0 -194
  149. package/packages/config-eslint/node_modules/eslint/lib/eslint/eslint-helpers.js +0 -975
  150. package/packages/config-eslint/node_modules/eslint/lib/eslint/eslint.js +0 -1307
  151. package/packages/config-eslint/node_modules/eslint/lib/eslint/index.js +0 -9
  152. package/packages/config-eslint/node_modules/eslint/lib/eslint/legacy-eslint.js +0 -742
  153. package/packages/config-eslint/node_modules/eslint/lib/languages/js/index.js +0 -252
  154. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/index.js +0 -7
  155. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/source-code.js +0 -1318
  156. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/backward-token-comment-cursor.js +0 -57
  157. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/backward-token-cursor.js +0 -58
  158. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/cursor.js +0 -76
  159. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/cursors.js +0 -92
  160. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/decorative-cursor.js +0 -39
  161. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/filter-cursor.js +0 -43
  162. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/forward-token-comment-cursor.js +0 -57
  163. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/forward-token-cursor.js +0 -63
  164. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/index.js +0 -627
  165. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/limit-cursor.js +0 -40
  166. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/padded-token-cursor.js +0 -38
  167. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/skip-cursor.js +0 -42
  168. package/packages/config-eslint/node_modules/eslint/lib/languages/js/source-code/token-store/utils.js +0 -107
  169. package/packages/config-eslint/node_modules/eslint/lib/languages/js/validate-language-options.js +0 -181
  170. package/packages/config-eslint/node_modules/eslint/lib/linter/apply-disable-directives.js +0 -513
  171. package/packages/config-eslint/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js +0 -851
  172. package/packages/config-eslint/node_modules/eslint/lib/linter/code-path-analysis/code-path-segment.js +0 -263
  173. package/packages/config-eslint/node_modules/eslint/lib/linter/code-path-analysis/code-path-state.js +0 -2348
  174. package/packages/config-eslint/node_modules/eslint/lib/linter/code-path-analysis/code-path.js +0 -344
  175. package/packages/config-eslint/node_modules/eslint/lib/linter/code-path-analysis/debug-helpers.js +0 -203
  176. package/packages/config-eslint/node_modules/eslint/lib/linter/code-path-analysis/fork-context.js +0 -349
  177. package/packages/config-eslint/node_modules/eslint/lib/linter/code-path-analysis/id-generator.js +0 -45
  178. package/packages/config-eslint/node_modules/eslint/lib/linter/config-comment-parser.js +0 -169
  179. package/packages/config-eslint/node_modules/eslint/lib/linter/index.js +0 -11
  180. package/packages/config-eslint/node_modules/eslint/lib/linter/interpolate.js +0 -50
  181. package/packages/config-eslint/node_modules/eslint/lib/linter/linter.js +0 -2410
  182. package/packages/config-eslint/node_modules/eslint/lib/linter/node-event-generator.js +0 -352
  183. package/packages/config-eslint/node_modules/eslint/lib/linter/report-translator.js +0 -376
  184. package/packages/config-eslint/node_modules/eslint/lib/linter/rule-fixer.js +0 -163
  185. package/packages/config-eslint/node_modules/eslint/lib/linter/rules.js +0 -71
  186. package/packages/config-eslint/node_modules/eslint/lib/linter/safe-emitter.js +0 -52
  187. package/packages/config-eslint/node_modules/eslint/lib/linter/source-code-fixer.js +0 -152
  188. package/packages/config-eslint/node_modules/eslint/lib/linter/timing.js +0 -169
  189. package/packages/config-eslint/node_modules/eslint/lib/linter/vfile.js +0 -111
  190. package/packages/config-eslint/node_modules/eslint/lib/options.js +0 -442
  191. package/packages/config-eslint/node_modules/eslint/lib/rule-tester/index.js +0 -7
  192. package/packages/config-eslint/node_modules/eslint/lib/rule-tester/rule-tester.js +0 -1286
  193. package/packages/config-eslint/node_modules/eslint/lib/rules/accessor-pairs.js +0 -346
  194. package/packages/config-eslint/node_modules/eslint/lib/rules/array-bracket-newline.js +0 -261
  195. package/packages/config-eslint/node_modules/eslint/lib/rules/array-bracket-spacing.js +0 -244
  196. package/packages/config-eslint/node_modules/eslint/lib/rules/array-callback-return.js +0 -446
  197. package/packages/config-eslint/node_modules/eslint/lib/rules/array-element-newline.js +0 -311
  198. package/packages/config-eslint/node_modules/eslint/lib/rules/arrow-body-style.js +0 -296
  199. package/packages/config-eslint/node_modules/eslint/lib/rules/arrow-parens.js +0 -186
  200. package/packages/config-eslint/node_modules/eslint/lib/rules/arrow-spacing.js +0 -164
  201. package/packages/config-eslint/node_modules/eslint/lib/rules/block-scoped-var.js +0 -135
  202. package/packages/config-eslint/node_modules/eslint/lib/rules/block-spacing.js +0 -174
  203. package/packages/config-eslint/node_modules/eslint/lib/rules/brace-style.js +0 -197
  204. package/packages/config-eslint/node_modules/eslint/lib/rules/callback-return.js +0 -187
  205. package/packages/config-eslint/node_modules/eslint/lib/rules/camelcase.js +0 -397
  206. package/packages/config-eslint/node_modules/eslint/lib/rules/capitalized-comments.js +0 -303
  207. package/packages/config-eslint/node_modules/eslint/lib/rules/class-methods-use-this.js +0 -187
  208. package/packages/config-eslint/node_modules/eslint/lib/rules/comma-dangle.js +0 -373
  209. package/packages/config-eslint/node_modules/eslint/lib/rules/comma-spacing.js +0 -192
  210. package/packages/config-eslint/node_modules/eslint/lib/rules/comma-style.js +0 -314
  211. package/packages/config-eslint/node_modules/eslint/lib/rules/complexity.js +0 -178
  212. package/packages/config-eslint/node_modules/eslint/lib/rules/computed-property-spacing.js +0 -208
  213. package/packages/config-eslint/node_modules/eslint/lib/rules/consistent-return.js +0 -210
  214. package/packages/config-eslint/node_modules/eslint/lib/rules/consistent-this.js +0 -153
  215. package/packages/config-eslint/node_modules/eslint/lib/rules/constructor-super.js +0 -445
  216. package/packages/config-eslint/node_modules/eslint/lib/rules/curly.js +0 -486
  217. package/packages/config-eslint/node_modules/eslint/lib/rules/default-case-last.js +0 -44
  218. package/packages/config-eslint/node_modules/eslint/lib/rules/default-case.js +0 -97
  219. package/packages/config-eslint/node_modules/eslint/lib/rules/default-param-last.js +0 -62
  220. package/packages/config-eslint/node_modules/eslint/lib/rules/dot-location.js +0 -108
  221. package/packages/config-eslint/node_modules/eslint/lib/rules/dot-notation.js +0 -176
  222. package/packages/config-eslint/node_modules/eslint/lib/rules/eol-last.js +0 -115
  223. package/packages/config-eslint/node_modules/eslint/lib/rules/eqeqeq.js +0 -174
  224. package/packages/config-eslint/node_modules/eslint/lib/rules/for-direction.js +0 -140
  225. package/packages/config-eslint/node_modules/eslint/lib/rules/func-call-spacing.js +0 -233
  226. package/packages/config-eslint/node_modules/eslint/lib/rules/func-name-matching.js +0 -253
  227. package/packages/config-eslint/node_modules/eslint/lib/rules/func-names.js +0 -191
  228. package/packages/config-eslint/node_modules/eslint/lib/rules/func-style.js +0 -136
  229. package/packages/config-eslint/node_modules/eslint/lib/rules/function-call-argument-newline.js +0 -125
  230. package/packages/config-eslint/node_modules/eslint/lib/rules/function-paren-newline.js +0 -292
  231. package/packages/config-eslint/node_modules/eslint/lib/rules/generator-star-spacing.js +0 -209
  232. package/packages/config-eslint/node_modules/eslint/lib/rules/getter-return.js +0 -204
  233. package/packages/config-eslint/node_modules/eslint/lib/rules/global-require.js +0 -90
  234. package/packages/config-eslint/node_modules/eslint/lib/rules/grouped-accessor-pairs.js +0 -215
  235. package/packages/config-eslint/node_modules/eslint/lib/rules/guard-for-in.js +0 -76
  236. package/packages/config-eslint/node_modules/eslint/lib/rules/handle-callback-err.js +0 -101
  237. package/packages/config-eslint/node_modules/eslint/lib/rules/id-blacklist.js +0 -246
  238. package/packages/config-eslint/node_modules/eslint/lib/rules/id-denylist.js +0 -228
  239. package/packages/config-eslint/node_modules/eslint/lib/rules/id-length.js +0 -177
  240. package/packages/config-eslint/node_modules/eslint/lib/rules/id-match.js +0 -299
  241. package/packages/config-eslint/node_modules/eslint/lib/rules/implicit-arrow-linebreak.js +0 -84
  242. package/packages/config-eslint/node_modules/eslint/lib/rules/indent-legacy.js +0 -1126
  243. package/packages/config-eslint/node_modules/eslint/lib/rules/indent.js +0 -1803
  244. package/packages/config-eslint/node_modules/eslint/lib/rules/index.js +0 -305
  245. package/packages/config-eslint/node_modules/eslint/lib/rules/init-declarations.js +0 -139
  246. package/packages/config-eslint/node_modules/eslint/lib/rules/jsx-quotes.js +0 -98
  247. package/packages/config-eslint/node_modules/eslint/lib/rules/key-spacing.js +0 -687
  248. package/packages/config-eslint/node_modules/eslint/lib/rules/keyword-spacing.js +0 -640
  249. package/packages/config-eslint/node_modules/eslint/lib/rules/line-comment-position.js +0 -125
  250. package/packages/config-eslint/node_modules/eslint/lib/rules/linebreak-style.js +0 -108
  251. package/packages/config-eslint/node_modules/eslint/lib/rules/lines-around-comment.js +0 -471
  252. package/packages/config-eslint/node_modules/eslint/lib/rules/lines-around-directive.js +0 -201
  253. package/packages/config-eslint/node_modules/eslint/lib/rules/lines-between-class-members.js +0 -269
  254. package/packages/config-eslint/node_modules/eslint/lib/rules/logical-assignment-operators.js +0 -504
  255. package/packages/config-eslint/node_modules/eslint/lib/rules/max-classes-per-file.js +0 -89
  256. package/packages/config-eslint/node_modules/eslint/lib/rules/max-depth.js +0 -156
  257. package/packages/config-eslint/node_modules/eslint/lib/rules/max-len.js +0 -440
  258. package/packages/config-eslint/node_modules/eslint/lib/rules/max-lines-per-function.js +0 -213
  259. package/packages/config-eslint/node_modules/eslint/lib/rules/max-lines.js +0 -193
  260. package/packages/config-eslint/node_modules/eslint/lib/rules/max-nested-callbacks.js +0 -117
  261. package/packages/config-eslint/node_modules/eslint/lib/rules/max-params.js +0 -102
  262. package/packages/config-eslint/node_modules/eslint/lib/rules/max-statements-per-line.js +0 -199
  263. package/packages/config-eslint/node_modules/eslint/lib/rules/max-statements.js +0 -184
  264. package/packages/config-eslint/node_modules/eslint/lib/rules/multiline-comment-style.js +0 -476
  265. package/packages/config-eslint/node_modules/eslint/lib/rules/multiline-ternary.js +0 -174
  266. package/packages/config-eslint/node_modules/eslint/lib/rules/new-cap.js +0 -276
  267. package/packages/config-eslint/node_modules/eslint/lib/rules/new-parens.js +0 -93
  268. package/packages/config-eslint/node_modules/eslint/lib/rules/newline-after-var.js +0 -253
  269. package/packages/config-eslint/node_modules/eslint/lib/rules/newline-before-return.js +0 -217
  270. package/packages/config-eslint/node_modules/eslint/lib/rules/newline-per-chained-call.js +0 -126
  271. package/packages/config-eslint/node_modules/eslint/lib/rules/no-alert.js +0 -138
  272. package/packages/config-eslint/node_modules/eslint/lib/rules/no-array-constructor.js +0 -133
  273. package/packages/config-eslint/node_modules/eslint/lib/rules/no-async-promise-executor.js +0 -39
  274. package/packages/config-eslint/node_modules/eslint/lib/rules/no-await-in-loop.js +0 -106
  275. package/packages/config-eslint/node_modules/eslint/lib/rules/no-bitwise.js +0 -119
  276. package/packages/config-eslint/node_modules/eslint/lib/rules/no-buffer-constructor.js +0 -50
  277. package/packages/config-eslint/node_modules/eslint/lib/rules/no-caller.js +0 -46
  278. package/packages/config-eslint/node_modules/eslint/lib/rules/no-case-declarations.js +0 -76
  279. package/packages/config-eslint/node_modules/eslint/lib/rules/no-catch-shadow.js +0 -82
  280. package/packages/config-eslint/node_modules/eslint/lib/rules/no-class-assign.js +0 -63
  281. package/packages/config-eslint/node_modules/eslint/lib/rules/no-compare-neg-zero.js +0 -60
  282. package/packages/config-eslint/node_modules/eslint/lib/rules/no-cond-assign.js +0 -159
  283. package/packages/config-eslint/node_modules/eslint/lib/rules/no-confusing-arrow.js +0 -92
  284. package/packages/config-eslint/node_modules/eslint/lib/rules/no-console.js +0 -207
  285. package/packages/config-eslint/node_modules/eslint/lib/rules/no-const-assign.js +0 -56
  286. package/packages/config-eslint/node_modules/eslint/lib/rules/no-constant-binary-expression.js +0 -508
  287. package/packages/config-eslint/node_modules/eslint/lib/rules/no-constant-condition.js +0 -161
  288. package/packages/config-eslint/node_modules/eslint/lib/rules/no-constructor-return.js +0 -62
  289. package/packages/config-eslint/node_modules/eslint/lib/rules/no-continue.js +0 -39
  290. package/packages/config-eslint/node_modules/eslint/lib/rules/no-control-regex.js +0 -138
  291. package/packages/config-eslint/node_modules/eslint/lib/rules/no-debugger.js +0 -43
  292. package/packages/config-eslint/node_modules/eslint/lib/rules/no-delete-var.js +0 -42
  293. package/packages/config-eslint/node_modules/eslint/lib/rules/no-div-regex.js +0 -53
  294. package/packages/config-eslint/node_modules/eslint/lib/rules/no-dupe-args.js +0 -82
  295. package/packages/config-eslint/node_modules/eslint/lib/rules/no-dupe-class-members.js +0 -104
  296. package/packages/config-eslint/node_modules/eslint/lib/rules/no-dupe-else-if.js +0 -122
  297. package/packages/config-eslint/node_modules/eslint/lib/rules/no-dupe-keys.js +0 -142
  298. package/packages/config-eslint/node_modules/eslint/lib/rules/no-duplicate-case.js +0 -71
  299. package/packages/config-eslint/node_modules/eslint/lib/rules/no-duplicate-imports.js +0 -290
  300. package/packages/config-eslint/node_modules/eslint/lib/rules/no-else-return.js +0 -405
  301. package/packages/config-eslint/node_modules/eslint/lib/rules/no-empty-character-class.js +0 -76
  302. package/packages/config-eslint/node_modules/eslint/lib/rules/no-empty-function.js +0 -167
  303. package/packages/config-eslint/node_modules/eslint/lib/rules/no-empty-pattern.js +0 -78
  304. package/packages/config-eslint/node_modules/eslint/lib/rules/no-empty-static-block.js +0 -47
  305. package/packages/config-eslint/node_modules/eslint/lib/rules/no-empty.js +0 -103
  306. package/packages/config-eslint/node_modules/eslint/lib/rules/no-eq-null.js +0 -46
  307. package/packages/config-eslint/node_modules/eslint/lib/rules/no-eval.js +0 -286
  308. package/packages/config-eslint/node_modules/eslint/lib/rules/no-ex-assign.js +0 -54
  309. package/packages/config-eslint/node_modules/eslint/lib/rules/no-extend-native.js +0 -178
  310. package/packages/config-eslint/node_modules/eslint/lib/rules/no-extra-bind.js +0 -213
  311. package/packages/config-eslint/node_modules/eslint/lib/rules/no-extra-boolean-cast.js +0 -369
  312. package/packages/config-eslint/node_modules/eslint/lib/rules/no-extra-label.js +0 -149
  313. package/packages/config-eslint/node_modules/eslint/lib/rules/no-extra-parens.js +0 -1322
  314. package/packages/config-eslint/node_modules/eslint/lib/rules/no-extra-semi.js +0 -147
  315. package/packages/config-eslint/node_modules/eslint/lib/rules/no-fallthrough.js +0 -221
  316. package/packages/config-eslint/node_modules/eslint/lib/rules/no-floating-decimal.js +0 -73
  317. package/packages/config-eslint/node_modules/eslint/lib/rules/no-func-assign.js +0 -78
  318. package/packages/config-eslint/node_modules/eslint/lib/rules/no-global-assign.js +0 -95
  319. package/packages/config-eslint/node_modules/eslint/lib/rules/no-implicit-coercion.js +0 -422
  320. package/packages/config-eslint/node_modules/eslint/lib/rules/no-implicit-globals.js +0 -146
  321. package/packages/config-eslint/node_modules/eslint/lib/rules/no-implied-eval.js +0 -132
  322. package/packages/config-eslint/node_modules/eslint/lib/rules/no-import-assign.js +0 -241
  323. package/packages/config-eslint/node_modules/eslint/lib/rules/no-inline-comments.js +0 -110
  324. package/packages/config-eslint/node_modules/eslint/lib/rules/no-inner-declarations.js +0 -131
  325. package/packages/config-eslint/node_modules/eslint/lib/rules/no-invalid-regexp.js +0 -194
  326. package/packages/config-eslint/node_modules/eslint/lib/rules/no-invalid-this.js +0 -150
  327. package/packages/config-eslint/node_modules/eslint/lib/rules/no-irregular-whitespace.js +0 -276
  328. package/packages/config-eslint/node_modules/eslint/lib/rules/no-iterator.js +0 -52
  329. package/packages/config-eslint/node_modules/eslint/lib/rules/no-label-var.js +0 -80
  330. package/packages/config-eslint/node_modules/eslint/lib/rules/no-labels.js +0 -149
  331. package/packages/config-eslint/node_modules/eslint/lib/rules/no-lone-blocks.js +0 -136
  332. package/packages/config-eslint/node_modules/eslint/lib/rules/no-lonely-if.js +0 -88
  333. package/packages/config-eslint/node_modules/eslint/lib/rules/no-loop-func.js +0 -238
  334. package/packages/config-eslint/node_modules/eslint/lib/rules/no-loss-of-precision.js +0 -214
  335. package/packages/config-eslint/node_modules/eslint/lib/rules/no-magic-numbers.js +0 -243
  336. package/packages/config-eslint/node_modules/eslint/lib/rules/no-misleading-character-class.js +0 -537
  337. package/packages/config-eslint/node_modules/eslint/lib/rules/no-mixed-operators.js +0 -229
  338. package/packages/config-eslint/node_modules/eslint/lib/rules/no-mixed-requires.js +0 -238
  339. package/packages/config-eslint/node_modules/eslint/lib/rules/no-mixed-spaces-and-tabs.js +0 -116
  340. package/packages/config-eslint/node_modules/eslint/lib/rules/no-multi-assign.js +0 -67
  341. package/packages/config-eslint/node_modules/eslint/lib/rules/no-multi-spaces.js +0 -141
  342. package/packages/config-eslint/node_modules/eslint/lib/rules/no-multi-str.js +0 -65
  343. package/packages/config-eslint/node_modules/eslint/lib/rules/no-multiple-empty-lines.js +0 -154
  344. package/packages/config-eslint/node_modules/eslint/lib/rules/no-native-reassign.js +0 -98
  345. package/packages/config-eslint/node_modules/eslint/lib/rules/no-negated-condition.js +0 -95
  346. package/packages/config-eslint/node_modules/eslint/lib/rules/no-negated-in-lhs.js +0 -46
  347. package/packages/config-eslint/node_modules/eslint/lib/rules/no-nested-ternary.js +0 -44
  348. package/packages/config-eslint/node_modules/eslint/lib/rules/no-new-func.js +0 -87
  349. package/packages/config-eslint/node_modules/eslint/lib/rules/no-new-native-nonconstructor.js +0 -66
  350. package/packages/config-eslint/node_modules/eslint/lib/rules/no-new-object.js +0 -67
  351. package/packages/config-eslint/node_modules/eslint/lib/rules/no-new-require.js +0 -50
  352. package/packages/config-eslint/node_modules/eslint/lib/rules/no-new-symbol.js +0 -63
  353. package/packages/config-eslint/node_modules/eslint/lib/rules/no-new-wrappers.js +0 -60
  354. package/packages/config-eslint/node_modules/eslint/lib/rules/no-new.js +0 -43
  355. package/packages/config-eslint/node_modules/eslint/lib/rules/no-nonoctal-decimal-escape.js +0 -148
  356. package/packages/config-eslint/node_modules/eslint/lib/rules/no-obj-calls.js +0 -86
  357. package/packages/config-eslint/node_modules/eslint/lib/rules/no-object-constructor.js +0 -117
  358. package/packages/config-eslint/node_modules/eslint/lib/rules/no-octal-escape.js +0 -56
  359. package/packages/config-eslint/node_modules/eslint/lib/rules/no-octal.js +0 -45
  360. package/packages/config-eslint/node_modules/eslint/lib/rules/no-param-reassign.js +0 -230
  361. package/packages/config-eslint/node_modules/eslint/lib/rules/no-path-concat.js +0 -64
  362. package/packages/config-eslint/node_modules/eslint/lib/rules/no-plusplus.js +0 -105
  363. package/packages/config-eslint/node_modules/eslint/lib/rules/no-process-env.js +0 -51
  364. package/packages/config-eslint/node_modules/eslint/lib/rules/no-process-exit.js +0 -47
  365. package/packages/config-eslint/node_modules/eslint/lib/rules/no-promise-executor-return.js +0 -263
  366. package/packages/config-eslint/node_modules/eslint/lib/rules/no-proto.js +0 -48
  367. package/packages/config-eslint/node_modules/eslint/lib/rules/no-prototype-builtins.js +0 -159
  368. package/packages/config-eslint/node_modules/eslint/lib/rules/no-redeclare.js +0 -174
  369. package/packages/config-eslint/node_modules/eslint/lib/rules/no-regex-spaces.js +0 -197
  370. package/packages/config-eslint/node_modules/eslint/lib/rules/no-restricted-exports.js +0 -204
  371. package/packages/config-eslint/node_modules/eslint/lib/rules/no-restricted-globals.js +0 -124
  372. package/packages/config-eslint/node_modules/eslint/lib/rules/no-restricted-imports.js +0 -563
  373. package/packages/config-eslint/node_modules/eslint/lib/rules/no-restricted-modules.js +0 -213
  374. package/packages/config-eslint/node_modules/eslint/lib/rules/no-restricted-properties.js +0 -168
  375. package/packages/config-eslint/node_modules/eslint/lib/rules/no-restricted-syntax.js +0 -70
  376. package/packages/config-eslint/node_modules/eslint/lib/rules/no-return-assign.js +0 -80
  377. package/packages/config-eslint/node_modules/eslint/lib/rules/no-return-await.js +0 -135
  378. package/packages/config-eslint/node_modules/eslint/lib/rules/no-script-url.js +0 -61
  379. package/packages/config-eslint/node_modules/eslint/lib/rules/no-self-assign.js +0 -183
  380. package/packages/config-eslint/node_modules/eslint/lib/rules/no-self-compare.js +0 -60
  381. package/packages/config-eslint/node_modules/eslint/lib/rules/no-sequences.js +0 -139
  382. package/packages/config-eslint/node_modules/eslint/lib/rules/no-setter-return.js +0 -226
  383. package/packages/config-eslint/node_modules/eslint/lib/rules/no-shadow-restricted-names.js +0 -65
  384. package/packages/config-eslint/node_modules/eslint/lib/rules/no-shadow.js +0 -336
  385. package/packages/config-eslint/node_modules/eslint/lib/rules/no-spaced-func.js +0 -83
  386. package/packages/config-eslint/node_modules/eslint/lib/rules/no-sparse-arrays.js +0 -73
  387. package/packages/config-eslint/node_modules/eslint/lib/rules/no-sync.js +0 -64
  388. package/packages/config-eslint/node_modules/eslint/lib/rules/no-tabs.js +0 -81
  389. package/packages/config-eslint/node_modules/eslint/lib/rules/no-template-curly-in-string.js +0 -44
  390. package/packages/config-eslint/node_modules/eslint/lib/rules/no-ternary.js +0 -41
  391. package/packages/config-eslint/node_modules/eslint/lib/rules/no-this-before-super.js +0 -363
  392. package/packages/config-eslint/node_modules/eslint/lib/rules/no-throw-literal.js +0 -51
  393. package/packages/config-eslint/node_modules/eslint/lib/rules/no-trailing-spaces.js +0 -192
  394. package/packages/config-eslint/node_modules/eslint/lib/rules/no-undef-init.js +0 -75
  395. package/packages/config-eslint/node_modules/eslint/lib/rules/no-undef.js +0 -79
  396. package/packages/config-eslint/node_modules/eslint/lib/rules/no-undefined.js +0 -86
  397. package/packages/config-eslint/node_modules/eslint/lib/rules/no-underscore-dangle.js +0 -335
  398. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unexpected-multiline.js +0 -120
  399. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unmodified-loop-condition.js +0 -360
  400. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unneeded-ternary.js +0 -166
  401. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unreachable-loop.js +0 -185
  402. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unreachable.js +0 -293
  403. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unsafe-finally.js +0 -111
  404. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unsafe-negation.js +0 -128
  405. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unsafe-optional-chaining.js +0 -205
  406. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unused-expressions.js +0 -186
  407. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unused-labels.js +0 -143
  408. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unused-private-class-members.js +0 -195
  409. package/packages/config-eslint/node_modules/eslint/lib/rules/no-unused-vars.js +0 -881
  410. package/packages/config-eslint/node_modules/eslint/lib/rules/no-use-before-define.js +0 -348
  411. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-assignment.js +0 -566
  412. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-backreference.js +0 -244
  413. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-call.js +0 -90
  414. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-catch.js +0 -57
  415. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-computed-key.js +0 -168
  416. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-concat.js +0 -115
  417. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-constructor.js +0 -189
  418. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-escape.js +0 -333
  419. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-rename.js +0 -172
  420. package/packages/config-eslint/node_modules/eslint/lib/rules/no-useless-return.js +0 -369
  421. package/packages/config-eslint/node_modules/eslint/lib/rules/no-var.js +0 -334
  422. package/packages/config-eslint/node_modules/eslint/lib/rules/no-void.js +0 -64
  423. package/packages/config-eslint/node_modules/eslint/lib/rules/no-warning-comments.js +0 -201
  424. package/packages/config-eslint/node_modules/eslint/lib/rules/no-whitespace-before-property.js +0 -116
  425. package/packages/config-eslint/node_modules/eslint/lib/rules/no-with.js +0 -39
  426. package/packages/config-eslint/node_modules/eslint/lib/rules/nonblock-statement-body-position.js +0 -127
  427. package/packages/config-eslint/node_modules/eslint/lib/rules/object-curly-newline.js +0 -324
  428. package/packages/config-eslint/node_modules/eslint/lib/rules/object-curly-spacing.js +0 -311
  429. package/packages/config-eslint/node_modules/eslint/lib/rules/object-property-newline.js +0 -102
  430. package/packages/config-eslint/node_modules/eslint/lib/rules/object-shorthand.js +0 -521
  431. package/packages/config-eslint/node_modules/eslint/lib/rules/one-var-declaration-per-line.js +0 -95
  432. package/packages/config-eslint/node_modules/eslint/lib/rules/one-var.js +0 -567
  433. package/packages/config-eslint/node_modules/eslint/lib/rules/operator-assignment.js +0 -209
  434. package/packages/config-eslint/node_modules/eslint/lib/rules/operator-linebreak.js +0 -253
  435. package/packages/config-eslint/node_modules/eslint/lib/rules/padded-blocks.js +0 -310
  436. package/packages/config-eslint/node_modules/eslint/lib/rules/padding-line-between-statements.js +0 -590
  437. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-arrow-callback.js +0 -381
  438. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-const.js +0 -501
  439. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-destructuring.js +0 -301
  440. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-exponentiation-operator.js +0 -191
  441. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-named-capture-group.js +0 -178
  442. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-numeric-literals.js +0 -148
  443. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-object-has-own.js +0 -114
  444. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-object-spread.js +0 -298
  445. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-promise-reject-errors.js +0 -132
  446. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-reflect.js +0 -127
  447. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-regex-literals.js +0 -507
  448. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-rest-params.js +0 -118
  449. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-spread.js +0 -87
  450. package/packages/config-eslint/node_modules/eslint/lib/rules/prefer-template.js +0 -275
  451. package/packages/config-eslint/node_modules/eslint/lib/rules/quote-props.js +0 -310
  452. package/packages/config-eslint/node_modules/eslint/lib/rules/quotes.js +0 -350
  453. package/packages/config-eslint/node_modules/eslint/lib/rules/radix.js +0 -198
  454. package/packages/config-eslint/node_modules/eslint/lib/rules/require-atomic-updates.js +0 -331
  455. package/packages/config-eslint/node_modules/eslint/lib/rules/require-await.js +0 -147
  456. package/packages/config-eslint/node_modules/eslint/lib/rules/require-unicode-regexp.js +0 -129
  457. package/packages/config-eslint/node_modules/eslint/lib/rules/require-yield.js +0 -77
  458. package/packages/config-eslint/node_modules/eslint/lib/rules/rest-spread-spacing.js +0 -123
  459. package/packages/config-eslint/node_modules/eslint/lib/rules/semi-spacing.js +0 -248
  460. package/packages/config-eslint/node_modules/eslint/lib/rules/semi-style.js +0 -158
  461. package/packages/config-eslint/node_modules/eslint/lib/rules/semi.js +0 -438
  462. package/packages/config-eslint/node_modules/eslint/lib/rules/sort-imports.js +0 -241
  463. package/packages/config-eslint/node_modules/eslint/lib/rules/sort-keys.js +0 -230
  464. package/packages/config-eslint/node_modules/eslint/lib/rules/sort-vars.js +0 -104
  465. package/packages/config-eslint/node_modules/eslint/lib/rules/space-before-blocks.js +0 -204
  466. package/packages/config-eslint/node_modules/eslint/lib/rules/space-before-function-paren.js +0 -167
  467. package/packages/config-eslint/node_modules/eslint/lib/rules/space-in-parens.js +0 -285
  468. package/packages/config-eslint/node_modules/eslint/lib/rules/space-infix-ops.js +0 -198
  469. package/packages/config-eslint/node_modules/eslint/lib/rules/space-unary-ops.js +0 -324
  470. package/packages/config-eslint/node_modules/eslint/lib/rules/spaced-comment.js +0 -385
  471. package/packages/config-eslint/node_modules/eslint/lib/rules/strict.js +0 -277
  472. package/packages/config-eslint/node_modules/eslint/lib/rules/switch-colon-spacing.js +0 -132
  473. package/packages/config-eslint/node_modules/eslint/lib/rules/symbol-description.js +0 -73
  474. package/packages/config-eslint/node_modules/eslint/lib/rules/template-curly-spacing.js +0 -144
  475. package/packages/config-eslint/node_modules/eslint/lib/rules/template-tag-spacing.js +0 -93
  476. package/packages/config-eslint/node_modules/eslint/lib/rules/unicode-bom.js +0 -73
  477. package/packages/config-eslint/node_modules/eslint/lib/rules/use-isnan.js +0 -235
  478. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/ast-utils.js +0 -2292
  479. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/char-source.js +0 -240
  480. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/fix-tracker.js +0 -114
  481. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/keywords.js +0 -67
  482. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/lazy-loading-rule-map.js +0 -115
  483. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/regular-expressions.js +0 -42
  484. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/unicode/index.js +0 -16
  485. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/unicode/is-combining-character.js +0 -13
  486. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/unicode/is-emoji-modifier.js +0 -13
  487. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/unicode/is-regional-indicator-symbol.js +0 -13
  488. package/packages/config-eslint/node_modules/eslint/lib/rules/utils/unicode/is-surrogate-pair.js +0 -14
  489. package/packages/config-eslint/node_modules/eslint/lib/rules/valid-typeof.js +0 -127
  490. package/packages/config-eslint/node_modules/eslint/lib/rules/vars-on-top.js +0 -157
  491. package/packages/config-eslint/node_modules/eslint/lib/rules/wrap-iife.js +0 -207
  492. package/packages/config-eslint/node_modules/eslint/lib/rules/wrap-regex.js +0 -61
  493. package/packages/config-eslint/node_modules/eslint/lib/rules/yield-star-spacing.js +0 -130
  494. package/packages/config-eslint/node_modules/eslint/lib/rules/yoda.js +0 -353
  495. package/packages/config-eslint/node_modules/eslint/lib/shared/ajv.js +0 -34
  496. package/packages/config-eslint/node_modules/eslint/lib/shared/ast-utils.js +0 -29
  497. package/packages/config-eslint/node_modules/eslint/lib/shared/directives.js +0 -15
  498. package/packages/config-eslint/node_modules/eslint/lib/shared/flags.js +0 -27
  499. package/packages/config-eslint/node_modules/eslint/lib/shared/logging.js +0 -39
  500. package/packages/config-eslint/node_modules/eslint/lib/shared/runtime-info.js +0 -168
  501. package/packages/config-eslint/node_modules/eslint/lib/shared/serialization.js +0 -55
  502. package/packages/config-eslint/node_modules/eslint/lib/shared/severity.js +0 -49
  503. package/packages/config-eslint/node_modules/eslint/lib/shared/stats.js +0 -30
  504. package/packages/config-eslint/node_modules/eslint/lib/shared/string-utils.js +0 -58
  505. package/packages/config-eslint/node_modules/eslint/lib/shared/traverser.js +0 -195
  506. package/packages/config-eslint/node_modules/eslint/lib/shared/types.js +0 -250
  507. package/packages/config-eslint/node_modules/eslint/lib/unsupported-api.js +0 -28
  508. package/packages/config-eslint/node_modules/eslint/messages/all-files-ignored.js +0 -16
  509. package/packages/config-eslint/node_modules/eslint/messages/all-matched-files-ignored.js +0 -21
  510. package/packages/config-eslint/node_modules/eslint/messages/config-file-missing.js +0 -16
  511. package/packages/config-eslint/node_modules/eslint/messages/eslintrc-incompat.js +0 -119
  512. package/packages/config-eslint/node_modules/eslint/messages/eslintrc-plugins.js +0 -24
  513. package/packages/config-eslint/node_modules/eslint/messages/extend-config-missing.js +0 -13
  514. package/packages/config-eslint/node_modules/eslint/messages/failed-to-read-json.js +0 -11
  515. package/packages/config-eslint/node_modules/eslint/messages/file-not-found.js +0 -10
  516. package/packages/config-eslint/node_modules/eslint/messages/invalid-rule-options.js +0 -17
  517. package/packages/config-eslint/node_modules/eslint/messages/invalid-rule-severity.js +0 -13
  518. package/packages/config-eslint/node_modules/eslint/messages/no-config-found.js +0 -15
  519. package/packages/config-eslint/node_modules/eslint/messages/plugin-conflict.js +0 -22
  520. package/packages/config-eslint/node_modules/eslint/messages/plugin-invalid.js +0 -16
  521. package/packages/config-eslint/node_modules/eslint/messages/plugin-missing.js +0 -19
  522. package/packages/config-eslint/node_modules/eslint/messages/print-config-with-directory-path.js +0 -8
  523. package/packages/config-eslint/node_modules/eslint/messages/shared.js +0 -18
  524. package/packages/config-eslint/node_modules/eslint/messages/whitespace-found.js +0 -11
  525. package/packages/config-eslint/node_modules/eslint/package.json +0 -188
  526. package/packages/config-eslint/node_modules/eslint-scope/LICENSE +0 -22
  527. package/packages/config-eslint/node_modules/eslint-scope/README.md +0 -91
  528. package/packages/config-eslint/node_modules/eslint-scope/dist/eslint-scope.cjs +0 -2266
  529. package/packages/config-eslint/node_modules/eslint-scope/lib/definition.js +0 -85
  530. package/packages/config-eslint/node_modules/eslint-scope/lib/index.js +0 -169
  531. package/packages/config-eslint/node_modules/eslint-scope/lib/pattern-visitor.js +0 -154
  532. package/packages/config-eslint/node_modules/eslint-scope/lib/reference.js +0 -166
  533. package/packages/config-eslint/node_modules/eslint-scope/lib/referencer.js +0 -656
  534. package/packages/config-eslint/node_modules/eslint-scope/lib/scope-manager.js +0 -249
  535. package/packages/config-eslint/node_modules/eslint-scope/lib/scope.js +0 -793
  536. package/packages/config-eslint/node_modules/eslint-scope/lib/variable.js +0 -87
  537. package/packages/config-eslint/node_modules/eslint-scope/lib/version.js +0 -3
  538. package/packages/config-eslint/node_modules/eslint-scope/package.json +0 -65
  539. package/packages/config-eslint/node_modules/file-entry-cache/LICENSE +0 -22
  540. package/packages/config-eslint/node_modules/file-entry-cache/README.md +0 -115
  541. package/packages/config-eslint/node_modules/file-entry-cache/cache.js +0 -291
  542. package/packages/config-eslint/node_modules/file-entry-cache/package.json +0 -56
  543. package/packages/config-eslint/node_modules/find-up/index.d.ts +0 -138
  544. package/packages/config-eslint/node_modules/find-up/index.js +0 -89
  545. package/packages/config-eslint/node_modules/find-up/license +0 -9
  546. package/packages/config-eslint/node_modules/find-up/package.json +0 -54
  547. package/packages/config-eslint/node_modules/find-up/readme.md +0 -151
  548. package/packages/config-eslint/node_modules/flat-cache/LICENSE +0 -22
  549. package/packages/config-eslint/node_modules/flat-cache/README.md +0 -77
  550. package/packages/config-eslint/node_modules/flat-cache/changelog.md +0 -278
  551. package/packages/config-eslint/node_modules/flat-cache/package.json +0 -63
  552. package/packages/config-eslint/node_modules/flat-cache/src/cache.js +0 -214
  553. package/packages/config-eslint/node_modules/flat-cache/src/del.js +0 -30
  554. package/packages/config-eslint/node_modules/flat-cache/src/utils.js +0 -42
  555. package/packages/config-eslint/node_modules/glob-parent/LICENSE +0 -15
  556. package/packages/config-eslint/node_modules/glob-parent/README.md +0 -134
  557. package/packages/config-eslint/node_modules/glob-parent/index.js +0 -75
  558. package/packages/config-eslint/node_modules/glob-parent/package.json +0 -54
  559. package/packages/config-eslint/node_modules/json-schema-traverse/.eslintrc.yml +0 -27
  560. package/packages/config-eslint/node_modules/json-schema-traverse/.travis.yml +0 -8
  561. package/packages/config-eslint/node_modules/json-schema-traverse/LICENSE +0 -21
  562. package/packages/config-eslint/node_modules/json-schema-traverse/README.md +0 -83
  563. package/packages/config-eslint/node_modules/json-schema-traverse/index.js +0 -89
  564. package/packages/config-eslint/node_modules/json-schema-traverse/package.json +0 -43
  565. package/packages/config-eslint/node_modules/json-schema-traverse/spec/.eslintrc.yml +0 -6
  566. package/packages/config-eslint/node_modules/json-schema-traverse/spec/fixtures/schema.js +0 -125
  567. package/packages/config-eslint/node_modules/json-schema-traverse/spec/index.spec.js +0 -171
  568. package/packages/config-eslint/node_modules/locate-path/index.d.ts +0 -83
  569. package/packages/config-eslint/node_modules/locate-path/index.js +0 -68
  570. package/packages/config-eslint/node_modules/locate-path/license +0 -9
  571. package/packages/config-eslint/node_modules/locate-path/package.json +0 -46
  572. package/packages/config-eslint/node_modules/locate-path/readme.md +0 -125
  573. package/packages/config-eslint/node_modules/p-limit/index.d.ts +0 -42
  574. package/packages/config-eslint/node_modules/p-limit/index.js +0 -71
  575. package/packages/config-eslint/node_modules/p-limit/license +0 -9
  576. package/packages/config-eslint/node_modules/p-limit/package.json +0 -52
  577. package/packages/config-eslint/node_modules/p-limit/readme.md +0 -101
  578. package/packages/config-eslint/node_modules/p-locate/index.d.ts +0 -53
  579. package/packages/config-eslint/node_modules/p-locate/index.js +0 -50
  580. package/packages/config-eslint/node_modules/p-locate/license +0 -9
  581. package/packages/config-eslint/node_modules/p-locate/package.json +0 -54
  582. package/packages/config-eslint/node_modules/p-locate/readme.md +0 -93
  583. package/packages/config-eslint/node_modules/path-exists/index.d.ts +0 -28
  584. package/packages/config-eslint/node_modules/path-exists/index.js +0 -23
  585. package/packages/config-eslint/node_modules/path-exists/license +0 -9
  586. package/packages/config-eslint/node_modules/path-exists/package.json +0 -39
  587. package/packages/config-eslint/node_modules/path-exists/readme.md +0 -52
  588. package/packages/config-eslint/node_modules/yocto-queue/index.d.ts +0 -56
  589. package/packages/config-eslint/node_modules/yocto-queue/index.js +0 -68
  590. package/packages/config-eslint/node_modules/yocto-queue/license +0 -9
  591. package/packages/config-eslint/node_modules/yocto-queue/package.json +0 -43
  592. package/packages/config-eslint/node_modules/yocto-queue/readme.md +0 -64
@@ -1,2266 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var assert = require('assert');
6
- var estraverse = require('estraverse');
7
- var esrecurse = require('esrecurse');
8
-
9
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
10
-
11
- var assert__default = /*#__PURE__*/_interopDefaultLegacy(assert);
12
- var estraverse__default = /*#__PURE__*/_interopDefaultLegacy(estraverse);
13
- var esrecurse__default = /*#__PURE__*/_interopDefaultLegacy(esrecurse);
14
-
15
- /*
16
- Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>
17
-
18
- Redistribution and use in source and binary forms, with or without
19
- modification, are permitted provided that the following conditions are met:
20
-
21
- * Redistributions of source code must retain the above copyright
22
- notice, this list of conditions and the following disclaimer.
23
- * Redistributions in binary form must reproduce the above copyright
24
- notice, this list of conditions and the following disclaimer in the
25
- documentation and/or other materials provided with the distribution.
26
-
27
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
28
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30
- ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
31
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
32
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
33
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
34
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
36
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37
- */
38
-
39
- const READ = 0x1;
40
- const WRITE = 0x2;
41
- const RW = READ | WRITE;
42
-
43
- /**
44
- * A Reference represents a single occurrence of an identifier in code.
45
- * @constructor Reference
46
- */
47
- class Reference {
48
- constructor(ident, scope, flag, writeExpr, maybeImplicitGlobal, partial, init) {
49
-
50
- /**
51
- * Identifier syntax node.
52
- * @member {espreeIdentifier} Reference#identifier
53
- */
54
- this.identifier = ident;
55
-
56
- /**
57
- * Reference to the enclosing Scope.
58
- * @member {Scope} Reference#from
59
- */
60
- this.from = scope;
61
-
62
- /**
63
- * Whether the reference comes from a dynamic scope (such as 'eval',
64
- * 'with', etc.), and may be trapped by dynamic scopes.
65
- * @member {boolean} Reference#tainted
66
- */
67
- this.tainted = false;
68
-
69
- /**
70
- * The variable this reference is resolved with.
71
- * @member {Variable} Reference#resolved
72
- */
73
- this.resolved = null;
74
-
75
- /**
76
- * The read-write mode of the reference. (Value is one of {@link
77
- * Reference.READ}, {@link Reference.RW}, {@link Reference.WRITE}).
78
- * @member {number} Reference#flag
79
- * @private
80
- */
81
- this.flag = flag;
82
- if (this.isWrite()) {
83
-
84
- /**
85
- * If reference is writeable, this is the tree being written to it.
86
- * @member {espreeNode} Reference#writeExpr
87
- */
88
- this.writeExpr = writeExpr;
89
-
90
- /**
91
- * Whether the Reference might refer to a partial value of writeExpr.
92
- * @member {boolean} Reference#partial
93
- */
94
- this.partial = partial;
95
-
96
- /**
97
- * Whether the Reference is to write of initialization.
98
- * @member {boolean} Reference#init
99
- */
100
- this.init = init;
101
- }
102
- this.__maybeImplicitGlobal = maybeImplicitGlobal;
103
- }
104
-
105
- /**
106
- * Whether the reference is static.
107
- * @function Reference#isStatic
108
- * @returns {boolean} static
109
- */
110
- isStatic() {
111
- return !this.tainted && this.resolved && this.resolved.scope.isStatic();
112
- }
113
-
114
- /**
115
- * Whether the reference is writeable.
116
- * @function Reference#isWrite
117
- * @returns {boolean} write
118
- */
119
- isWrite() {
120
- return !!(this.flag & Reference.WRITE);
121
- }
122
-
123
- /**
124
- * Whether the reference is readable.
125
- * @function Reference#isRead
126
- * @returns {boolean} read
127
- */
128
- isRead() {
129
- return !!(this.flag & Reference.READ);
130
- }
131
-
132
- /**
133
- * Whether the reference is read-only.
134
- * @function Reference#isReadOnly
135
- * @returns {boolean} read only
136
- */
137
- isReadOnly() {
138
- return this.flag === Reference.READ;
139
- }
140
-
141
- /**
142
- * Whether the reference is write-only.
143
- * @function Reference#isWriteOnly
144
- * @returns {boolean} write only
145
- */
146
- isWriteOnly() {
147
- return this.flag === Reference.WRITE;
148
- }
149
-
150
- /**
151
- * Whether the reference is read-write.
152
- * @function Reference#isReadWrite
153
- * @returns {boolean} read write
154
- */
155
- isReadWrite() {
156
- return this.flag === Reference.RW;
157
- }
158
- }
159
-
160
- /**
161
- * @constant Reference.READ
162
- * @private
163
- */
164
- Reference.READ = READ;
165
-
166
- /**
167
- * @constant Reference.WRITE
168
- * @private
169
- */
170
- Reference.WRITE = WRITE;
171
-
172
- /**
173
- * @constant Reference.RW
174
- * @private
175
- */
176
- Reference.RW = RW;
177
-
178
- /* vim: set sw=4 ts=4 et tw=80 : */
179
-
180
- /*
181
- Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>
182
-
183
- Redistribution and use in source and binary forms, with or without
184
- modification, are permitted provided that the following conditions are met:
185
-
186
- * Redistributions of source code must retain the above copyright
187
- notice, this list of conditions and the following disclaimer.
188
- * Redistributions in binary form must reproduce the above copyright
189
- notice, this list of conditions and the following disclaimer in the
190
- documentation and/or other materials provided with the distribution.
191
-
192
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
193
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
194
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
195
- ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
196
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
197
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
198
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
199
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
200
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
201
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
202
- */
203
-
204
- /**
205
- * A Variable represents a locally scoped identifier. These include arguments to
206
- * functions.
207
- * @constructor Variable
208
- */
209
- class Variable {
210
- constructor(name, scope) {
211
-
212
- /**
213
- * The variable name, as given in the source code.
214
- * @member {string} Variable#name
215
- */
216
- this.name = name;
217
-
218
- /**
219
- * List of defining occurrences of this variable (like in 'var ...'
220
- * statements or as parameter), as AST nodes.
221
- * @member {espree.Identifier[]} Variable#identifiers
222
- */
223
- this.identifiers = [];
224
-
225
- /**
226
- * List of {@link Reference|references} of this variable (excluding parameter entries)
227
- * in its defining scope and all nested scopes. For defining
228
- * occurrences only see {@link Variable#defs}.
229
- * @member {Reference[]} Variable#references
230
- */
231
- this.references = [];
232
-
233
- /**
234
- * List of defining occurrences of this variable (like in 'var ...'
235
- * statements or as parameter), as custom objects.
236
- * @member {Definition[]} Variable#defs
237
- */
238
- this.defs = [];
239
-
240
- this.tainted = false;
241
-
242
- /**
243
- * Whether this is a stack variable.
244
- * @member {boolean} Variable#stack
245
- */
246
- this.stack = true;
247
-
248
- /**
249
- * Reference to the enclosing Scope.
250
- * @member {Scope} Variable#scope
251
- */
252
- this.scope = scope;
253
- }
254
- }
255
-
256
- Variable.CatchClause = "CatchClause";
257
- Variable.Parameter = "Parameter";
258
- Variable.FunctionName = "FunctionName";
259
- Variable.ClassName = "ClassName";
260
- Variable.Variable = "Variable";
261
- Variable.ImportBinding = "ImportBinding";
262
- Variable.ImplicitGlobalVariable = "ImplicitGlobalVariable";
263
-
264
- /* vim: set sw=4 ts=4 et tw=80 : */
265
-
266
- /*
267
- Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>
268
-
269
- Redistribution and use in source and binary forms, with or without
270
- modification, are permitted provided that the following conditions are met:
271
-
272
- * Redistributions of source code must retain the above copyright
273
- notice, this list of conditions and the following disclaimer.
274
- * Redistributions in binary form must reproduce the above copyright
275
- notice, this list of conditions and the following disclaimer in the
276
- documentation and/or other materials provided with the distribution.
277
-
278
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
279
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
280
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
281
- ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
282
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
283
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
284
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
285
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
286
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
287
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
288
- */
289
-
290
- /**
291
- * @constructor Definition
292
- */
293
- class Definition {
294
- constructor(type, name, node, parent, index, kind) {
295
-
296
- /**
297
- * @member {string} Definition#type - type of the occurrence (e.g. "Parameter", "Variable", ...).
298
- */
299
- this.type = type;
300
-
301
- /**
302
- * @member {espree.Identifier} Definition#name - the identifier AST node of the occurrence.
303
- */
304
- this.name = name;
305
-
306
- /**
307
- * @member {espree.Node} Definition#node - the enclosing node of the identifier.
308
- */
309
- this.node = node;
310
-
311
- /**
312
- * @member {espree.Node?} Definition#parent - the enclosing statement node of the identifier.
313
- */
314
- this.parent = parent;
315
-
316
- /**
317
- * @member {number?} Definition#index - the index in the declaration statement.
318
- */
319
- this.index = index;
320
-
321
- /**
322
- * @member {string?} Definition#kind - the kind of the declaration statement.
323
- */
324
- this.kind = kind;
325
- }
326
- }
327
-
328
- /**
329
- * @constructor ParameterDefinition
330
- */
331
- class ParameterDefinition extends Definition {
332
- constructor(name, node, index, rest) {
333
- super(Variable.Parameter, name, node, null, index, null);
334
-
335
- /**
336
- * Whether the parameter definition is a part of a rest parameter.
337
- * @member {boolean} ParameterDefinition#rest
338
- */
339
- this.rest = rest;
340
- }
341
- }
342
-
343
- /* vim: set sw=4 ts=4 et tw=80 : */
344
-
345
- /*
346
- Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>
347
-
348
- Redistribution and use in source and binary forms, with or without
349
- modification, are permitted provided that the following conditions are met:
350
-
351
- * Redistributions of source code must retain the above copyright
352
- notice, this list of conditions and the following disclaimer.
353
- * Redistributions in binary form must reproduce the above copyright
354
- notice, this list of conditions and the following disclaimer in the
355
- documentation and/or other materials provided with the distribution.
356
-
357
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
358
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
359
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
360
- ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
361
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
362
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
363
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
364
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
365
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
366
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
367
- */
368
-
369
- const { Syntax: Syntax$2 } = estraverse__default["default"];
370
-
371
- /**
372
- * Test if scope is struct
373
- * @param {Scope} scope scope
374
- * @param {Block} block block
375
- * @param {boolean} isMethodDefinition is method definition
376
- * @returns {boolean} is strict scope
377
- */
378
- function isStrictScope(scope, block, isMethodDefinition) {
379
- let body;
380
-
381
- // When upper scope is exists and strict, inner scope is also strict.
382
- if (scope.upper && scope.upper.isStrict) {
383
- return true;
384
- }
385
-
386
- if (isMethodDefinition) {
387
- return true;
388
- }
389
-
390
- if (scope.type === "class" || scope.type === "module") {
391
- return true;
392
- }
393
-
394
- if (scope.type === "block" || scope.type === "switch") {
395
- return false;
396
- }
397
-
398
- if (scope.type === "function") {
399
- if (block.type === Syntax$2.ArrowFunctionExpression && block.body.type !== Syntax$2.BlockStatement) {
400
- return false;
401
- }
402
-
403
- if (block.type === Syntax$2.Program) {
404
- body = block;
405
- } else {
406
- body = block.body;
407
- }
408
-
409
- if (!body) {
410
- return false;
411
- }
412
- } else if (scope.type === "global") {
413
- body = block;
414
- } else {
415
- return false;
416
- }
417
-
418
- // Search for a 'use strict' directive.
419
- for (let i = 0, iz = body.body.length; i < iz; ++i) {
420
- const stmt = body.body[i];
421
-
422
- /*
423
- * Check if the current statement is a directive.
424
- * If it isn't, then we're past the directive prologue
425
- * so stop the search because directives cannot
426
- * appear after this point.
427
- *
428
- * Some parsers set `directive:null` on non-directive
429
- * statements, so the `typeof` check is safer than
430
- * checking for property existence.
431
- */
432
- if (typeof stmt.directive !== "string") {
433
- break;
434
- }
435
-
436
- if (stmt.directive === "use strict") {
437
- return true;
438
- }
439
- }
440
-
441
- return false;
442
- }
443
-
444
- /**
445
- * Register scope
446
- * @param {ScopeManager} scopeManager scope manager
447
- * @param {Scope} scope scope
448
- * @returns {void}
449
- */
450
- function registerScope(scopeManager, scope) {
451
- scopeManager.scopes.push(scope);
452
-
453
- const scopes = scopeManager.__nodeToScope.get(scope.block);
454
-
455
- if (scopes) {
456
- scopes.push(scope);
457
- } else {
458
- scopeManager.__nodeToScope.set(scope.block, [scope]);
459
- }
460
- }
461
-
462
- /**
463
- * Should be statically
464
- * @param {Object} def def
465
- * @returns {boolean} should be statically
466
- */
467
- function shouldBeStatically(def) {
468
- return (
469
- (def.type === Variable.ClassName) ||
470
- (def.type === Variable.Variable && def.parent.kind !== "var")
471
- );
472
- }
473
-
474
- /**
475
- * @constructor Scope
476
- */
477
- class Scope {
478
- constructor(scopeManager, type, upperScope, block, isMethodDefinition) {
479
-
480
- /**
481
- * One of "global", "module", "function", "function-expression-name", "block", "switch", "catch", "with", "for",
482
- * "class", "class-field-initializer", "class-static-block".
483
- * @member {string} Scope#type
484
- */
485
- this.type = type;
486
-
487
- /**
488
- * The scoped {@link Variable}s of this scope, as <code>{ Variable.name
489
- * : Variable }</code>.
490
- * @member {Map} Scope#set
491
- */
492
- this.set = new Map();
493
-
494
- /**
495
- * The tainted variables of this scope, as <code>{ Variable.name :
496
- * boolean }</code>.
497
- * @member {Map} Scope#taints
498
- */
499
- this.taints = new Map();
500
-
501
- /**
502
- * Generally, through the lexical scoping of JS you can always know
503
- * which variable an identifier in the source code refers to. There are
504
- * a few exceptions to this rule. With 'global' and 'with' scopes you
505
- * can only decide at runtime which variable a reference refers to.
506
- * Moreover, if 'eval()' is used in a scope, it might introduce new
507
- * bindings in this or its parent scopes.
508
- * All those scopes are considered 'dynamic'.
509
- * @member {boolean} Scope#dynamic
510
- */
511
- this.dynamic = this.type === "global" || this.type === "with";
512
-
513
- /**
514
- * A reference to the scope-defining syntax node.
515
- * @member {espree.Node} Scope#block
516
- */
517
- this.block = block;
518
-
519
- /**
520
- * The {@link Reference|references} that are not resolved with this scope.
521
- * @member {Reference[]} Scope#through
522
- */
523
- this.through = [];
524
-
525
- /**
526
- * The scoped {@link Variable}s of this scope. In the case of a
527
- * 'function' scope this includes the automatic argument <em>arguments</em> as
528
- * its first element, as well as all further formal arguments.
529
- * @member {Variable[]} Scope#variables
530
- */
531
- this.variables = [];
532
-
533
- /**
534
- * Any variable {@link Reference|reference} found in this scope. This
535
- * includes occurrences of local variables as well as variables from
536
- * parent scopes (including the global scope). For local variables
537
- * this also includes defining occurrences (like in a 'var' statement).
538
- * In a 'function' scope this does not include the occurrences of the
539
- * formal parameter in the parameter list.
540
- * @member {Reference[]} Scope#references
541
- */
542
- this.references = [];
543
-
544
- /**
545
- * For 'global' and 'function' scopes, this is a self-reference. For
546
- * other scope types this is the <em>variableScope</em> value of the
547
- * parent scope.
548
- * @member {Scope} Scope#variableScope
549
- */
550
- this.variableScope =
551
- this.type === "global" ||
552
- this.type === "module" ||
553
- this.type === "function" ||
554
- this.type === "class-field-initializer" ||
555
- this.type === "class-static-block"
556
- ? this
557
- : upperScope.variableScope;
558
-
559
- /**
560
- * Whether this scope is created by a FunctionExpression.
561
- * @member {boolean} Scope#functionExpressionScope
562
- */
563
- this.functionExpressionScope = false;
564
-
565
- /**
566
- * Whether this is a scope that contains an 'eval()' invocation.
567
- * @member {boolean} Scope#directCallToEvalScope
568
- */
569
- this.directCallToEvalScope = false;
570
-
571
- /**
572
- * @member {boolean} Scope#thisFound
573
- */
574
- this.thisFound = false;
575
-
576
- this.__left = [];
577
-
578
- /**
579
- * Reference to the parent {@link Scope|scope}.
580
- * @member {Scope} Scope#upper
581
- */
582
- this.upper = upperScope;
583
-
584
- /**
585
- * Whether 'use strict' is in effect in this scope.
586
- * @member {boolean} Scope#isStrict
587
- */
588
- this.isStrict = scopeManager.isStrictModeSupported()
589
- ? isStrictScope(this, block, isMethodDefinition)
590
- : false;
591
-
592
- /**
593
- * List of nested {@link Scope}s.
594
- * @member {Scope[]} Scope#childScopes
595
- */
596
- this.childScopes = [];
597
- if (this.upper) {
598
- this.upper.childScopes.push(this);
599
- }
600
-
601
- this.__declaredVariables = scopeManager.__declaredVariables;
602
-
603
- registerScope(scopeManager, this);
604
- }
605
-
606
- __shouldStaticallyClose(scopeManager) {
607
- return (!this.dynamic || scopeManager.__isOptimistic());
608
- }
609
-
610
- __shouldStaticallyCloseForGlobal(ref) {
611
-
612
- // On global scope, let/const/class declarations should be resolved statically.
613
- const name = ref.identifier.name;
614
-
615
- if (!this.set.has(name)) {
616
- return false;
617
- }
618
-
619
- const variable = this.set.get(name);
620
- const defs = variable.defs;
621
-
622
- return defs.length > 0 && defs.every(shouldBeStatically);
623
- }
624
-
625
- __staticCloseRef(ref) {
626
- if (!this.__resolve(ref)) {
627
- this.__delegateToUpperScope(ref);
628
- }
629
- }
630
-
631
- __dynamicCloseRef(ref) {
632
-
633
- // notify all names are through to global
634
- let current = this;
635
-
636
- do {
637
- current.through.push(ref);
638
- current = current.upper;
639
- } while (current);
640
- }
641
-
642
- __globalCloseRef(ref) {
643
-
644
- // let/const/class declarations should be resolved statically.
645
- // others should be resolved dynamically.
646
- if (this.__shouldStaticallyCloseForGlobal(ref)) {
647
- this.__staticCloseRef(ref);
648
- } else {
649
- this.__dynamicCloseRef(ref);
650
- }
651
- }
652
-
653
- __close(scopeManager) {
654
- let closeRef;
655
-
656
- if (this.__shouldStaticallyClose(scopeManager)) {
657
- closeRef = this.__staticCloseRef;
658
- } else if (this.type !== "global") {
659
- closeRef = this.__dynamicCloseRef;
660
- } else {
661
- closeRef = this.__globalCloseRef;
662
- }
663
-
664
- // Try Resolving all references in this scope.
665
- for (let i = 0, iz = this.__left.length; i < iz; ++i) {
666
- const ref = this.__left[i];
667
-
668
- closeRef.call(this, ref);
669
- }
670
- this.__left = null;
671
-
672
- return this.upper;
673
- }
674
-
675
- // To override by function scopes.
676
- // References in default parameters isn't resolved to variables which are in their function body.
677
- __isValidResolution(ref, variable) { // eslint-disable-line class-methods-use-this, no-unused-vars -- Desired as instance method with signature
678
- return true;
679
- }
680
-
681
- __resolve(ref) {
682
- const name = ref.identifier.name;
683
-
684
- if (!this.set.has(name)) {
685
- return false;
686
- }
687
- const variable = this.set.get(name);
688
-
689
- if (!this.__isValidResolution(ref, variable)) {
690
- return false;
691
- }
692
- variable.references.push(ref);
693
- variable.stack = variable.stack && ref.from.variableScope === this.variableScope;
694
- if (ref.tainted) {
695
- variable.tainted = true;
696
- this.taints.set(variable.name, true);
697
- }
698
- ref.resolved = variable;
699
-
700
- return true;
701
- }
702
-
703
- __delegateToUpperScope(ref) {
704
- if (this.upper) {
705
- this.upper.__left.push(ref);
706
- }
707
- this.through.push(ref);
708
- }
709
-
710
- __addDeclaredVariablesOfNode(variable, node) {
711
- if (node === null || node === void 0) {
712
- return;
713
- }
714
-
715
- let variables = this.__declaredVariables.get(node);
716
-
717
- if (variables === null || variables === void 0) {
718
- variables = [];
719
- this.__declaredVariables.set(node, variables);
720
- }
721
- if (!variables.includes(variable)) {
722
- variables.push(variable);
723
- }
724
- }
725
-
726
- __defineGeneric(name, set, variables, node, def) {
727
- let variable;
728
-
729
- variable = set.get(name);
730
- if (!variable) {
731
- variable = new Variable(name, this);
732
- set.set(name, variable);
733
- variables.push(variable);
734
- }
735
-
736
- if (def) {
737
- variable.defs.push(def);
738
- this.__addDeclaredVariablesOfNode(variable, def.node);
739
- this.__addDeclaredVariablesOfNode(variable, def.parent);
740
- }
741
- if (node) {
742
- variable.identifiers.push(node);
743
- }
744
- }
745
-
746
- __define(node, def) {
747
- if (node && node.type === Syntax$2.Identifier) {
748
- this.__defineGeneric(
749
- node.name,
750
- this.set,
751
- this.variables,
752
- node,
753
- def
754
- );
755
- }
756
- }
757
-
758
- __referencing(node, assign, writeExpr, maybeImplicitGlobal, partial, init) {
759
-
760
- // because Array element may be null
761
- if (!node || node.type !== Syntax$2.Identifier) {
762
- return;
763
- }
764
-
765
- // Specially handle like `this`.
766
- if (node.name === "super") {
767
- return;
768
- }
769
-
770
- const ref = new Reference(node, this, assign || Reference.READ, writeExpr, maybeImplicitGlobal, !!partial, !!init);
771
-
772
- this.references.push(ref);
773
- this.__left.push(ref);
774
- }
775
-
776
- __detectEval() {
777
- let current = this;
778
-
779
- this.directCallToEvalScope = true;
780
- do {
781
- current.dynamic = true;
782
- current = current.upper;
783
- } while (current);
784
- }
785
-
786
- __detectThis() {
787
- this.thisFound = true;
788
- }
789
-
790
- __isClosed() {
791
- return this.__left === null;
792
- }
793
-
794
- /**
795
- * returns resolved {Reference}
796
- * @function Scope#resolve
797
- * @param {Espree.Identifier} ident identifier to be resolved.
798
- * @returns {Reference} reference
799
- */
800
- resolve(ident) {
801
- let ref, i, iz;
802
-
803
- assert__default["default"](this.__isClosed(), "Scope should be closed.");
804
- assert__default["default"](ident.type === Syntax$2.Identifier, "Target should be identifier.");
805
- for (i = 0, iz = this.references.length; i < iz; ++i) {
806
- ref = this.references[i];
807
- if (ref.identifier === ident) {
808
- return ref;
809
- }
810
- }
811
- return null;
812
- }
813
-
814
- /**
815
- * returns this scope is static
816
- * @function Scope#isStatic
817
- * @returns {boolean} static
818
- */
819
- isStatic() {
820
- return !this.dynamic;
821
- }
822
-
823
- /**
824
- * returns this scope has materialized arguments
825
- * @function Scope#isArgumentsMaterialized
826
- * @returns {boolean} arguemnts materialized
827
- */
828
- isArgumentsMaterialized() { // eslint-disable-line class-methods-use-this -- Desired as instance method
829
- return true;
830
- }
831
-
832
- /**
833
- * returns this scope has materialized `this` reference
834
- * @function Scope#isThisMaterialized
835
- * @returns {boolean} this materialized
836
- */
837
- isThisMaterialized() { // eslint-disable-line class-methods-use-this -- Desired as instance method
838
- return true;
839
- }
840
-
841
- isUsedName(name) {
842
- if (this.set.has(name)) {
843
- return true;
844
- }
845
- for (let i = 0, iz = this.through.length; i < iz; ++i) {
846
- if (this.through[i].identifier.name === name) {
847
- return true;
848
- }
849
- }
850
- return false;
851
- }
852
- }
853
-
854
- /**
855
- * Global scope.
856
- */
857
- class GlobalScope extends Scope {
858
- constructor(scopeManager, block) {
859
- super(scopeManager, "global", null, block, false);
860
- this.implicit = {
861
- set: new Map(),
862
- variables: [],
863
-
864
- /**
865
- * List of {@link Reference}s that are left to be resolved (i.e. which
866
- * need to be linked to the variable they refer to).
867
- * @member {Reference[]} Scope#implicit#left
868
- */
869
- left: []
870
- };
871
- }
872
-
873
- __close(scopeManager) {
874
- const implicit = [];
875
-
876
- for (let i = 0, iz = this.__left.length; i < iz; ++i) {
877
- const ref = this.__left[i];
878
-
879
- if (ref.__maybeImplicitGlobal && !this.set.has(ref.identifier.name)) {
880
- implicit.push(ref.__maybeImplicitGlobal);
881
- }
882
- }
883
-
884
- // create an implicit global variable from assignment expression
885
- for (let i = 0, iz = implicit.length; i < iz; ++i) {
886
- const info = implicit[i];
887
-
888
- this.__defineImplicit(info.pattern,
889
- new Definition(
890
- Variable.ImplicitGlobalVariable,
891
- info.pattern,
892
- info.node,
893
- null,
894
- null,
895
- null
896
- ));
897
-
898
- }
899
-
900
- this.implicit.left = this.__left;
901
-
902
- return super.__close(scopeManager);
903
- }
904
-
905
- __defineImplicit(node, def) {
906
- if (node && node.type === Syntax$2.Identifier) {
907
- this.__defineGeneric(
908
- node.name,
909
- this.implicit.set,
910
- this.implicit.variables,
911
- node,
912
- def
913
- );
914
- }
915
- }
916
- }
917
-
918
- /**
919
- * Module scope.
920
- */
921
- class ModuleScope extends Scope {
922
- constructor(scopeManager, upperScope, block) {
923
- super(scopeManager, "module", upperScope, block, false);
924
- }
925
- }
926
-
927
- /**
928
- * Function expression name scope.
929
- */
930
- class FunctionExpressionNameScope extends Scope {
931
- constructor(scopeManager, upperScope, block) {
932
- super(scopeManager, "function-expression-name", upperScope, block, false);
933
- this.__define(block.id,
934
- new Definition(
935
- Variable.FunctionName,
936
- block.id,
937
- block,
938
- null,
939
- null,
940
- null
941
- ));
942
- this.functionExpressionScope = true;
943
- }
944
- }
945
-
946
- /**
947
- * Catch scope.
948
- */
949
- class CatchScope extends Scope {
950
- constructor(scopeManager, upperScope, block) {
951
- super(scopeManager, "catch", upperScope, block, false);
952
- }
953
- }
954
-
955
- /**
956
- * With statement scope.
957
- */
958
- class WithScope extends Scope {
959
- constructor(scopeManager, upperScope, block) {
960
- super(scopeManager, "with", upperScope, block, false);
961
- }
962
-
963
- __close(scopeManager) {
964
- if (this.__shouldStaticallyClose(scopeManager)) {
965
- return super.__close(scopeManager);
966
- }
967
-
968
- for (let i = 0, iz = this.__left.length; i < iz; ++i) {
969
- const ref = this.__left[i];
970
-
971
- ref.tainted = true;
972
- this.__delegateToUpperScope(ref);
973
- }
974
- this.__left = null;
975
-
976
- return this.upper;
977
- }
978
- }
979
-
980
- /**
981
- * Block scope.
982
- */
983
- class BlockScope extends Scope {
984
- constructor(scopeManager, upperScope, block) {
985
- super(scopeManager, "block", upperScope, block, false);
986
- }
987
- }
988
-
989
- /**
990
- * Switch scope.
991
- */
992
- class SwitchScope extends Scope {
993
- constructor(scopeManager, upperScope, block) {
994
- super(scopeManager, "switch", upperScope, block, false);
995
- }
996
- }
997
-
998
- /**
999
- * Function scope.
1000
- */
1001
- class FunctionScope extends Scope {
1002
- constructor(scopeManager, upperScope, block, isMethodDefinition) {
1003
- super(scopeManager, "function", upperScope, block, isMethodDefinition);
1004
-
1005
- // section 9.2.13, FunctionDeclarationInstantiation.
1006
- // NOTE Arrow functions never have an arguments objects.
1007
- if (this.block.type !== Syntax$2.ArrowFunctionExpression) {
1008
- this.__defineArguments();
1009
- }
1010
- }
1011
-
1012
- isArgumentsMaterialized() {
1013
-
1014
- // TODO(Constellation)
1015
- // We can more aggressive on this condition like this.
1016
- //
1017
- // function t() {
1018
- // // arguments of t is always hidden.
1019
- // function arguments() {
1020
- // }
1021
- // }
1022
- if (this.block.type === Syntax$2.ArrowFunctionExpression) {
1023
- return false;
1024
- }
1025
-
1026
- if (!this.isStatic()) {
1027
- return true;
1028
- }
1029
-
1030
- const variable = this.set.get("arguments");
1031
-
1032
- assert__default["default"](variable, "Always have arguments variable.");
1033
- return variable.tainted || variable.references.length !== 0;
1034
- }
1035
-
1036
- isThisMaterialized() {
1037
- if (!this.isStatic()) {
1038
- return true;
1039
- }
1040
- return this.thisFound;
1041
- }
1042
-
1043
- __defineArguments() {
1044
- this.__defineGeneric(
1045
- "arguments",
1046
- this.set,
1047
- this.variables,
1048
- null,
1049
- null
1050
- );
1051
- this.taints.set("arguments", true);
1052
- }
1053
-
1054
- // References in default parameters isn't resolved to variables which are in their function body.
1055
- // const x = 1
1056
- // function f(a = x) { // This `x` is resolved to the `x` in the outer scope.
1057
- // const x = 2
1058
- // console.log(a)
1059
- // }
1060
- __isValidResolution(ref, variable) {
1061
-
1062
- // If `options.nodejsScope` is true, `this.block` becomes a Program node.
1063
- if (this.block.type === "Program") {
1064
- return true;
1065
- }
1066
-
1067
- const bodyStart = this.block.body.range[0];
1068
-
1069
- // It's invalid resolution in the following case:
1070
- return !(
1071
- variable.scope === this &&
1072
- ref.identifier.range[0] < bodyStart && // the reference is in the parameter part.
1073
- variable.defs.every(d => d.name.range[0] >= bodyStart) // the variable is in the body.
1074
- );
1075
- }
1076
- }
1077
-
1078
- /**
1079
- * Scope of for, for-in, and for-of statements.
1080
- */
1081
- class ForScope extends Scope {
1082
- constructor(scopeManager, upperScope, block) {
1083
- super(scopeManager, "for", upperScope, block, false);
1084
- }
1085
- }
1086
-
1087
- /**
1088
- * Class scope.
1089
- */
1090
- class ClassScope extends Scope {
1091
- constructor(scopeManager, upperScope, block) {
1092
- super(scopeManager, "class", upperScope, block, false);
1093
- }
1094
- }
1095
-
1096
- /**
1097
- * Class field initializer scope.
1098
- */
1099
- class ClassFieldInitializerScope extends Scope {
1100
- constructor(scopeManager, upperScope, block) {
1101
- super(scopeManager, "class-field-initializer", upperScope, block, true);
1102
- }
1103
- }
1104
-
1105
- /**
1106
- * Class static block scope.
1107
- */
1108
- class ClassStaticBlockScope extends Scope {
1109
- constructor(scopeManager, upperScope, block) {
1110
- super(scopeManager, "class-static-block", upperScope, block, true);
1111
- }
1112
- }
1113
-
1114
- /* vim: set sw=4 ts=4 et tw=80 : */
1115
-
1116
- /*
1117
- Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>
1118
-
1119
- Redistribution and use in source and binary forms, with or without
1120
- modification, are permitted provided that the following conditions are met:
1121
-
1122
- * Redistributions of source code must retain the above copyright
1123
- notice, this list of conditions and the following disclaimer.
1124
- * Redistributions in binary form must reproduce the above copyright
1125
- notice, this list of conditions and the following disclaimer in the
1126
- documentation and/or other materials provided with the distribution.
1127
-
1128
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
1129
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1130
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1131
- ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
1132
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
1133
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
1134
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
1135
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1136
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
1137
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1138
- */
1139
-
1140
- /**
1141
- * @constructor ScopeManager
1142
- */
1143
- class ScopeManager {
1144
- constructor(options) {
1145
- this.scopes = [];
1146
- this.globalScope = null;
1147
- this.__nodeToScope = new WeakMap();
1148
- this.__currentScope = null;
1149
- this.__options = options;
1150
- this.__declaredVariables = new WeakMap();
1151
- }
1152
-
1153
- __isOptimistic() {
1154
- return this.__options.optimistic;
1155
- }
1156
-
1157
- __ignoreEval() {
1158
- return this.__options.ignoreEval;
1159
- }
1160
-
1161
- isGlobalReturn() {
1162
- return this.__options.nodejsScope || this.__options.sourceType === "commonjs";
1163
- }
1164
-
1165
- isModule() {
1166
- return this.__options.sourceType === "module";
1167
- }
1168
-
1169
- isImpliedStrict() {
1170
- return this.__options.impliedStrict;
1171
- }
1172
-
1173
- isStrictModeSupported() {
1174
- return this.__options.ecmaVersion >= 5;
1175
- }
1176
-
1177
- // Returns appropriate scope for this node.
1178
- __get(node) {
1179
- return this.__nodeToScope.get(node);
1180
- }
1181
-
1182
- /**
1183
- * Get variables that are declared by the node.
1184
- *
1185
- * "are declared by the node" means the node is same as `Variable.defs[].node` or `Variable.defs[].parent`.
1186
- * If the node declares nothing, this method returns an empty array.
1187
- * CAUTION: This API is experimental. See https://github.com/estools/escope/pull/69 for more details.
1188
- * @param {Espree.Node} node a node to get.
1189
- * @returns {Variable[]} variables that declared by the node.
1190
- */
1191
- getDeclaredVariables(node) {
1192
- return this.__declaredVariables.get(node) || [];
1193
- }
1194
-
1195
- /**
1196
- * acquire scope from node.
1197
- * @function ScopeManager#acquire
1198
- * @param {Espree.Node} node node for the acquired scope.
1199
- * @param {?boolean} [inner=false] look up the most inner scope, default value is false.
1200
- * @returns {Scope?} Scope from node
1201
- */
1202
- acquire(node, inner) {
1203
-
1204
- /**
1205
- * predicate
1206
- * @param {Scope} testScope scope to test
1207
- * @returns {boolean} predicate
1208
- */
1209
- function predicate(testScope) {
1210
- if (testScope.type === "function" && testScope.functionExpressionScope) {
1211
- return false;
1212
- }
1213
- return true;
1214
- }
1215
-
1216
- const scopes = this.__get(node);
1217
-
1218
- if (!scopes || scopes.length === 0) {
1219
- return null;
1220
- }
1221
-
1222
- // Heuristic selection from all scopes.
1223
- // If you would like to get all scopes, please use ScopeManager#acquireAll.
1224
- if (scopes.length === 1) {
1225
- return scopes[0];
1226
- }
1227
-
1228
- if (inner) {
1229
- for (let i = scopes.length - 1; i >= 0; --i) {
1230
- const scope = scopes[i];
1231
-
1232
- if (predicate(scope)) {
1233
- return scope;
1234
- }
1235
- }
1236
- } else {
1237
- for (let i = 0, iz = scopes.length; i < iz; ++i) {
1238
- const scope = scopes[i];
1239
-
1240
- if (predicate(scope)) {
1241
- return scope;
1242
- }
1243
- }
1244
- }
1245
-
1246
- return null;
1247
- }
1248
-
1249
- /**
1250
- * acquire all scopes from node.
1251
- * @function ScopeManager#acquireAll
1252
- * @param {Espree.Node} node node for the acquired scope.
1253
- * @returns {Scopes?} Scope array
1254
- */
1255
- acquireAll(node) {
1256
- return this.__get(node);
1257
- }
1258
-
1259
- /**
1260
- * release the node.
1261
- * @function ScopeManager#release
1262
- * @param {Espree.Node} node releasing node.
1263
- * @param {?boolean} [inner=false] look up the most inner scope, default value is false.
1264
- * @returns {Scope?} upper scope for the node.
1265
- */
1266
- release(node, inner) {
1267
- const scopes = this.__get(node);
1268
-
1269
- if (scopes && scopes.length) {
1270
- const scope = scopes[0].upper;
1271
-
1272
- if (!scope) {
1273
- return null;
1274
- }
1275
- return this.acquire(scope.block, inner);
1276
- }
1277
- return null;
1278
- }
1279
-
1280
- attach() { } // eslint-disable-line class-methods-use-this -- Desired as instance method
1281
-
1282
- detach() { } // eslint-disable-line class-methods-use-this -- Desired as instance method
1283
-
1284
- __nestScope(scope) {
1285
- if (scope instanceof GlobalScope) {
1286
- assert__default["default"](this.__currentScope === null);
1287
- this.globalScope = scope;
1288
- }
1289
- this.__currentScope = scope;
1290
- return scope;
1291
- }
1292
-
1293
- __nestGlobalScope(node) {
1294
- return this.__nestScope(new GlobalScope(this, node));
1295
- }
1296
-
1297
- __nestBlockScope(node) {
1298
- return this.__nestScope(new BlockScope(this, this.__currentScope, node));
1299
- }
1300
-
1301
- __nestFunctionScope(node, isMethodDefinition) {
1302
- return this.__nestScope(new FunctionScope(this, this.__currentScope, node, isMethodDefinition));
1303
- }
1304
-
1305
- __nestForScope(node) {
1306
- return this.__nestScope(new ForScope(this, this.__currentScope, node));
1307
- }
1308
-
1309
- __nestCatchScope(node) {
1310
- return this.__nestScope(new CatchScope(this, this.__currentScope, node));
1311
- }
1312
-
1313
- __nestWithScope(node) {
1314
- return this.__nestScope(new WithScope(this, this.__currentScope, node));
1315
- }
1316
-
1317
- __nestClassScope(node) {
1318
- return this.__nestScope(new ClassScope(this, this.__currentScope, node));
1319
- }
1320
-
1321
- __nestClassFieldInitializerScope(node) {
1322
- return this.__nestScope(new ClassFieldInitializerScope(this, this.__currentScope, node));
1323
- }
1324
-
1325
- __nestClassStaticBlockScope(node) {
1326
- return this.__nestScope(new ClassStaticBlockScope(this, this.__currentScope, node));
1327
- }
1328
-
1329
- __nestSwitchScope(node) {
1330
- return this.__nestScope(new SwitchScope(this, this.__currentScope, node));
1331
- }
1332
-
1333
- __nestModuleScope(node) {
1334
- return this.__nestScope(new ModuleScope(this, this.__currentScope, node));
1335
- }
1336
-
1337
- __nestFunctionExpressionNameScope(node) {
1338
- return this.__nestScope(new FunctionExpressionNameScope(this, this.__currentScope, node));
1339
- }
1340
-
1341
- __isES6() {
1342
- return this.__options.ecmaVersion >= 6;
1343
- }
1344
- }
1345
-
1346
- /* vim: set sw=4 ts=4 et tw=80 : */
1347
-
1348
- /*
1349
- Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>
1350
-
1351
- Redistribution and use in source and binary forms, with or without
1352
- modification, are permitted provided that the following conditions are met:
1353
-
1354
- * Redistributions of source code must retain the above copyright
1355
- notice, this list of conditions and the following disclaimer.
1356
- * Redistributions in binary form must reproduce the above copyright
1357
- notice, this list of conditions and the following disclaimer in the
1358
- documentation and/or other materials provided with the distribution.
1359
-
1360
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
1361
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1362
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1363
- ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
1364
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
1365
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
1366
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
1367
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1368
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
1369
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1370
- */
1371
-
1372
- const { Syntax: Syntax$1 } = estraverse__default["default"];
1373
-
1374
- /**
1375
- * Get last array element
1376
- * @param {Array} xs array
1377
- * @returns {any} Last elment
1378
- */
1379
- function getLast(xs) {
1380
- return xs[xs.length - 1] || null;
1381
- }
1382
-
1383
- /**
1384
- * Visitor for destructuring patterns.
1385
- */
1386
- class PatternVisitor extends esrecurse__default["default"].Visitor {
1387
- static isPattern(node) {
1388
- const nodeType = node.type;
1389
-
1390
- return (
1391
- nodeType === Syntax$1.Identifier ||
1392
- nodeType === Syntax$1.ObjectPattern ||
1393
- nodeType === Syntax$1.ArrayPattern ||
1394
- nodeType === Syntax$1.SpreadElement ||
1395
- nodeType === Syntax$1.RestElement ||
1396
- nodeType === Syntax$1.AssignmentPattern
1397
- );
1398
- }
1399
-
1400
- constructor(options, rootPattern, callback) {
1401
- super(null, options);
1402
- this.rootPattern = rootPattern;
1403
- this.callback = callback;
1404
- this.assignments = [];
1405
- this.rightHandNodes = [];
1406
- this.restElements = [];
1407
- }
1408
-
1409
- Identifier(pattern) {
1410
- const lastRestElement = getLast(this.restElements);
1411
-
1412
- this.callback(pattern, {
1413
- topLevel: pattern === this.rootPattern,
1414
- rest: lastRestElement !== null && lastRestElement !== void 0 && lastRestElement.argument === pattern,
1415
- assignments: this.assignments
1416
- });
1417
- }
1418
-
1419
- Property(property) {
1420
-
1421
- // Computed property's key is a right hand node.
1422
- if (property.computed) {
1423
- this.rightHandNodes.push(property.key);
1424
- }
1425
-
1426
- // If it's shorthand, its key is same as its value.
1427
- // If it's shorthand and has its default value, its key is same as its value.left (the value is AssignmentPattern).
1428
- // If it's not shorthand, the name of new variable is its value's.
1429
- this.visit(property.value);
1430
- }
1431
-
1432
- ArrayPattern(pattern) {
1433
- for (let i = 0, iz = pattern.elements.length; i < iz; ++i) {
1434
- const element = pattern.elements[i];
1435
-
1436
- this.visit(element);
1437
- }
1438
- }
1439
-
1440
- AssignmentPattern(pattern) {
1441
- this.assignments.push(pattern);
1442
- this.visit(pattern.left);
1443
- this.rightHandNodes.push(pattern.right);
1444
- this.assignments.pop();
1445
- }
1446
-
1447
- RestElement(pattern) {
1448
- this.restElements.push(pattern);
1449
- this.visit(pattern.argument);
1450
- this.restElements.pop();
1451
- }
1452
-
1453
- MemberExpression(node) {
1454
-
1455
- // Computed property's key is a right hand node.
1456
- if (node.computed) {
1457
- this.rightHandNodes.push(node.property);
1458
- }
1459
-
1460
- // the object is only read, write to its property.
1461
- this.rightHandNodes.push(node.object);
1462
- }
1463
-
1464
- //
1465
- // ForInStatement.left and AssignmentExpression.left are LeftHandSideExpression.
1466
- // By spec, LeftHandSideExpression is Pattern or MemberExpression.
1467
- // (see also: https://github.com/estree/estree/pull/20#issuecomment-74584758)
1468
- // But espree 2.0 parses to ArrayExpression, ObjectExpression, etc...
1469
- //
1470
-
1471
- SpreadElement(node) {
1472
- this.visit(node.argument);
1473
- }
1474
-
1475
- ArrayExpression(node) {
1476
- node.elements.forEach(this.visit, this);
1477
- }
1478
-
1479
- AssignmentExpression(node) {
1480
- this.assignments.push(node);
1481
- this.visit(node.left);
1482
- this.rightHandNodes.push(node.right);
1483
- this.assignments.pop();
1484
- }
1485
-
1486
- CallExpression(node) {
1487
-
1488
- // arguments are right hand nodes.
1489
- node.arguments.forEach(a => {
1490
- this.rightHandNodes.push(a);
1491
- });
1492
- this.visit(node.callee);
1493
- }
1494
- }
1495
-
1496
- /* vim: set sw=4 ts=4 et tw=80 : */
1497
-
1498
- /*
1499
- Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>
1500
-
1501
- Redistribution and use in source and binary forms, with or without
1502
- modification, are permitted provided that the following conditions are met:
1503
-
1504
- * Redistributions of source code must retain the above copyright
1505
- notice, this list of conditions and the following disclaimer.
1506
- * Redistributions in binary form must reproduce the above copyright
1507
- notice, this list of conditions and the following disclaimer in the
1508
- documentation and/or other materials provided with the distribution.
1509
-
1510
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
1511
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1512
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1513
- ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
1514
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
1515
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
1516
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
1517
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1518
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
1519
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1520
- */
1521
-
1522
- const { Syntax } = estraverse__default["default"];
1523
-
1524
- /**
1525
- * Traverse identifier in pattern
1526
- * @param {Object} options options
1527
- * @param {pattern} rootPattern root pattern
1528
- * @param {Refencer} referencer referencer
1529
- * @param {callback} callback callback
1530
- * @returns {void}
1531
- */
1532
- function traverseIdentifierInPattern(options, rootPattern, referencer, callback) {
1533
-
1534
- // Call the callback at left hand identifier nodes, and Collect right hand nodes.
1535
- const visitor = new PatternVisitor(options, rootPattern, callback);
1536
-
1537
- visitor.visit(rootPattern);
1538
-
1539
- // Process the right hand nodes recursively.
1540
- if (referencer !== null && referencer !== void 0) {
1541
- visitor.rightHandNodes.forEach(referencer.visit, referencer);
1542
- }
1543
- }
1544
-
1545
- // Importing ImportDeclaration.
1546
- // http://people.mozilla.org/~jorendorff/es6-draft.html#sec-moduledeclarationinstantiation
1547
- // https://github.com/estree/estree/blob/master/es6.md#importdeclaration
1548
- // FIXME: Now, we don't create module environment, because the context is
1549
- // implementation dependent.
1550
-
1551
- /**
1552
- * Visitor for import specifiers.
1553
- */
1554
- class Importer extends esrecurse__default["default"].Visitor {
1555
- constructor(declaration, referencer) {
1556
- super(null, referencer.options);
1557
- this.declaration = declaration;
1558
- this.referencer = referencer;
1559
- }
1560
-
1561
- visitImport(id, specifier) {
1562
- this.referencer.visitPattern(id, pattern => {
1563
- this.referencer.currentScope().__define(pattern,
1564
- new Definition(
1565
- Variable.ImportBinding,
1566
- pattern,
1567
- specifier,
1568
- this.declaration,
1569
- null,
1570
- null
1571
- ));
1572
- });
1573
- }
1574
-
1575
- ImportNamespaceSpecifier(node) {
1576
- const local = (node.local || node.id);
1577
-
1578
- if (local) {
1579
- this.visitImport(local, node);
1580
- }
1581
- }
1582
-
1583
- ImportDefaultSpecifier(node) {
1584
- const local = (node.local || node.id);
1585
-
1586
- this.visitImport(local, node);
1587
- }
1588
-
1589
- ImportSpecifier(node) {
1590
- const local = (node.local || node.id);
1591
-
1592
- if (node.name) {
1593
- this.visitImport(node.name, node);
1594
- } else {
1595
- this.visitImport(local, node);
1596
- }
1597
- }
1598
- }
1599
-
1600
- /**
1601
- * Referencing variables and creating bindings.
1602
- */
1603
- class Referencer extends esrecurse__default["default"].Visitor {
1604
- constructor(options, scopeManager) {
1605
- super(null, options);
1606
- this.options = options;
1607
- this.scopeManager = scopeManager;
1608
- this.parent = null;
1609
- this.isInnerMethodDefinition = false;
1610
- }
1611
-
1612
- currentScope() {
1613
- return this.scopeManager.__currentScope;
1614
- }
1615
-
1616
- close(node) {
1617
- while (this.currentScope() && node === this.currentScope().block) {
1618
- this.scopeManager.__currentScope = this.currentScope().__close(this.scopeManager);
1619
- }
1620
- }
1621
-
1622
- pushInnerMethodDefinition(isInnerMethodDefinition) {
1623
- const previous = this.isInnerMethodDefinition;
1624
-
1625
- this.isInnerMethodDefinition = isInnerMethodDefinition;
1626
- return previous;
1627
- }
1628
-
1629
- popInnerMethodDefinition(isInnerMethodDefinition) {
1630
- this.isInnerMethodDefinition = isInnerMethodDefinition;
1631
- }
1632
-
1633
- referencingDefaultValue(pattern, assignments, maybeImplicitGlobal, init) {
1634
- const scope = this.currentScope();
1635
-
1636
- assignments.forEach(assignment => {
1637
- scope.__referencing(
1638
- pattern,
1639
- Reference.WRITE,
1640
- assignment.right,
1641
- maybeImplicitGlobal,
1642
- pattern !== assignment.left,
1643
- init
1644
- );
1645
- });
1646
- }
1647
-
1648
- visitPattern(node, options, callback) {
1649
- let visitPatternOptions = options;
1650
- let visitPatternCallback = callback;
1651
-
1652
- if (typeof options === "function") {
1653
- visitPatternCallback = options;
1654
- visitPatternOptions = { processRightHandNodes: false };
1655
- }
1656
-
1657
- traverseIdentifierInPattern(
1658
- this.options,
1659
- node,
1660
- visitPatternOptions.processRightHandNodes ? this : null,
1661
- visitPatternCallback
1662
- );
1663
- }
1664
-
1665
- visitFunction(node) {
1666
- let i, iz;
1667
-
1668
- // FunctionDeclaration name is defined in upper scope
1669
- // NOTE: Not referring variableScope. It is intended.
1670
- // Since
1671
- // in ES5, FunctionDeclaration should be in FunctionBody.
1672
- // in ES6, FunctionDeclaration should be block scoped.
1673
-
1674
- if (node.type === Syntax.FunctionDeclaration) {
1675
-
1676
- // id is defined in upper scope
1677
- this.currentScope().__define(node.id,
1678
- new Definition(
1679
- Variable.FunctionName,
1680
- node.id,
1681
- node,
1682
- null,
1683
- null,
1684
- null
1685
- ));
1686
- }
1687
-
1688
- // FunctionExpression with name creates its special scope;
1689
- // FunctionExpressionNameScope.
1690
- if (node.type === Syntax.FunctionExpression && node.id) {
1691
- this.scopeManager.__nestFunctionExpressionNameScope(node);
1692
- }
1693
-
1694
- // Consider this function is in the MethodDefinition.
1695
- this.scopeManager.__nestFunctionScope(node, this.isInnerMethodDefinition);
1696
-
1697
- const that = this;
1698
-
1699
- /**
1700
- * Visit pattern callback
1701
- * @param {pattern} pattern pattern
1702
- * @param {Object} info info
1703
- * @returns {void}
1704
- */
1705
- function visitPatternCallback(pattern, info) {
1706
- that.currentScope().__define(pattern,
1707
- new ParameterDefinition(
1708
- pattern,
1709
- node,
1710
- i,
1711
- info.rest
1712
- ));
1713
-
1714
- that.referencingDefaultValue(pattern, info.assignments, null, true);
1715
- }
1716
-
1717
- // Process parameter declarations.
1718
- for (i = 0, iz = node.params.length; i < iz; ++i) {
1719
- this.visitPattern(node.params[i], { processRightHandNodes: true }, visitPatternCallback);
1720
- }
1721
-
1722
- // if there's a rest argument, add that
1723
- if (node.rest) {
1724
- this.visitPattern({
1725
- type: "RestElement",
1726
- argument: node.rest
1727
- }, pattern => {
1728
- this.currentScope().__define(pattern,
1729
- new ParameterDefinition(
1730
- pattern,
1731
- node,
1732
- node.params.length,
1733
- true
1734
- ));
1735
- });
1736
- }
1737
-
1738
- // In TypeScript there are a number of function-like constructs which have no body,
1739
- // so check it exists before traversing
1740
- if (node.body) {
1741
-
1742
- // Skip BlockStatement to prevent creating BlockStatement scope.
1743
- if (node.body.type === Syntax.BlockStatement) {
1744
- this.visitChildren(node.body);
1745
- } else {
1746
- this.visit(node.body);
1747
- }
1748
- }
1749
-
1750
- this.close(node);
1751
- }
1752
-
1753
- visitClass(node) {
1754
- if (node.type === Syntax.ClassDeclaration) {
1755
- this.currentScope().__define(node.id,
1756
- new Definition(
1757
- Variable.ClassName,
1758
- node.id,
1759
- node,
1760
- null,
1761
- null,
1762
- null
1763
- ));
1764
- }
1765
-
1766
- this.scopeManager.__nestClassScope(node);
1767
-
1768
- if (node.id) {
1769
- this.currentScope().__define(node.id,
1770
- new Definition(
1771
- Variable.ClassName,
1772
- node.id,
1773
- node
1774
- ));
1775
- }
1776
-
1777
- this.visit(node.superClass);
1778
- this.visit(node.body);
1779
-
1780
- this.close(node);
1781
- }
1782
-
1783
- visitProperty(node) {
1784
- let previous;
1785
-
1786
- if (node.computed) {
1787
- this.visit(node.key);
1788
- }
1789
-
1790
- const isMethodDefinition = node.type === Syntax.MethodDefinition;
1791
-
1792
- if (isMethodDefinition) {
1793
- previous = this.pushInnerMethodDefinition(true);
1794
- }
1795
- this.visit(node.value);
1796
- if (isMethodDefinition) {
1797
- this.popInnerMethodDefinition(previous);
1798
- }
1799
- }
1800
-
1801
- visitForIn(node) {
1802
- if (node.left.type === Syntax.VariableDeclaration && node.left.kind !== "var") {
1803
- this.scopeManager.__nestForScope(node);
1804
- }
1805
-
1806
- if (node.left.type === Syntax.VariableDeclaration) {
1807
- this.visit(node.left);
1808
- this.visitPattern(node.left.declarations[0].id, pattern => {
1809
- this.currentScope().__referencing(pattern, Reference.WRITE, node.right, null, true, true);
1810
- });
1811
- } else {
1812
- this.visitPattern(node.left, { processRightHandNodes: true }, (pattern, info) => {
1813
- let maybeImplicitGlobal = null;
1814
-
1815
- if (!this.currentScope().isStrict) {
1816
- maybeImplicitGlobal = {
1817
- pattern,
1818
- node
1819
- };
1820
- }
1821
- this.referencingDefaultValue(pattern, info.assignments, maybeImplicitGlobal, false);
1822
- this.currentScope().__referencing(pattern, Reference.WRITE, node.right, maybeImplicitGlobal, true, false);
1823
- });
1824
- }
1825
- this.visit(node.right);
1826
- this.visit(node.body);
1827
-
1828
- this.close(node);
1829
- }
1830
-
1831
- visitVariableDeclaration(variableTargetScope, type, node, index) {
1832
-
1833
- const decl = node.declarations[index];
1834
- const init = decl.init;
1835
-
1836
- this.visitPattern(decl.id, { processRightHandNodes: true }, (pattern, info) => {
1837
- variableTargetScope.__define(
1838
- pattern,
1839
- new Definition(
1840
- type,
1841
- pattern,
1842
- decl,
1843
- node,
1844
- index,
1845
- node.kind
1846
- )
1847
- );
1848
-
1849
- this.referencingDefaultValue(pattern, info.assignments, null, true);
1850
- if (init) {
1851
- this.currentScope().__referencing(pattern, Reference.WRITE, init, null, !info.topLevel, true);
1852
- }
1853
- });
1854
- }
1855
-
1856
- AssignmentExpression(node) {
1857
- if (PatternVisitor.isPattern(node.left)) {
1858
- if (node.operator === "=") {
1859
- this.visitPattern(node.left, { processRightHandNodes: true }, (pattern, info) => {
1860
- let maybeImplicitGlobal = null;
1861
-
1862
- if (!this.currentScope().isStrict) {
1863
- maybeImplicitGlobal = {
1864
- pattern,
1865
- node
1866
- };
1867
- }
1868
- this.referencingDefaultValue(pattern, info.assignments, maybeImplicitGlobal, false);
1869
- this.currentScope().__referencing(pattern, Reference.WRITE, node.right, maybeImplicitGlobal, !info.topLevel, false);
1870
- });
1871
- } else {
1872
- this.currentScope().__referencing(node.left, Reference.RW, node.right);
1873
- }
1874
- } else {
1875
- this.visit(node.left);
1876
- }
1877
- this.visit(node.right);
1878
- }
1879
-
1880
- CatchClause(node) {
1881
- this.scopeManager.__nestCatchScope(node);
1882
-
1883
- this.visitPattern(node.param, { processRightHandNodes: true }, (pattern, info) => {
1884
- this.currentScope().__define(pattern,
1885
- new Definition(
1886
- Variable.CatchClause,
1887
- pattern,
1888
- node,
1889
- null,
1890
- null,
1891
- null
1892
- ));
1893
- this.referencingDefaultValue(pattern, info.assignments, null, true);
1894
- });
1895
- this.visit(node.body);
1896
-
1897
- this.close(node);
1898
- }
1899
-
1900
- Program(node) {
1901
- this.scopeManager.__nestGlobalScope(node);
1902
-
1903
- if (this.scopeManager.isGlobalReturn()) {
1904
-
1905
- // Force strictness of GlobalScope to false when using node.js scope.
1906
- this.currentScope().isStrict = false;
1907
- this.scopeManager.__nestFunctionScope(node, false);
1908
- }
1909
-
1910
- if (this.scopeManager.__isES6() && this.scopeManager.isModule()) {
1911
- this.scopeManager.__nestModuleScope(node);
1912
- }
1913
-
1914
- if (this.scopeManager.isStrictModeSupported() && this.scopeManager.isImpliedStrict()) {
1915
- this.currentScope().isStrict = true;
1916
- }
1917
-
1918
- this.visitChildren(node);
1919
- this.close(node);
1920
- }
1921
-
1922
- Identifier(node) {
1923
- this.currentScope().__referencing(node);
1924
- }
1925
-
1926
- // eslint-disable-next-line class-methods-use-this -- Desired as instance method
1927
- PrivateIdentifier() {
1928
-
1929
- // Do nothing.
1930
- }
1931
-
1932
- UpdateExpression(node) {
1933
- if (PatternVisitor.isPattern(node.argument)) {
1934
- this.currentScope().__referencing(node.argument, Reference.RW, null);
1935
- } else {
1936
- this.visitChildren(node);
1937
- }
1938
- }
1939
-
1940
- MemberExpression(node) {
1941
- this.visit(node.object);
1942
- if (node.computed) {
1943
- this.visit(node.property);
1944
- }
1945
- }
1946
-
1947
- Property(node) {
1948
- this.visitProperty(node);
1949
- }
1950
-
1951
- PropertyDefinition(node) {
1952
- const { computed, key, value } = node;
1953
-
1954
- if (computed) {
1955
- this.visit(key);
1956
- }
1957
- if (value) {
1958
- this.scopeManager.__nestClassFieldInitializerScope(value);
1959
- this.visit(value);
1960
- this.close(value);
1961
- }
1962
- }
1963
-
1964
- StaticBlock(node) {
1965
- this.scopeManager.__nestClassStaticBlockScope(node);
1966
-
1967
- this.visitChildren(node);
1968
-
1969
- this.close(node);
1970
- }
1971
-
1972
- MethodDefinition(node) {
1973
- this.visitProperty(node);
1974
- }
1975
-
1976
- BreakStatement() {} // eslint-disable-line class-methods-use-this -- Desired as instance method
1977
-
1978
- ContinueStatement() {} // eslint-disable-line class-methods-use-this -- Desired as instance method
1979
-
1980
- LabeledStatement(node) {
1981
- this.visit(node.body);
1982
- }
1983
-
1984
- ForStatement(node) {
1985
-
1986
- // Create ForStatement declaration.
1987
- // NOTE: In ES6, ForStatement dynamically generates
1988
- // per iteration environment. However, escope is
1989
- // a static analyzer, we only generate one scope for ForStatement.
1990
- if (node.init && node.init.type === Syntax.VariableDeclaration && node.init.kind !== "var") {
1991
- this.scopeManager.__nestForScope(node);
1992
- }
1993
-
1994
- this.visitChildren(node);
1995
-
1996
- this.close(node);
1997
- }
1998
-
1999
- ClassExpression(node) {
2000
- this.visitClass(node);
2001
- }
2002
-
2003
- ClassDeclaration(node) {
2004
- this.visitClass(node);
2005
- }
2006
-
2007
- CallExpression(node) {
2008
-
2009
- // Check this is direct call to eval
2010
- if (!this.scopeManager.__ignoreEval() && node.callee.type === Syntax.Identifier && node.callee.name === "eval") {
2011
-
2012
- // NOTE: This should be `variableScope`. Since direct eval call always creates Lexical environment and
2013
- // let / const should be enclosed into it. Only VariableDeclaration affects on the caller's environment.
2014
- this.currentScope().variableScope.__detectEval();
2015
- }
2016
- this.visitChildren(node);
2017
- }
2018
-
2019
- BlockStatement(node) {
2020
- if (this.scopeManager.__isES6()) {
2021
- this.scopeManager.__nestBlockScope(node);
2022
- }
2023
-
2024
- this.visitChildren(node);
2025
-
2026
- this.close(node);
2027
- }
2028
-
2029
- ThisExpression() {
2030
- this.currentScope().variableScope.__detectThis();
2031
- }
2032
-
2033
- WithStatement(node) {
2034
- this.visit(node.object);
2035
-
2036
- // Then nest scope for WithStatement.
2037
- this.scopeManager.__nestWithScope(node);
2038
-
2039
- this.visit(node.body);
2040
-
2041
- this.close(node);
2042
- }
2043
-
2044
- VariableDeclaration(node) {
2045
- const variableTargetScope = (node.kind === "var") ? this.currentScope().variableScope : this.currentScope();
2046
-
2047
- for (let i = 0, iz = node.declarations.length; i < iz; ++i) {
2048
- const decl = node.declarations[i];
2049
-
2050
- this.visitVariableDeclaration(variableTargetScope, Variable.Variable, node, i);
2051
- if (decl.init) {
2052
- this.visit(decl.init);
2053
- }
2054
- }
2055
- }
2056
-
2057
- // sec 13.11.8
2058
- SwitchStatement(node) {
2059
- this.visit(node.discriminant);
2060
-
2061
- if (this.scopeManager.__isES6()) {
2062
- this.scopeManager.__nestSwitchScope(node);
2063
- }
2064
-
2065
- for (let i = 0, iz = node.cases.length; i < iz; ++i) {
2066
- this.visit(node.cases[i]);
2067
- }
2068
-
2069
- this.close(node);
2070
- }
2071
-
2072
- FunctionDeclaration(node) {
2073
- this.visitFunction(node);
2074
- }
2075
-
2076
- FunctionExpression(node) {
2077
- this.visitFunction(node);
2078
- }
2079
-
2080
- ForOfStatement(node) {
2081
- this.visitForIn(node);
2082
- }
2083
-
2084
- ForInStatement(node) {
2085
- this.visitForIn(node);
2086
- }
2087
-
2088
- ArrowFunctionExpression(node) {
2089
- this.visitFunction(node);
2090
- }
2091
-
2092
- ImportDeclaration(node) {
2093
- assert__default["default"](this.scopeManager.__isES6() && this.scopeManager.isModule(), "ImportDeclaration should appear when the mode is ES6 and in the module context.");
2094
-
2095
- const importer = new Importer(node, this);
2096
-
2097
- importer.visit(node);
2098
- }
2099
-
2100
- visitExportDeclaration(node) {
2101
- if (node.source) {
2102
- return;
2103
- }
2104
- if (node.declaration) {
2105
- this.visit(node.declaration);
2106
- return;
2107
- }
2108
-
2109
- this.visitChildren(node);
2110
- }
2111
-
2112
- // TODO: ExportDeclaration doesn't exist. for bc?
2113
- ExportDeclaration(node) {
2114
- this.visitExportDeclaration(node);
2115
- }
2116
-
2117
- ExportAllDeclaration(node) {
2118
- this.visitExportDeclaration(node);
2119
- }
2120
-
2121
- ExportDefaultDeclaration(node) {
2122
- this.visitExportDeclaration(node);
2123
- }
2124
-
2125
- ExportNamedDeclaration(node) {
2126
- this.visitExportDeclaration(node);
2127
- }
2128
-
2129
- ExportSpecifier(node) {
2130
-
2131
- // TODO: `node.id` doesn't exist. for bc?
2132
- const local = (node.id || node.local);
2133
-
2134
- this.visit(local);
2135
- }
2136
-
2137
- MetaProperty() { // eslint-disable-line class-methods-use-this -- Desired as instance method
2138
-
2139
- // do nothing.
2140
- }
2141
- }
2142
-
2143
- /* vim: set sw=4 ts=4 et tw=80 : */
2144
-
2145
- const version = "8.0.2";
2146
-
2147
- /*
2148
- Copyright (C) 2012-2014 Yusuke Suzuki <utatane.tea@gmail.com>
2149
- Copyright (C) 2013 Alex Seville <hi@alexanderseville.com>
2150
- Copyright (C) 2014 Thiago de Arruda <tpadilha84@gmail.com>
2151
-
2152
- Redistribution and use in source and binary forms, with or without
2153
- modification, are permitted provided that the following conditions are met:
2154
-
2155
- * Redistributions of source code must retain the above copyright
2156
- notice, this list of conditions and the following disclaimer.
2157
- * Redistributions in binary form must reproduce the above copyright
2158
- notice, this list of conditions and the following disclaimer in the
2159
- documentation and/or other materials provided with the distribution.
2160
-
2161
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
2162
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2163
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2164
- ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
2165
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
2166
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
2167
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
2168
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2169
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2170
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2171
- */
2172
-
2173
- /**
2174
- * Set the default options
2175
- * @returns {Object} options
2176
- */
2177
- function defaultOptions() {
2178
- return {
2179
- optimistic: false,
2180
- nodejsScope: false,
2181
- impliedStrict: false,
2182
- sourceType: "script", // one of ['script', 'module', 'commonjs']
2183
- ecmaVersion: 5,
2184
- childVisitorKeys: null,
2185
- fallback: "iteration"
2186
- };
2187
- }
2188
-
2189
- /**
2190
- * Preform deep update on option object
2191
- * @param {Object} target Options
2192
- * @param {Object} override Updates
2193
- * @returns {Object} Updated options
2194
- */
2195
- function updateDeeply(target, override) {
2196
-
2197
- /**
2198
- * Is hash object
2199
- * @param {Object} value Test value
2200
- * @returns {boolean} Result
2201
- */
2202
- function isHashObject(value) {
2203
- return typeof value === "object" && value instanceof Object && !(value instanceof Array) && !(value instanceof RegExp);
2204
- }
2205
-
2206
- for (const key in override) {
2207
- if (Object.prototype.hasOwnProperty.call(override, key)) {
2208
- const val = override[key];
2209
-
2210
- if (isHashObject(val)) {
2211
- if (isHashObject(target[key])) {
2212
- updateDeeply(target[key], val);
2213
- } else {
2214
- target[key] = updateDeeply({}, val);
2215
- }
2216
- } else {
2217
- target[key] = val;
2218
- }
2219
- }
2220
- }
2221
- return target;
2222
- }
2223
-
2224
- /**
2225
- * Main interface function. Takes an Espree syntax tree and returns the
2226
- * analyzed scopes.
2227
- * @function analyze
2228
- * @param {espree.Tree} tree Abstract Syntax Tree
2229
- * @param {Object} providedOptions Options that tailor the scope analysis
2230
- * @param {boolean} [providedOptions.optimistic=false] the optimistic flag
2231
- * @param {boolean} [providedOptions.ignoreEval=false] whether to check 'eval()' calls
2232
- * @param {boolean} [providedOptions.nodejsScope=false] whether the whole
2233
- * script is executed under node.js environment. When enabled, escope adds
2234
- * a function scope immediately following the global scope.
2235
- * @param {boolean} [providedOptions.impliedStrict=false] implied strict mode
2236
- * (if ecmaVersion >= 5).
2237
- * @param {string} [providedOptions.sourceType='script'] the source type of the script. one of 'script', 'module', and 'commonjs'
2238
- * @param {number} [providedOptions.ecmaVersion=5] which ECMAScript version is considered
2239
- * @param {Object} [providedOptions.childVisitorKeys=null] Additional known visitor keys. See [esrecurse](https://github.com/estools/esrecurse)'s the `childVisitorKeys` option.
2240
- * @param {string} [providedOptions.fallback='iteration'] A kind of the fallback in order to encounter with unknown node. See [esrecurse](https://github.com/estools/esrecurse)'s the `fallback` option.
2241
- * @returns {ScopeManager} ScopeManager
2242
- */
2243
- function analyze(tree, providedOptions) {
2244
- const options = updateDeeply(defaultOptions(), providedOptions);
2245
- const scopeManager = new ScopeManager(options);
2246
- const referencer = new Referencer(options, scopeManager);
2247
-
2248
- referencer.visit(tree);
2249
-
2250
- assert__default["default"](scopeManager.__currentScope === null, "currentScope should be null.");
2251
-
2252
- return scopeManager;
2253
- }
2254
-
2255
- /* vim: set sw=4 ts=4 et tw=80 : */
2256
-
2257
- exports.Definition = Definition;
2258
- exports.PatternVisitor = PatternVisitor;
2259
- exports.Reference = Reference;
2260
- exports.Referencer = Referencer;
2261
- exports.Scope = Scope;
2262
- exports.ScopeManager = ScopeManager;
2263
- exports.Variable = Variable;
2264
- exports.analyze = analyze;
2265
- exports.version = version;
2266
- //# sourceMappingURL=eslint-scope.cjs.map