xo 0.52.2 → 0.52.3

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 (189) hide show
  1. package/lib/options-manager.js +4 -3
  2. package/node_modules/@typescript-eslint/eslint-plugin/README.md +1 -1
  3. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/class-literal-property-style.js +1 -1
  4. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/class-literal-property-style.js.map +1 -1
  5. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/comma-spacing.js +2 -0
  6. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/comma-spacing.js.map +1 -1
  7. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/dot-notation.js +5 -5
  8. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/dot-notation.js.map +1 -1
  9. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain.js +68 -164
  10. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain.js.map +1 -1
  11. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/sort-type-union-intersection-members.js +9 -0
  12. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/sort-type-union-intersection-members.js.map +1 -1
  13. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/space-before-blocks.js +1 -0
  14. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/space-before-blocks.js.map +1 -1
  15. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/space-before-function-paren.js +1 -0
  16. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/space-before-function-paren.js.map +1 -1
  17. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/type-annotation-spacing.js +3 -1
  18. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/type-annotation-spacing.js.map +1 -1
  19. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unbound-method.js +2 -1
  20. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unbound-method.js.map +1 -1
  21. package/node_modules/@typescript-eslint/eslint-plugin/dist/util/index.js +3 -3
  22. package/node_modules/@typescript-eslint/eslint-plugin/dist/util/index.js.map +1 -1
  23. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-optional-chain.md +1 -11
  24. package/node_modules/@typescript-eslint/eslint-plugin/package.json +5 -5
  25. package/node_modules/@typescript-eslint/parser/README.md +1 -1
  26. package/node_modules/@typescript-eslint/parser/_ts3.4/dist/index.d.ts +4 -0
  27. package/node_modules/@typescript-eslint/parser/_ts3.4/dist/parser.d.ts +20 -0
  28. package/node_modules/@typescript-eslint/parser/package.json +5 -5
  29. package/node_modules/@typescript-eslint/scope-manager/README.md +1 -1
  30. package/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.d.ts.map +1 -1
  31. package/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.iterable.d.ts.map +1 -1
  32. package/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.iterable.js +0 -3
  33. package/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.iterable.js.map +1 -1
  34. package/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.js +8 -23
  35. package/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.js.map +1 -1
  36. package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.intl.d.ts.map +1 -1
  37. package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.intl.js +2 -3
  38. package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.intl.js.map +1 -1
  39. package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.d.ts.map +1 -1
  40. package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.intl.d.ts +3 -0
  41. package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.intl.d.ts.map +1 -0
  42. package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.intl.js +12 -0
  43. package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.intl.js.map +1 -0
  44. package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.js +3 -1
  45. package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.js.map +1 -1
  46. package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.sharedmemory.d.ts +3 -0
  47. package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.sharedmemory.d.ts.map +1 -0
  48. package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.sharedmemory.js +12 -0
  49. package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.sharedmemory.js.map +1 -0
  50. package/node_modules/@typescript-eslint/scope-manager/dist/lib/index.d.ts +2 -0
  51. package/node_modules/@typescript-eslint/scope-manager/dist/lib/index.d.ts.map +1 -1
  52. package/node_modules/@typescript-eslint/scope-manager/dist/lib/index.js +4 -0
  53. package/node_modules/@typescript-eslint/scope-manager/dist/lib/index.js.map +1 -1
  54. package/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.d.ts.map +1 -1
  55. package/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.js +7 -6
  56. package/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.js.map +1 -1
  57. package/node_modules/@typescript-eslint/scope-manager/package.json +5 -5
  58. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/containsAllTypesByName.d.ts +8 -0
  59. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/getConstrainedTypeAtLocation.d.ts +6 -0
  60. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/getContextualType.d.ts +8 -0
  61. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/getDeclaration.d.ts +6 -0
  62. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/getSourceFileOfNode.d.ts +6 -0
  63. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/getTokenAtPosition.d.ts +3 -0
  64. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/getTypeArguments.d.ts +3 -0
  65. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/getTypeName.d.ts +8 -0
  66. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/index.d.ts +16 -0
  67. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/isTypeReadonly.d.ts +20 -0
  68. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/isUnsafeAssignment.d.ts +17 -0
  69. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/predicates.d.ts +52 -0
  70. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/propertyTypes.d.ts +4 -0
  71. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/requiresQuoting.d.ts +4 -0
  72. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/typeFlagUtils.d.ts +11 -0
  73. package/node_modules/@typescript-eslint/type-utils/dist/index.d.ts +1 -0
  74. package/node_modules/@typescript-eslint/type-utils/dist/index.d.ts.map +1 -1
  75. package/node_modules/@typescript-eslint/type-utils/dist/index.js +5 -0
  76. package/node_modules/@typescript-eslint/type-utils/dist/index.js.map +1 -1
  77. package/node_modules/@typescript-eslint/type-utils/package.json +5 -4
  78. package/node_modules/@typescript-eslint/types/_ts3.4/dist/generated/ast-spec.d.ts +1732 -0
  79. package/node_modules/@typescript-eslint/types/_ts3.4/dist/index.d.ts +5 -0
  80. package/node_modules/@typescript-eslint/types/_ts3.4/dist/lib.d.ts +3 -0
  81. package/node_modules/@typescript-eslint/types/_ts3.4/dist/parser-options.d.ts +36 -0
  82. package/node_modules/@typescript-eslint/types/_ts3.4/dist/ts-estree.d.ts +9 -0
  83. package/node_modules/@typescript-eslint/types/dist/generated/ast-spec.d.ts +2 -2
  84. package/node_modules/@typescript-eslint/types/dist/generated/ast-spec.d.ts.map +1 -1
  85. package/node_modules/@typescript-eslint/types/dist/lib.d.ts +1 -1
  86. package/node_modules/@typescript-eslint/types/dist/lib.d.ts.map +1 -1
  87. package/node_modules/@typescript-eslint/types/package.json +2 -2
  88. package/node_modules/@typescript-eslint/typescript-estree/README.md +1 -1
  89. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/ast-converter.d.ts +9 -0
  90. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/convert-comments.d.ts +11 -0
  91. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/convert.d.ts +159 -0
  92. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/WatchCompilerHostOfConfigFile.d.ts +13 -0
  93. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/createDefaultProgram.d.ts +12 -0
  94. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/createIsolatedProgram.d.ts +9 -0
  95. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/createProjectProgram.d.ts +11 -0
  96. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/createSourceFile.d.ts +5 -0
  97. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/createWatchProgram.d.ts +19 -0
  98. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/getScriptKind.d.ts +5 -0
  99. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/shared.d.ts +22 -0
  100. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/useProvidedPrograms.d.ts +13 -0
  101. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/getModifiers.d.ts +4 -0
  102. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/index.d.ts +12 -0
  103. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/jsx/xhtml-entities.d.ts +2 -0
  104. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/node-utils.d.ts +230 -0
  105. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/parser-options.d.ts +188 -0
  106. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/parser.d.ts +25 -0
  107. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/semantic-or-syntactic-errors.d.ts +13 -0
  108. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/simple-traverse.d.ts +9 -0
  109. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/ts-estree/estree-to-ts-node-types.d.ts +175 -0
  110. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/ts-estree/index.d.ts +4 -0
  111. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/ts-estree/ts-nodes.d.ts +18 -0
  112. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/version-check.d.ts +3 -0
  113. package/node_modules/@typescript-eslint/typescript-estree/dist/convert.d.ts +3 -1
  114. package/node_modules/@typescript-eslint/typescript-estree/dist/convert.d.ts.map +1 -1
  115. package/node_modules/@typescript-eslint/typescript-estree/dist/convert.js +67 -28
  116. package/node_modules/@typescript-eslint/typescript-estree/dist/convert.js.map +1 -1
  117. package/node_modules/@typescript-eslint/typescript-estree/dist/getModifiers.d.ts +4 -0
  118. package/node_modules/@typescript-eslint/typescript-estree/dist/getModifiers.d.ts.map +1 -0
  119. package/node_modules/@typescript-eslint/typescript-estree/dist/getModifiers.js +68 -0
  120. package/node_modules/@typescript-eslint/typescript-estree/dist/getModifiers.js.map +1 -0
  121. package/node_modules/@typescript-eslint/typescript-estree/dist/index.d.ts +2 -0
  122. package/node_modules/@typescript-eslint/typescript-estree/dist/index.d.ts.map +1 -1
  123. package/node_modules/@typescript-eslint/typescript-estree/dist/index.js +4 -1
  124. package/node_modules/@typescript-eslint/typescript-estree/dist/index.js.map +1 -1
  125. package/node_modules/@typescript-eslint/typescript-estree/dist/node-utils.d.ts.map +1 -1
  126. package/node_modules/@typescript-eslint/typescript-estree/dist/node-utils.js +11 -9
  127. package/node_modules/@typescript-eslint/typescript-estree/dist/node-utils.js.map +1 -1
  128. package/node_modules/@typescript-eslint/typescript-estree/dist/parser.js +1 -1
  129. package/node_modules/@typescript-eslint/typescript-estree/dist/version-check.d.ts +1 -1
  130. package/node_modules/@typescript-eslint/typescript-estree/dist/version-check.d.ts.map +1 -1
  131. package/node_modules/@typescript-eslint/typescript-estree/dist/version-check.js +8 -1
  132. package/node_modules/@typescript-eslint/typescript-estree/dist/version-check.js.map +1 -1
  133. package/node_modules/@typescript-eslint/typescript-estree/package.json +5 -5
  134. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/eslint-utils/PatternMatcher.d.ts +48 -0
  135. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/eslint-utils/ReferenceTracker.d.ts +76 -0
  136. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/eslint-utils/astUtilities.d.ts +76 -0
  137. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/eslint-utils/index.d.ts +6 -0
  138. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/eslint-utils/predicates.d.ts +32 -0
  139. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/eslint-utils/scopeAnalysis.d.ts +18 -0
  140. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/helpers.d.ts +1153 -0
  141. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/index.d.ts +5 -0
  142. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/misc.d.ts +8 -0
  143. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/predicates.d.ts +58 -0
  144. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/InferTypesFromRule.d.ts +11 -0
  145. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/RuleCreator.d.ts +35 -0
  146. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/RuleTester.d.ts +18 -0
  147. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/applyDefault.d.ts +10 -0
  148. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/batchedSingleLineTests.d.ts +24 -0
  149. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/deepMerge.d.ts +17 -0
  150. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/getParserServices.d.ts +8 -0
  151. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/index.d.ts +9 -0
  152. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/nullThrows.d.ts +14 -0
  153. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/index.d.ts +8 -0
  154. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/json-schema.d.ts +2 -0
  155. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/AST.d.ts +9 -0
  156. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/CLIEngine.d.ts +137 -0
  157. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/ESLint.d.ts +376 -0
  158. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/Linter.d.ts +326 -0
  159. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/ParserOptions.d.ts +2 -0
  160. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/Rule.d.ts +393 -0
  161. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/RuleTester.d.ts +154 -0
  162. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/Scope.d.ts +44 -0
  163. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/SourceCode.d.ts +342 -0
  164. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/index.d.ts +10 -0
  165. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/Definition.d.ts +19 -0
  166. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/Options.d.ts +15 -0
  167. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/PatternVisitor.d.ts +25 -0
  168. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/Reference.d.ts +28 -0
  169. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/Referencer.d.ts +55 -0
  170. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/Scope.d.ts +103 -0
  171. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/ScopeManager.d.ts +50 -0
  172. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/Variable.d.ts +17 -0
  173. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/analyze.d.ts +16 -0
  174. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/index.d.ts +11 -0
  175. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-estree.d.ts +3 -0
  176. package/node_modules/@typescript-eslint/utils/dist/ast-utils/helpers.d.ts +1131 -25
  177. package/node_modules/@typescript-eslint/utils/dist/ast-utils/helpers.d.ts.map +1 -1
  178. package/node_modules/@typescript-eslint/utils/dist/ast-utils/helpers.js.map +1 -1
  179. package/node_modules/@typescript-eslint/utils/dist/ast-utils/predicates.d.ts +15 -137
  180. package/node_modules/@typescript-eslint/utils/dist/ast-utils/predicates.d.ts.map +1 -1
  181. package/node_modules/@typescript-eslint/utils/dist/ts-eslint/CLIEngine.d.ts.map +1 -1
  182. package/node_modules/@typescript-eslint/utils/dist/ts-eslint/CLIEngine.js +1 -0
  183. package/node_modules/@typescript-eslint/utils/dist/ts-eslint/CLIEngine.js.map +1 -1
  184. package/node_modules/@typescript-eslint/utils/package.json +5 -5
  185. package/node_modules/@typescript-eslint/visitor-keys/_ts3.4/dist/get-keys.d.ts +4 -0
  186. package/node_modules/@typescript-eslint/visitor-keys/_ts3.4/dist/index.d.ts +3 -0
  187. package/node_modules/@typescript-eslint/visitor-keys/_ts3.4/dist/visitor-keys.d.ts +6 -0
  188. package/node_modules/@typescript-eslint/visitor-keys/package.json +3 -3
  189. package/package.json +1 -1
@@ -0,0 +1,175 @@
1
+ import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/types';
2
+ import * as ts from 'typescript';
3
+ import { TSNode } from './ts-nodes';
4
+ export interface EstreeToTsNodeTypes {
5
+ [AST_NODE_TYPES.ArrayExpression]: ts.ArrayLiteralExpression;
6
+ [AST_NODE_TYPES.ArrayPattern]: ts.ArrayLiteralExpression | ts.ArrayBindingPattern;
7
+ [AST_NODE_TYPES.ArrowFunctionExpression]: ts.ArrowFunction;
8
+ [AST_NODE_TYPES.AssignmentExpression]: ts.BinaryExpression;
9
+ [AST_NODE_TYPES.AssignmentPattern]: ts.ShorthandPropertyAssignment | ts.BindingElement | ts.BinaryExpression | ts.ParameterDeclaration;
10
+ [AST_NODE_TYPES.AwaitExpression]: ts.AwaitExpression;
11
+ [AST_NODE_TYPES.BinaryExpression]: ts.BinaryExpression;
12
+ [AST_NODE_TYPES.BlockStatement]: ts.Block;
13
+ [AST_NODE_TYPES.BreakStatement]: ts.BreakStatement;
14
+ [AST_NODE_TYPES.CallExpression]: ts.CallExpression;
15
+ [AST_NODE_TYPES.CatchClause]: ts.CatchClause;
16
+ [AST_NODE_TYPES.ChainExpression]: ts.CallExpression | ts.PropertyAccessExpression | ts.ElementAccessExpression | ts.NonNullExpression;
17
+ [AST_NODE_TYPES.ClassBody]: ts.ClassDeclaration | ts.ClassExpression;
18
+ [AST_NODE_TYPES.ClassDeclaration]: ts.ClassDeclaration;
19
+ [AST_NODE_TYPES.ClassExpression]: ts.ClassExpression;
20
+ [AST_NODE_TYPES.PropertyDefinition]: ts.PropertyDeclaration;
21
+ [AST_NODE_TYPES.ConditionalExpression]: ts.ConditionalExpression;
22
+ [AST_NODE_TYPES.ContinueStatement]: ts.ContinueStatement;
23
+ [AST_NODE_TYPES.DebuggerStatement]: ts.DebuggerStatement;
24
+ [AST_NODE_TYPES.Decorator]: ts.Decorator;
25
+ [AST_NODE_TYPES.DoWhileStatement]: ts.DoStatement;
26
+ [AST_NODE_TYPES.EmptyStatement]: ts.EmptyStatement;
27
+ [AST_NODE_TYPES.ExportAllDeclaration]: ts.ExportDeclaration;
28
+ [AST_NODE_TYPES.ExportDefaultDeclaration]: ts.ExportAssignment | ts.FunctionDeclaration | ts.VariableStatement | ts.ClassDeclaration | ts.ClassExpression | ts.TypeAliasDeclaration | ts.InterfaceDeclaration | ts.EnumDeclaration | ts.ModuleDeclaration;
29
+ [AST_NODE_TYPES.ExportNamedDeclaration]: ts.ExportDeclaration | ts.FunctionDeclaration | ts.VariableStatement | ts.ClassDeclaration | ts.ClassExpression | ts.TypeAliasDeclaration | ts.InterfaceDeclaration | ts.EnumDeclaration | ts.ModuleDeclaration;
30
+ [AST_NODE_TYPES.ExportSpecifier]: ts.ExportSpecifier;
31
+ [AST_NODE_TYPES.ExpressionStatement]: ts.ExpressionStatement;
32
+ [AST_NODE_TYPES.ForInStatement]: ts.ForInStatement;
33
+ [AST_NODE_TYPES.ForOfStatement]: ts.ForOfStatement;
34
+ [AST_NODE_TYPES.ForStatement]: ts.ForStatement;
35
+ [AST_NODE_TYPES.FunctionDeclaration]: ts.FunctionDeclaration;
36
+ [AST_NODE_TYPES.FunctionExpression]: ts.FunctionExpression | ts.ConstructorDeclaration | ts.GetAccessorDeclaration | ts.SetAccessorDeclaration | ts.MethodDeclaration;
37
+ [AST_NODE_TYPES.Identifier]: ts.Identifier | ts.ConstructorDeclaration | ts.Token<ts.SyntaxKind.NewKeyword | ts.SyntaxKind.ImportKeyword>;
38
+ [AST_NODE_TYPES.PrivateIdentifier]: ts.PrivateIdentifier;
39
+ [AST_NODE_TYPES.IfStatement]: ts.IfStatement;
40
+ [AST_NODE_TYPES.ImportAttribute]: ts.AssertEntry;
41
+ [AST_NODE_TYPES.ImportDeclaration]: ts.ImportDeclaration;
42
+ [AST_NODE_TYPES.ImportDefaultSpecifier]: ts.ImportClause;
43
+ [AST_NODE_TYPES.ImportExpression]: ts.CallExpression;
44
+ [AST_NODE_TYPES.ImportNamespaceSpecifier]: ts.NamespaceImport;
45
+ [AST_NODE_TYPES.ImportSpecifier]: ts.ImportSpecifier;
46
+ [AST_NODE_TYPES.JSXAttribute]: ts.JsxAttribute;
47
+ [AST_NODE_TYPES.JSXClosingElement]: ts.JsxClosingElement;
48
+ [AST_NODE_TYPES.JSXClosingFragment]: ts.JsxClosingFragment;
49
+ [AST_NODE_TYPES.JSXElement]: ts.JsxElement | ts.JsxSelfClosingElement;
50
+ [AST_NODE_TYPES.JSXEmptyExpression]: ts.JsxExpression;
51
+ [AST_NODE_TYPES.JSXExpressionContainer]: ts.JsxExpression;
52
+ [AST_NODE_TYPES.JSXFragment]: ts.JsxFragment;
53
+ [AST_NODE_TYPES.JSXIdentifier]: ts.Identifier | ts.ThisExpression;
54
+ [AST_NODE_TYPES.JSXOpeningElement]: ts.JsxOpeningElement | ts.JsxSelfClosingElement;
55
+ [AST_NODE_TYPES.JSXOpeningFragment]: ts.JsxOpeningFragment;
56
+ [AST_NODE_TYPES.JSXSpreadAttribute]: ts.JsxSpreadAttribute;
57
+ [AST_NODE_TYPES.JSXSpreadChild]: ts.JsxExpression;
58
+ [AST_NODE_TYPES.JSXMemberExpression]: ts.PropertyAccessExpression;
59
+ [AST_NODE_TYPES.JSXNamespacedName]: ts.Identifier | ts.ThisExpression;
60
+ [AST_NODE_TYPES.JSXText]: ts.JsxText;
61
+ [AST_NODE_TYPES.LabeledStatement]: ts.LabeledStatement;
62
+ [AST_NODE_TYPES.Literal]: ts.StringLiteral | ts.NumericLiteral | ts.RegularExpressionLiteral | ts.NullLiteral | ts.BooleanLiteral | ts.BigIntLiteral;
63
+ [AST_NODE_TYPES.LogicalExpression]: ts.BinaryExpression;
64
+ [AST_NODE_TYPES.MemberExpression]: ts.PropertyAccessExpression | ts.ElementAccessExpression;
65
+ [AST_NODE_TYPES.MetaProperty]: ts.MetaProperty;
66
+ [AST_NODE_TYPES.MethodDefinition]: ts.GetAccessorDeclaration | ts.SetAccessorDeclaration | ts.MethodDeclaration | ts.ConstructorDeclaration;
67
+ [AST_NODE_TYPES.NewExpression]: ts.NewExpression;
68
+ [AST_NODE_TYPES.ObjectExpression]: ts.ObjectLiteralExpression;
69
+ [AST_NODE_TYPES.ObjectPattern]: ts.ObjectLiteralExpression | ts.ObjectBindingPattern;
70
+ [AST_NODE_TYPES.Program]: ts.SourceFile;
71
+ [AST_NODE_TYPES.Property]: ts.PropertyAssignment | ts.ShorthandPropertyAssignment | ts.GetAccessorDeclaration | ts.SetAccessorDeclaration | ts.MethodDeclaration | ts.BindingElement;
72
+ [AST_NODE_TYPES.RestElement]: ts.BindingElement | ts.SpreadAssignment | ts.SpreadElement | ts.ParameterDeclaration;
73
+ [AST_NODE_TYPES.ReturnStatement]: ts.ReturnStatement;
74
+ [AST_NODE_TYPES.SequenceExpression]: ts.BinaryExpression;
75
+ [AST_NODE_TYPES.SpreadElement]: ts.SpreadElement | ts.SpreadAssignment;
76
+ [AST_NODE_TYPES.StaticBlock]: ts.ClassStaticBlockDeclaration;
77
+ [AST_NODE_TYPES.Super]: ts.SuperExpression;
78
+ [AST_NODE_TYPES.SwitchCase]: ts.CaseClause | ts.DefaultClause;
79
+ [AST_NODE_TYPES.SwitchStatement]: ts.SwitchStatement;
80
+ [AST_NODE_TYPES.TaggedTemplateExpression]: ts.TaggedTemplateExpression;
81
+ [AST_NODE_TYPES.TemplateElement]: ts.NoSubstitutionTemplateLiteral | ts.TemplateHead | ts.TemplateMiddle | ts.TemplateTail;
82
+ [AST_NODE_TYPES.TemplateLiteral]: ts.NoSubstitutionTemplateLiteral | ts.TemplateExpression;
83
+ [AST_NODE_TYPES.ThisExpression]: ts.ThisExpression | ts.KeywordTypeNode | ts.Identifier;
84
+ [AST_NODE_TYPES.ThrowStatement]: ts.ThrowStatement;
85
+ [AST_NODE_TYPES.TryStatement]: ts.TryStatement;
86
+ [AST_NODE_TYPES.TSAbstractPropertyDefinition]: ts.PropertyDeclaration;
87
+ [AST_NODE_TYPES.TSAbstractMethodDefinition]: ts.GetAccessorDeclaration | ts.SetAccessorDeclaration | ts.MethodDeclaration | ts.ConstructorDeclaration;
88
+ [AST_NODE_TYPES.TSArrayType]: ts.ArrayTypeNode;
89
+ [AST_NODE_TYPES.TSAsExpression]: ts.AsExpression;
90
+ [AST_NODE_TYPES.TSCallSignatureDeclaration]: ts.CallSignatureDeclaration;
91
+ [AST_NODE_TYPES.TSClassImplements]: ts.ExpressionWithTypeArguments;
92
+ [AST_NODE_TYPES.TSConditionalType]: ts.ConditionalTypeNode;
93
+ [AST_NODE_TYPES.TSConstructorType]: ts.ConstructorTypeNode;
94
+ [AST_NODE_TYPES.TSConstructSignatureDeclaration]: ts.ConstructSignatureDeclaration;
95
+ [AST_NODE_TYPES.TSDeclareFunction]: ts.FunctionDeclaration;
96
+ [AST_NODE_TYPES.TSEnumDeclaration]: ts.EnumDeclaration;
97
+ [AST_NODE_TYPES.TSEnumMember]: ts.EnumMember;
98
+ [AST_NODE_TYPES.TSExportAssignment]: ts.ExportAssignment;
99
+ [AST_NODE_TYPES.TSExternalModuleReference]: ts.ExternalModuleReference;
100
+ [AST_NODE_TYPES.TSFunctionType]: ts.FunctionTypeNode;
101
+ [AST_NODE_TYPES.TSImportEqualsDeclaration]: ts.ImportEqualsDeclaration;
102
+ [AST_NODE_TYPES.TSImportType]: ts.ImportTypeNode;
103
+ [AST_NODE_TYPES.TSIndexedAccessType]: ts.IndexedAccessTypeNode;
104
+ [AST_NODE_TYPES.TSIndexSignature]: ts.IndexSignatureDeclaration;
105
+ [AST_NODE_TYPES.TSInferType]: ts.InferTypeNode;
106
+ [AST_NODE_TYPES.TSInterfaceDeclaration]: ts.InterfaceDeclaration;
107
+ [AST_NODE_TYPES.TSInterfaceBody]: ts.InterfaceDeclaration;
108
+ [AST_NODE_TYPES.TSInterfaceHeritage]: ts.ExpressionWithTypeArguments;
109
+ [AST_NODE_TYPES.TSIntersectionType]: ts.IntersectionTypeNode;
110
+ [AST_NODE_TYPES.TSInstantiationExpression]: ts.ExpressionWithTypeArguments;
111
+ [AST_NODE_TYPES.TSLiteralType]: ts.LiteralTypeNode;
112
+ [AST_NODE_TYPES.TSMappedType]: ts.MappedTypeNode;
113
+ [AST_NODE_TYPES.TSMethodSignature]: ts.MethodSignature | ts.GetAccessorDeclaration | ts.SetAccessorDeclaration;
114
+ [AST_NODE_TYPES.TSModuleBlock]: ts.ModuleBlock;
115
+ [AST_NODE_TYPES.TSModuleDeclaration]: ts.ModuleDeclaration;
116
+ [AST_NODE_TYPES.TSNamedTupleMember]: ts.NamedTupleMember;
117
+ [AST_NODE_TYPES.TSNamespaceExportDeclaration]: ts.NamespaceExportDeclaration;
118
+ [AST_NODE_TYPES.TSNonNullExpression]: ts.NonNullExpression;
119
+ [AST_NODE_TYPES.TSOptionalType]: ts.OptionalTypeNode;
120
+ [AST_NODE_TYPES.TSParameterProperty]: ts.ParameterDeclaration;
121
+ [AST_NODE_TYPES.TSPropertySignature]: ts.PropertySignature;
122
+ [AST_NODE_TYPES.TSQualifiedName]: ts.QualifiedName;
123
+ [AST_NODE_TYPES.TSRestType]: ts.RestTypeNode | ts.NamedTupleMember;
124
+ [AST_NODE_TYPES.TSThisType]: ts.ThisTypeNode;
125
+ [AST_NODE_TYPES.TSTupleType]: ts.TupleTypeNode;
126
+ [AST_NODE_TYPES.TSTemplateLiteralType]: ts.TemplateLiteralTypeNode;
127
+ [AST_NODE_TYPES.TSTypeAliasDeclaration]: ts.TypeAliasDeclaration;
128
+ [AST_NODE_TYPES.TSTypeAnnotation]: undefined;
129
+ [AST_NODE_TYPES.TSTypeAssertion]: ts.TypeAssertion;
130
+ [AST_NODE_TYPES.TSTypeLiteral]: ts.TypeLiteralNode;
131
+ [AST_NODE_TYPES.TSTypeOperator]: ts.TypeOperatorNode;
132
+ [AST_NODE_TYPES.TSTypeParameter]: ts.TypeParameterDeclaration;
133
+ [AST_NODE_TYPES.TSTypeParameterDeclaration]: undefined;
134
+ [AST_NODE_TYPES.TSTypeParameterInstantiation]: ts.TaggedTemplateExpression | ts.ImportTypeNode | ts.ExpressionWithTypeArguments | ts.TypeReferenceNode | ts.JsxOpeningElement | ts.JsxSelfClosingElement | ts.NewExpression | ts.CallExpression | ts.TypeQueryNode;
135
+ [AST_NODE_TYPES.TSTypePredicate]: ts.TypePredicateNode;
136
+ [AST_NODE_TYPES.TSTypeQuery]: ts.TypeQueryNode;
137
+ [AST_NODE_TYPES.TSTypeReference]: ts.TypeReferenceNode;
138
+ [AST_NODE_TYPES.TSUnionType]: ts.UnionTypeNode;
139
+ [AST_NODE_TYPES.UpdateExpression]: ts.PrefixUnaryExpression | ts.PostfixUnaryExpression;
140
+ [AST_NODE_TYPES.UnaryExpression]: ts.PrefixUnaryExpression | ts.PostfixUnaryExpression | ts.DeleteExpression | ts.VoidExpression | ts.TypeOfExpression;
141
+ [AST_NODE_TYPES.VariableDeclaration]: ts.VariableDeclarationList | ts.VariableStatement;
142
+ [AST_NODE_TYPES.VariableDeclarator]: ts.VariableDeclaration;
143
+ [AST_NODE_TYPES.WhileStatement]: ts.WhileStatement;
144
+ [AST_NODE_TYPES.WithStatement]: ts.WithStatement;
145
+ [AST_NODE_TYPES.YieldExpression]: ts.YieldExpression;
146
+ [AST_NODE_TYPES.TSEmptyBodyFunctionExpression]: ts.FunctionExpression | ts.ConstructorDeclaration | ts.GetAccessorDeclaration | ts.SetAccessorDeclaration | ts.MethodDeclaration;
147
+ [AST_NODE_TYPES.TSAbstractKeyword]: ts.Token<ts.SyntaxKind.AbstractKeyword>;
148
+ [AST_NODE_TYPES.TSNullKeyword]: ts.NullLiteral | ts.KeywordTypeNode;
149
+ [AST_NODE_TYPES.TSAnyKeyword]: ts.KeywordTypeNode;
150
+ [AST_NODE_TYPES.TSBigIntKeyword]: ts.KeywordTypeNode;
151
+ [AST_NODE_TYPES.TSBooleanKeyword]: ts.KeywordTypeNode;
152
+ [AST_NODE_TYPES.TSIntrinsicKeyword]: ts.KeywordTypeNode;
153
+ [AST_NODE_TYPES.TSNeverKeyword]: ts.KeywordTypeNode;
154
+ [AST_NODE_TYPES.TSNumberKeyword]: ts.KeywordTypeNode;
155
+ [AST_NODE_TYPES.TSObjectKeyword]: ts.KeywordTypeNode;
156
+ [AST_NODE_TYPES.TSStringKeyword]: ts.KeywordTypeNode;
157
+ [AST_NODE_TYPES.TSSymbolKeyword]: ts.KeywordTypeNode;
158
+ [AST_NODE_TYPES.TSUnknownKeyword]: ts.KeywordTypeNode;
159
+ [AST_NODE_TYPES.TSVoidKeyword]: ts.KeywordTypeNode;
160
+ [AST_NODE_TYPES.TSUndefinedKeyword]: ts.KeywordTypeNode;
161
+ [AST_NODE_TYPES.TSAsyncKeyword]: ts.Token<ts.SyntaxKind.AsyncKeyword>;
162
+ [AST_NODE_TYPES.TSDeclareKeyword]: ts.Token<ts.SyntaxKind.DeclareKeyword>;
163
+ [AST_NODE_TYPES.TSExportKeyword]: ts.Token<ts.SyntaxKind.ExportKeyword>;
164
+ [AST_NODE_TYPES.TSStaticKeyword]: ts.Token<ts.SyntaxKind.StaticKeyword>;
165
+ [AST_NODE_TYPES.TSPublicKeyword]: ts.Token<ts.SyntaxKind.PublicKeyword>;
166
+ [AST_NODE_TYPES.TSPrivateKeyword]: ts.Token<ts.SyntaxKind.PrivateKeyword>;
167
+ [AST_NODE_TYPES.TSProtectedKeyword]: ts.Token<ts.SyntaxKind.ProtectedKeyword>;
168
+ [AST_NODE_TYPES.TSReadonlyKeyword]: ts.Token<ts.SyntaxKind.ReadonlyKeyword>;
169
+ }
170
+ /**
171
+ * Maps TSESTree AST Node type to the expected TypeScript AST Node type(s).
172
+ * This mapping is based on the internal logic of the parser.
173
+ */
174
+ export declare type TSESTreeToTSNode<T extends TSESTree.Node = TSESTree.Node> = Extract<TSNode | ts.Token<ts.SyntaxKind.NewKeyword | ts.SyntaxKind.ImportKeyword>, EstreeToTsNodeTypes[T['type']]>;
175
+ //# sourceMappingURL=estree-to-ts-node-types.d.ts.map
@@ -0,0 +1,4 @@
1
+ export { AST_NODE_TYPES, AST_TOKEN_TYPES, TSESTree, } from '@typescript-eslint/types';
2
+ export * from './ts-nodes';
3
+ export * from './estree-to-ts-node-types';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,18 @@
1
+ import * as ts from 'typescript';
2
+ declare module 'typescript' {
3
+ interface NamedTupleMember extends ts.Node {
4
+ }
5
+ interface TemplateLiteralTypeNode extends ts.Node {
6
+ }
7
+ interface PrivateIdentifier extends ts.Node {
8
+ }
9
+ interface ClassStaticBlockDeclaration extends ts.Node {
10
+ }
11
+ interface AssertClause extends ts.Node {
12
+ }
13
+ interface AssertEntry extends ts.Node {
14
+ }
15
+ }
16
+ export declare type TSToken = ts.Token<ts.SyntaxKind>;
17
+ export declare type TSNode = ts.AssertClause | ts.AssertEntry | ts.Modifier | ts.Identifier | ts.PrivateIdentifier | ts.QualifiedName | ts.ComputedPropertyName | ts.Decorator | ts.TypeParameterDeclaration | ts.CallSignatureDeclaration | ts.ConstructSignatureDeclaration | ts.VariableDeclaration | ts.VariableDeclarationList | ts.ParameterDeclaration | ts.BindingElement | ts.PropertySignature | ts.PropertyDeclaration | ts.PropertyAssignment | ts.ShorthandPropertyAssignment | ts.SpreadAssignment | ts.ObjectBindingPattern | ts.ArrayBindingPattern | ts.FunctionDeclaration | ts.MethodSignature | ts.MethodDeclaration | ts.ConstructorDeclaration | ts.SemicolonClassElement | ts.GetAccessorDeclaration | ts.SetAccessorDeclaration | ts.IndexSignatureDeclaration | ts.KeywordTypeNode | ts.ImportTypeNode | ts.ThisTypeNode | ts.ClassStaticBlockDeclaration | ts.ConstructorTypeNode | ts.FunctionTypeNode | ts.TypeReferenceNode | ts.TypePredicateNode | ts.TypeQueryNode | ts.TypeLiteralNode | ts.ArrayTypeNode | ts.NamedTupleMember | ts.TupleTypeNode | ts.OptionalTypeNode | ts.RestTypeNode | ts.UnionTypeNode | ts.IntersectionTypeNode | ts.ConditionalTypeNode | ts.InferTypeNode | ts.ParenthesizedTypeNode | ts.TypeOperatorNode | ts.IndexedAccessTypeNode | ts.MappedTypeNode | ts.LiteralTypeNode | ts.StringLiteral | ts.OmittedExpression | ts.PartiallyEmittedExpression | ts.PrefixUnaryExpression | ts.PostfixUnaryExpression | ts.NullLiteral | ts.BooleanLiteral | ts.ThisExpression | ts.SuperExpression | ts.ImportExpression | ts.DeleteExpression | ts.TypeOfExpression | ts.VoidExpression | ts.AwaitExpression | ts.YieldExpression | ts.SyntheticExpression | ts.BinaryExpression | ts.ConditionalExpression | ts.FunctionExpression | ts.ArrowFunction | ts.RegularExpressionLiteral | ts.NoSubstitutionTemplateLiteral | ts.NumericLiteral | ts.BigIntLiteral | ts.TemplateHead | ts.TemplateMiddle | ts.TemplateTail | ts.TemplateExpression | ts.TemplateSpan | ts.ParenthesizedExpression | ts.ArrayLiteralExpression | ts.SpreadElement | ts.ObjectLiteralExpression | ts.PropertyAccessExpression | ts.ElementAccessExpression | ts.CallExpression | ts.ExpressionWithTypeArguments | ts.NewExpression | ts.TaggedTemplateExpression | ts.AsExpression | ts.TypeAssertion | ts.NonNullExpression | ts.MetaProperty | ts.JsxElement | ts.JsxOpeningElement | ts.JsxSelfClosingElement | ts.JsxFragment | ts.JsxOpeningFragment | ts.JsxClosingFragment | ts.JsxAttribute | ts.JsxSpreadAttribute | ts.JsxClosingElement | ts.JsxExpression | ts.JsxText | ts.NotEmittedStatement | ts.CommaListExpression | ts.EmptyStatement | ts.DebuggerStatement | ts.MissingDeclaration | ts.Block | ts.VariableStatement | ts.ExpressionStatement | ts.IfStatement | ts.DoStatement | ts.WhileStatement | ts.ForStatement | ts.ForInStatement | ts.ForOfStatement | ts.BreakStatement | ts.ContinueStatement | ts.ReturnStatement | ts.WithStatement | ts.SwitchStatement | ts.CaseBlock | ts.CaseClause | ts.DefaultClause | ts.LabeledStatement | ts.ThrowStatement | ts.TryStatement | ts.CatchClause | ts.ClassDeclaration | ts.ClassExpression | ts.InterfaceDeclaration | ts.HeritageClause | ts.TypeAliasDeclaration | ts.EnumMember | ts.EnumDeclaration | ts.ModuleDeclaration | ts.ModuleBlock | ts.ImportEqualsDeclaration | ts.ExternalModuleReference | ts.ImportDeclaration | ts.ImportClause | ts.NamespaceImport | ts.NamespaceExportDeclaration | ts.ExportDeclaration | ts.NamedImports | ts.NamedExports | ts.ImportSpecifier | ts.ExportSpecifier | ts.ExportAssignment | ts.SourceFile | ts.Bundle | ts.InputFiles | ts.UnparsedSource | ts.JsonMinusNumericLiteral | ts.TemplateLiteralTypeNode | ts.JSDoc | ts.JSDocTypeExpression | ts.JSDocUnknownTag | ts.JSDocAugmentsTag | ts.JSDocClassTag | ts.JSDocEnumTag | ts.JSDocThisTag | ts.JSDocTemplateTag | ts.JSDocReturnTag | ts.JSDocTypeTag | ts.JSDocTypedefTag | ts.JSDocCallbackTag | ts.JSDocSignature | ts.JSDocPropertyTag | ts.JSDocParameterTag | ts.JSDocTypeLiteral | ts.JSDocFunctionType | ts.JSDocAllType | ts.JSDocUnknownType | ts.JSDocNullableType | ts.JSDocNonNullableType | ts.JSDocOptionalType | ts.JSDocVariadicType | ts.JSDocAuthorTag;
18
+ //# sourceMappingURL=ts-nodes.d.ts.map
@@ -0,0 +1,3 @@
1
+ declare const typescriptVersionIsAtLeast: Record<"3.7" | "3.8" | "3.9" | "4.0" | "4.1" | "4.2" | "4.3" | "4.4" | "4.5" | "4.6" | "4.7" | "4.8", boolean>;
2
+ export { typescriptVersionIsAtLeast };
3
+ //# sourceMappingURL=version-check.d.ts.map
@@ -130,10 +130,12 @@ export declare class Converter {
130
130
  private convertAssertClasue;
131
131
  /**
132
132
  * Applies the given TS modifiers to the given result object.
133
+ *
134
+ * This method adds not standardized `modifiers` property in nodes
135
+ *
133
136
  * @param result
134
137
  * @param modifiers original ts.Nodes from the node.modifiers array
135
138
  * @returns the current result object will be mutated
136
- * @deprecated This method adds not standardized `modifiers` property in nodes
137
139
  */
138
140
  private applyModifiersToResult;
139
141
  /**
@@ -1 +1 @@
1
- {"version":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FlB,OAAO,CAAC,oBAAoB;IAW5B,OAAO,CAAC,+BAA+B;IA6BvC;;;;;OAKG;IACH,OAAO,CAAC,iBAAiB;IA8BzB,OAAO,CAAC,sBAAsB;IA4D9B,OAAO,CAAC,mBAAmB;IAQ3B;;;;;;;;OAQG;IACH,OAAO,CAAC,sBAAsB;IA+C9B;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IAczB,OAAO,CAAC,qBAAqB;IAwB7B;;;;;;;OAOG;IACH,OAAO,CAAC,WAAW;CAgnEpB"}
@@ -27,6 +27,7 @@ exports.Converter = exports.convertError = void 0;
27
27
  // There's lots of funny stuff due to the typing of ts.Node
28
28
  /* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access */
29
29
  const ts = __importStar(require("typescript"));
30
+ const getModifiers_1 = require("./getModifiers");
30
31
  const node_utils_1 = require("./node-utils");
31
32
  const ts_estree_1 = require("./ts-estree");
32
33
  const version_check_1 = require("./version-check");
@@ -101,13 +102,14 @@ class Converter {
101
102
  */
102
103
  fixExports(node, result) {
103
104
  // check for exports
104
- if (node.modifiers && node.modifiers[0].kind === SyntaxKind.ExportKeyword) {
105
+ const modifiers = (0, getModifiers_1.getModifiers)(node);
106
+ if ((modifiers === null || modifiers === void 0 ? void 0 : modifiers[0].kind) === SyntaxKind.ExportKeyword) {
105
107
  /**
106
108
  * Make sure that original node is registered instead of export
107
109
  */
108
110
  this.registerTSNodeInNodeMap(node, result);
109
- const exportKeyword = node.modifiers[0];
110
- const nextModifier = node.modifiers[1];
111
+ const exportKeyword = modifiers[0];
112
+ const nextModifier = modifiers[1];
111
113
  const declarationIsDefault = nextModifier && nextModifier.kind === SyntaxKind.DefaultKeyword;
112
114
  const varToken = declarationIsDefault
113
115
  ? (0, node_utils_1.findNextToken)(nextModifier, this.ast, this.ast)
@@ -288,10 +290,10 @@ class Converter {
288
290
  return [];
289
291
  }
290
292
  return parameters.map(param => {
291
- var _a;
292
293
  const convertedParam = this.convertChild(param);
293
- if ((_a = param.decorators) === null || _a === void 0 ? void 0 : _a.length) {
294
- convertedParam.decorators = param.decorators.map(el => this.convertChild(el));
294
+ const decorators = (0, getModifiers_1.getDecorators)(param);
295
+ if (decorators === null || decorators === void 0 ? void 0 : decorators.length) {
296
+ convertedParam.decorators = decorators.map(el => this.convertChild(el));
295
297
  }
296
298
  return convertedParam;
297
299
  });
@@ -366,11 +368,36 @@ class Converter {
366
368
  ? this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters)
367
369
  : null;
368
370
  }
369
- if ('decorators' in node && node.decorators && node.decorators.length) {
370
- result.decorators = node.decorators.map(el => this.convertChild(el));
371
+ const decorators = (0, getModifiers_1.getDecorators)(node);
372
+ if (decorators === null || decorators === void 0 ? void 0 : decorators.length) {
373
+ result.decorators = decorators.map(el => this.convertChild(el));
371
374
  }
375
+ // keys we never want to clone from the base typescript node as they
376
+ // introduce garbage into our AST
377
+ const KEYS_TO_NOT_COPY = new Set([
378
+ '_children',
379
+ 'decorators',
380
+ 'end',
381
+ 'flags',
382
+ 'illegalDecorators',
383
+ 'heritageClauses',
384
+ 'locals',
385
+ 'localSymbol',
386
+ 'jsDoc',
387
+ 'kind',
388
+ 'modifierFlagsCache',
389
+ 'modifiers',
390
+ 'nextContainer',
391
+ 'parent',
392
+ 'pos',
393
+ 'symbol',
394
+ 'transformFlags',
395
+ 'type',
396
+ 'typeArguments',
397
+ 'typeParameters',
398
+ ]);
372
399
  Object.entries(node)
373
- .filter(([key]) => !/^(?:_children|kind|parent|pos|end|flags|modifierFlagsCache|jsDoc|type|typeArguments|typeParameters|decorators|transformFlags)$/.test(key))
400
+ .filter(([key]) => !KEYS_TO_NOT_COPY.has(key))
374
401
  .forEach(([key, value]) => {
375
402
  if (Array.isArray(value)) {
376
403
  result[key] = value.map(el => this.convertChild(el));
@@ -496,13 +523,15 @@ class Converter {
496
523
  }
497
524
  /**
498
525
  * Applies the given TS modifiers to the given result object.
526
+ *
527
+ * This method adds not standardized `modifiers` property in nodes
528
+ *
499
529
  * @param result
500
530
  * @param modifiers original ts.Nodes from the node.modifiers array
501
531
  * @returns the current result object will be mutated
502
- * @deprecated This method adds not standardized `modifiers` property in nodes
503
532
  */
504
533
  applyModifiersToResult(result, modifiers) {
505
- if (!(modifiers === null || modifiers === void 0 ? void 0 : modifiers.length)) {
534
+ if (!modifiers) {
506
535
  return;
507
536
  }
508
537
  const remainingModifiers = [];
@@ -537,7 +566,7 @@ class Converter {
537
566
  * not been explicitly handled above, we just convert and
538
567
  * add the modifiers array to the result node.
539
568
  */
540
- if (remainingModifiers.length) {
569
+ if (remainingModifiers.length > 0) {
541
570
  result.modifiers = remainingModifiers;
542
571
  }
543
572
  }
@@ -773,12 +802,11 @@ class Converter {
773
802
  });
774
803
  /**
775
804
  * Semantically, decorators are not allowed on variable declarations,
776
- * but the TypeScript compiler will parse them and produce a valid AST,
777
- * so we handle them here too.
805
+ * Pre 4.8 TS would include them in the AST, so we did as well.
806
+ * However as of 4.8 TS no longer includes it (as it is, well, invalid).
807
+ *
808
+ * So for consistency across versions, we no longer include it either.
778
809
  */
779
- if (node.decorators) {
780
- result.decorators = node.decorators.map(el => this.convertChild(el));
781
- }
782
810
  if ((0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node)) {
783
811
  result.declare = true;
784
812
  }
@@ -889,8 +917,9 @@ class Converter {
889
917
  if (node.type) {
890
918
  result.typeAnnotation = this.convertTypeAnnotation(node.type, node);
891
919
  }
892
- if (node.decorators) {
893
- result.decorators = node.decorators.map(el => this.convertChild(el));
920
+ const decorators = (0, getModifiers_1.getDecorators)(node);
921
+ if (decorators) {
922
+ result.decorators = decorators.map(el => this.convertChild(el));
894
923
  }
895
924
  const accessibility = (0, node_utils_1.getTSNodeAccessibility)(node);
896
925
  if (accessibility) {
@@ -974,8 +1003,9 @@ class Converter {
974
1003
  kind: 'method',
975
1004
  override: (0, node_utils_1.hasModifier)(SyntaxKind.OverrideKeyword, node),
976
1005
  });
977
- if (node.decorators) {
978
- result.decorators = node.decorators.map(el => this.convertChild(el));
1006
+ const decorators = (0, getModifiers_1.getDecorators)(node);
1007
+ if (decorators) {
1008
+ result.decorators = decorators.map(el => this.convertChild(el));
979
1009
  }
980
1010
  const accessibility = (0, node_utils_1.getTSNodeAccessibility)(node);
981
1011
  if (accessibility) {
@@ -1252,7 +1282,8 @@ class Converter {
1252
1282
  left: parameter,
1253
1283
  right: this.convertChild(node.initializer),
1254
1284
  });
1255
- if (node.modifiers) {
1285
+ const modifiers = (0, getModifiers_1.getModifiers)(node);
1286
+ if (modifiers) {
1256
1287
  // AssignmentPattern should not contain modifiers in range
1257
1288
  result.range[0] = parameter.range[0];
1258
1289
  result.loc = (0, node_utils_1.getLocFor)(result.range[0], result.range[1], this.ast);
@@ -1272,7 +1303,12 @@ class Converter {
1272
1303
  }
1273
1304
  parameter.optional = true;
1274
1305
  }
1275
- if (node.modifiers) {
1306
+ const decorators = (0, getModifiers_1.getDecorators)(node);
1307
+ if (decorators) {
1308
+ parameter.decorators = decorators.map(d => this.convertChild(d));
1309
+ }
1310
+ const modifiers = (0, getModifiers_1.getModifiers)(node);
1311
+ if (modifiers) {
1276
1312
  return this.createNode(node, {
1277
1313
  type: ts_estree_1.AST_NODE_TYPES.TSParameterProperty,
1278
1314
  accessibility: (_c = (0, node_utils_1.getTSNodeAccessibility)(node)) !== null && _c !== void 0 ? _c : undefined,
@@ -1331,8 +1367,9 @@ class Converter {
1331
1367
  if ((0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node)) {
1332
1368
  result.declare = true;
1333
1369
  }
1334
- if (node.decorators) {
1335
- result.decorators = node.decorators.map(el => this.convertChild(el));
1370
+ const decorators = (0, getModifiers_1.getDecorators)(node);
1371
+ if (decorators) {
1372
+ result.decorators = decorators.map(el => this.convertChild(el));
1336
1373
  }
1337
1374
  const filteredMembers = node.members.filter(node_utils_1.isESTreeClassMember);
1338
1375
  if (filteredMembers.length) {
@@ -1967,7 +2004,9 @@ class Converter {
1967
2004
  typeAnnotation: node.type
1968
2005
  ? this.convertTypeAnnotation(node.type, node)
1969
2006
  : undefined,
1970
- initializer: this.convertChild(node.initializer) || undefined,
2007
+ initializer: this.convertChild(
2008
+ // eslint-disable-next-line deprecation/deprecation -- TODO breaking change remove this from the AST
2009
+ node.initializer) || undefined,
1971
2010
  readonly: (0, node_utils_1.hasModifier)(SyntaxKind.ReadonlyKeyword, node) || undefined,
1972
2011
  static: (0, node_utils_1.hasModifier)(SyntaxKind.StaticKeyword, node) || undefined,
1973
2012
  export: (0, node_utils_1.hasModifier)(SyntaxKind.ExportKeyword, node) || undefined,
@@ -2134,7 +2173,7 @@ class Converter {
2134
2173
  members: node.members.map(el => this.convertChild(el)),
2135
2174
  });
2136
2175
  // apply modifiers first...
2137
- this.applyModifiersToResult(result, node.modifiers);
2176
+ this.applyModifiersToResult(result, (0, getModifiers_1.getModifiers)(node));
2138
2177
  // ...then check for exports
2139
2178
  return this.fixExports(node, result);
2140
2179
  }
@@ -2160,7 +2199,7 @@ class Converter {
2160
2199
  result.body = this.convertChild(node.body);
2161
2200
  }
2162
2201
  // apply modifiers first...
2163
- this.applyModifiersToResult(result, node.modifiers);
2202
+ this.applyModifiersToResult(result, (0, getModifiers_1.getModifiers)(node));
2164
2203
  if (node.flags & ts.NodeFlags.GlobalAugmentation) {
2165
2204
  result.global = true;
2166
2205
  }