@interlace/eslint-devkit 2.1.1 → 2.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 (155) hide show
  1. package/package.json +1 -6
  2. package/src/aria-definitions.js +1 -1
  3. package/src/ast/ast-utils.d.ts +1 -1
  4. package/src/ast/module-binding.d.ts +1 -1
  5. package/src/ast/spellings.d.ts +1 -1
  6. package/src/ast/static-expression.d.ts +1 -1
  7. package/src/ast/type-syntax.d.ts +1 -1
  8. package/src/ast-node-types.d.ts +1 -1
  9. package/src/index.d.ts +6 -3
  10. package/src/resolver/dependency-analysis.d.ts +29 -0
  11. package/src/resolver/dependency-analysis.js +1 -1
  12. package/src/rule-creation/browser-escape-hatch-rule.d.ts +1 -1
  13. package/src/rule-creation/connection-config.d.ts +1 -1
  14. package/src/rule-creation/driver-origin.d.ts +1 -1
  15. package/src/rule-creation/generated-file.d.ts +1 -1
  16. package/src/rule-creation/hardcoded-credentials-rule.d.ts +9 -2
  17. package/src/rule-creation/mass-assignment-rule.d.ts +9 -2
  18. package/src/rule-creation/message-source.d.ts +1 -1
  19. package/src/rule-creation/minified-file.d.ts +1 -1
  20. package/src/rule-creation/mock-context.d.ts +1 -1
  21. package/src/rule-creation/module-evidence.d.ts +1 -1
  22. package/src/rule-creation/raw-identifier-rule.d.ts +9 -2
  23. package/src/rule-creation/request-source.d.ts +1 -1
  24. package/src/rule-creation/require-tls-rule.d.ts +8 -2
  25. package/src/rule-creation/rule-creator.d.ts +1 -1
  26. package/src/rule-creation/rule-creator.js +1 -1
  27. package/src/rule-creation/sdk-api-key-rule.d.ts +1 -1
  28. package/src/rule-creation/sdk-flow.d.ts +1 -1
  29. package/src/rule-creation/sql-injection-rule.d.ts +8 -2
  30. package/src/rule-creation/sql-position.d.ts +1 -1
  31. package/src/rule-creation/sql-safety.d.ts +1 -1
  32. package/src/rule-creation/system-prompt-injection-rule.d.ts +1 -1
  33. package/src/rule-creation/unscoped-mutation-rule.d.ts +9 -2
  34. package/src/rule-creation/value-follow.d.ts +1 -1
  35. package/src/security/security-utils.d.ts +1 -1
  36. package/src/types/estree/project-service/createProjectService.d.ts +67 -0
  37. package/src/types/estree/project-service/index.d.ts +3 -0
  38. package/src/types/estree/scope-manager/ScopeManager.d.ts +77 -0
  39. package/src/types/estree/scope-manager/analyze.d.ts +55 -0
  40. package/src/types/estree/scope-manager/definition/CatchClauseDefinition.d.ts +10 -0
  41. package/src/types/estree/scope-manager/definition/ClassNameDefinition.d.ts +10 -0
  42. package/src/types/estree/scope-manager/definition/Definition.d.ts +14 -0
  43. package/src/types/estree/scope-manager/definition/DefinitionBase.d.ts +35 -0
  44. package/src/types/estree/scope-manager/definition/DefinitionType.d.ts +15 -0
  45. package/src/types/estree/scope-manager/definition/FunctionNameDefinition.d.ts +10 -0
  46. package/src/types/estree/scope-manager/definition/ImplicitGlobalVariableDefinition.d.ts +10 -0
  47. package/src/types/estree/scope-manager/definition/ImportBindingDefinition.d.ts +11 -0
  48. package/src/types/estree/scope-manager/definition/ParameterDefinition.d.ts +14 -0
  49. package/src/types/estree/scope-manager/definition/TSEnumMemberDefinition.d.ts +10 -0
  50. package/src/types/estree/scope-manager/definition/TSEnumNameDefinition.d.ts +10 -0
  51. package/src/types/estree/scope-manager/definition/TSModuleNameDefinition.d.ts +10 -0
  52. package/src/types/estree/scope-manager/definition/TypeDefinition.d.ts +10 -0
  53. package/src/types/estree/scope-manager/definition/VariableDefinition.d.ts +10 -0
  54. package/src/types/estree/scope-manager/definition/index.d.ts +15 -0
  55. package/src/types/estree/scope-manager/index.d.ts +10 -0
  56. package/src/types/estree/scope-manager/referencer/PatternVisitor.d.ts +16 -0
  57. package/src/types/estree/scope-manager/referencer/Reference.d.ts +88 -0
  58. package/src/types/estree/scope-manager/referencer/Referencer.d.ts +28 -0
  59. package/src/types/estree/scope-manager/referencer/Visitor.d.ts +13 -0
  60. package/src/types/estree/scope-manager/referencer/VisitorBase.d.ts +22 -0
  61. package/src/types/estree/scope-manager/referencer/index.d.ts +3 -0
  62. package/src/types/estree/scope-manager/scope/BlockScope.d.ts +10 -0
  63. package/src/types/estree/scope-manager/scope/CatchScope.d.ts +10 -0
  64. package/src/types/estree/scope-manager/scope/ClassFieldInitializerScope.d.ts +10 -0
  65. package/src/types/estree/scope-manager/scope/ClassScope.d.ts +10 -0
  66. package/src/types/estree/scope-manager/scope/ClassStaticBlockScope.d.ts +10 -0
  67. package/src/types/estree/scope-manager/scope/ConditionalTypeScope.d.ts +10 -0
  68. package/src/types/estree/scope-manager/scope/ForScope.d.ts +10 -0
  69. package/src/types/estree/scope-manager/scope/FunctionExpressionNameScope.d.ts +11 -0
  70. package/src/types/estree/scope-manager/scope/FunctionScope.d.ts +12 -0
  71. package/src/types/estree/scope-manager/scope/FunctionTypeScope.d.ts +10 -0
  72. package/src/types/estree/scope-manager/scope/GlobalScope.d.ts +18 -0
  73. package/src/types/estree/scope-manager/scope/MappedTypeScope.d.ts +10 -0
  74. package/src/types/estree/scope-manager/scope/ModuleScope.d.ts +10 -0
  75. package/src/types/estree/scope-manager/scope/Scope.d.ts +21 -0
  76. package/src/types/estree/scope-manager/scope/ScopeBase.d.ts +91 -0
  77. package/src/types/estree/scope-manager/scope/ScopeType.d.ts +22 -0
  78. package/src/types/estree/scope-manager/scope/SwitchScope.d.ts +10 -0
  79. package/src/types/estree/scope-manager/scope/TSEnumScope.d.ts +10 -0
  80. package/src/types/estree/scope-manager/scope/TSModuleScope.d.ts +10 -0
  81. package/src/types/estree/scope-manager/scope/TypeScope.d.ts +10 -0
  82. package/src/types/estree/scope-manager/scope/WithScope.d.ts +11 -0
  83. package/src/types/estree/scope-manager/scope/index.d.ts +22 -0
  84. package/src/types/estree/scope-manager/variable/ESLintScopeVariable.d.ts +34 -0
  85. package/src/types/estree/scope-manager/variable/ImplicitLibVariable.d.ts +29 -0
  86. package/src/types/estree/scope-manager/variable/Variable.d.ts +18 -0
  87. package/src/types/estree/scope-manager/variable/VariableBase.d.ts +44 -0
  88. package/src/types/estree/scope-manager/variable/index.d.ts +8 -0
  89. package/src/types/estree/types/generated/ast-spec.d.ts +2215 -0
  90. package/src/types/estree/types/index.d.ts +6 -0
  91. package/src/types/estree/types/lib.d.ts +3 -0
  92. package/src/types/estree/types/parser-options.d.ts +83 -0
  93. package/src/types/estree/types/ts-estree.d.ts +190 -0
  94. package/src/types/estree/typescript-estree/clear-caches.d.ts +11 -0
  95. package/src/types/estree/typescript-estree/create-program/getScriptKind.d.ts +5 -0
  96. package/src/types/estree/typescript-estree/create-program/shared.d.ts +29 -0
  97. package/src/types/estree/typescript-estree/create-program/useProvidedPrograms.d.ts +13 -0
  98. package/src/types/estree/typescript-estree/getModifiers.d.ts +5 -0
  99. package/src/types/estree/typescript-estree/index.d.ts +16 -0
  100. package/src/types/estree/typescript-estree/node-utils.d.ts +191 -0
  101. package/src/types/estree/typescript-estree/parseSettings/ExpiringCache.d.ts +17 -0
  102. package/src/types/estree/typescript-estree/parseSettings/candidateTSConfigRootDirs.d.ts +5 -0
  103. package/src/types/estree/typescript-estree/parseSettings/index.d.ts +128 -0
  104. package/src/types/estree/typescript-estree/parser-options.d.ts +220 -0
  105. package/src/types/estree/typescript-estree/parser.d.ts +19 -0
  106. package/src/types/estree/typescript-estree/simple-traverse.d.ts +13 -0
  107. package/src/types/estree/typescript-estree/ts-estree/estree-to-ts-node-types.d.ts +180 -0
  108. package/src/types/estree/typescript-estree/ts-estree/index.d.ts +5 -0
  109. package/src/types/estree/typescript-estree/ts-estree/ts-nodes.d.ts +19 -0
  110. package/src/types/estree/typescript-estree/version-check.d.ts +6 -0
  111. package/src/types/estree/typescript-estree/version.d.ts +3 -0
  112. package/src/types/estree/typescript-estree/withoutProjectParserOptions.d.ts +11 -0
  113. package/src/types/estree/utils/ast-utils/eslint-utils/PatternMatcher.d.ts +49 -0
  114. package/src/types/estree/utils/ast-utils/eslint-utils/ReferenceTracker.d.ts +73 -0
  115. package/src/types/estree/utils/ast-utils/eslint-utils/astUtilities.d.ts +85 -0
  116. package/src/types/estree/utils/ast-utils/eslint-utils/index.d.ts +7 -0
  117. package/src/types/estree/utils/ast-utils/eslint-utils/predicates.d.ts +33 -0
  118. package/src/types/estree/utils/ast-utils/eslint-utils/scopeAnalysis.d.ts +18 -0
  119. package/src/types/estree/utils/ast-utils/helpers.d.ts +20 -0
  120. package/src/types/estree/utils/ast-utils/index.d.ts +6 -0
  121. package/src/types/estree/utils/ast-utils/misc.d.ts +12 -0
  122. package/src/types/estree/utils/ast-utils/predicates.d.ts +70 -0
  123. package/src/types/estree/utils/eslint-utils/InferTypesFromRule.d.ts +11 -0
  124. package/src/types/estree/utils/eslint-utils/RuleCreator.d.ts +34 -0
  125. package/src/types/estree/utils/eslint-utils/applyDefault.d.ts +10 -0
  126. package/src/types/estree/utils/eslint-utils/deepMerge.d.ts +16 -0
  127. package/src/types/estree/utils/eslint-utils/getParserServices.d.ts +24 -0
  128. package/src/types/estree/utils/eslint-utils/index.d.ts +8 -0
  129. package/src/types/estree/utils/eslint-utils/nullThrows.d.ts +14 -0
  130. package/src/types/estree/utils/index.d.ts +8 -0
  131. package/src/types/estree/utils/json-schema.d.ts +389 -0
  132. package/src/types/estree/utils/ts-eslint/AST.d.ts +10 -0
  133. package/src/types/estree/utils/ts-eslint/Config.d.ts +293 -0
  134. package/src/types/estree/utils/ts-eslint/ESLint.d.ts +9 -0
  135. package/src/types/estree/utils/ts-eslint/Linter.d.ts +257 -0
  136. package/src/types/estree/utils/ts-eslint/Parser.d.ts +96 -0
  137. package/src/types/estree/utils/ts-eslint/ParserOptions.d.ts +3 -0
  138. package/src/types/estree/utils/ts-eslint/Processor.d.ts +65 -0
  139. package/src/types/estree/utils/ts-eslint/Rule.d.ts +633 -0
  140. package/src/types/estree/utils/ts-eslint/RuleTester.d.ts +185 -0
  141. package/src/types/estree/utils/ts-eslint/Scope.d.ts +44 -0
  142. package/src/types/estree/utils/ts-eslint/SourceCode.d.ts +356 -0
  143. package/src/types/estree/utils/ts-eslint/eslint/ESLintShared.d.ts +383 -0
  144. package/src/types/estree/utils/ts-eslint/eslint/FlatESLint.d.ts +89 -0
  145. package/src/types/estree/utils/ts-eslint/eslint/LegacyESLint.d.ts +74 -0
  146. package/src/types/estree/utils/ts-eslint/index.d.ts +13 -0
  147. package/src/types/estree/utils/ts-estree.d.ts +5 -0
  148. package/src/types/estree/utils/ts-utils/NoInfer.d.ts +11 -0
  149. package/src/types/estree/utils/ts-utils/index.d.ts +4 -0
  150. package/src/types/estree/utils/ts-utils/isArray.d.ts +3 -0
  151. package/src/types/estree/visitor-keys/get-keys.d.ts +4 -0
  152. package/src/types/estree/visitor-keys/index.d.ts +4 -0
  153. package/src/types/estree/visitor-keys/visitor-keys.d.ts +4 -0
  154. package/src/types/meta-augmentation.d.ts +1 -1
  155. package/src/types/type-utils.d.ts +1 -1
@@ -0,0 +1,88 @@
1
+ // Vendored from @typescript-eslint/scope-manager@8.68.0 (MIT, Copyright JS Foundation and other contributors).
2
+ // Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
3
+ import type { NodeWithParent, TSESTree } from '../../types/index';
4
+ import type { Scope } from '../scope';
5
+ import type { Variable } from '../variable';
6
+ export declare enum ReferenceFlag {
7
+ Read = 1,
8
+ Write = 2,
9
+ ReadWrite = 3
10
+ }
11
+ export interface ReferenceImplicitGlobal {
12
+ node: NodeWithParent;
13
+ pattern: TSESTree.BindingName;
14
+ ref?: Reference;
15
+ }
16
+ export declare enum ReferenceTypeFlag {
17
+ Value = 1,
18
+ Type = 2
19
+ }
20
+ /**
21
+ * A Reference represents a single occurrence of an identifier in code.
22
+ */
23
+ export declare class Reference {
24
+ /**
25
+ * A unique ID for this instance - primarily used to help debugging and testing
26
+ */
27
+ readonly $id: number;
28
+ /**
29
+ * Reference to the enclosing Scope.
30
+ * @public
31
+ */
32
+ readonly from: Scope;
33
+ /**
34
+ * Identifier syntax node.
35
+ * @public
36
+ */
37
+ readonly identifier: TSESTree.Identifier | TSESTree.JSXIdentifier;
38
+ /**
39
+ * `true` if this writing reference is a variable initializer or a default value.
40
+ * @public
41
+ */
42
+ readonly init?: boolean;
43
+ readonly maybeImplicitGlobal?: ReferenceImplicitGlobal | null;
44
+ /**
45
+ * The {@link Variable} object that this reference refers to. If such variable was not defined, this is `null`.
46
+ * @public
47
+ */
48
+ resolved: Variable | null;
49
+ /**
50
+ * If reference is writeable, this is the node being written to it.
51
+ * @public
52
+ */
53
+ readonly writeExpr?: TSESTree.Node | null;
54
+ constructor(identifier: TSESTree.Identifier | TSESTree.JSXIdentifier, scope: Scope, flag: ReferenceFlag, writeExpr?: TSESTree.Node | null, maybeImplicitGlobal?: ReferenceImplicitGlobal | null, init?: boolean, referenceType?: ReferenceTypeFlag);
55
+ /**
56
+ * True if this reference can reference types
57
+ */
58
+ get isTypeReference(): boolean;
59
+ /**
60
+ * True if this reference can reference values
61
+ */
62
+ get isValueReference(): boolean;
63
+ /**
64
+ * Whether the reference is writeable.
65
+ * @public
66
+ */
67
+ isWrite(): boolean;
68
+ /**
69
+ * Whether the reference is readable.
70
+ * @public
71
+ */
72
+ isRead(): boolean;
73
+ /**
74
+ * Whether the reference is read-only.
75
+ * @public
76
+ */
77
+ isReadOnly(): boolean;
78
+ /**
79
+ * Whether the reference is write-only.
80
+ * @public
81
+ */
82
+ isWriteOnly(): boolean;
83
+ /**
84
+ * Whether the reference is read-write.
85
+ * @public
86
+ */
87
+ isReadWrite(): boolean;
88
+ }
@@ -0,0 +1,28 @@
1
+ // Vendored from @typescript-eslint/scope-manager@8.68.0 (MIT, Copyright JS Foundation and other contributors).
2
+ // Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
3
+ import type { Lib, TSESTree } from '../../types/index';
4
+ import type { Scope } from '../scope';
5
+ import type { ScopeManager } from '../ScopeManager';
6
+ import type { ReferenceImplicitGlobal } from './Reference';
7
+ import type { VisitorOptions } from './Visitor';
8
+ import { Visitor } from './Visitor';
9
+ export interface ReferencerOptions extends VisitorOptions {
10
+ jsxFragmentName: string | null;
11
+ jsxPragma: string | null;
12
+ lib: Lib[];
13
+ }
14
+ export declare class Referencer extends Visitor {
15
+ readonly scopeManager: ScopeManager;
16
+ constructor(options: ReferencerOptions, scopeManager: ScopeManager);
17
+ /**
18
+ * Resolves lib names into a deduplicated set of LibDefinitions,
19
+ * including all transitive dependencies.
20
+ */
21
+ close(node: TSESTree.Node): void;
22
+ currentScope(): Scope;
23
+ currentScope(throwOnNull: true): Scope | null;
24
+ referencingDefaultValue(pattern: TSESTree.Identifier, assignments: (TSESTree.AssignmentExpression | TSESTree.AssignmentPattern)[], maybeImplicitGlobal: ReferenceImplicitGlobal | null, init: boolean): void;
25
+ /**
26
+ * Searches for a variable named "name" in the upper scopes and adds a pseudo-reference from itself to itself
27
+ */
28
+ }
@@ -0,0 +1,13 @@
1
+ // Vendored from @typescript-eslint/scope-manager@8.68.0 (MIT, Copyright JS Foundation and other contributors).
2
+ // Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
3
+ import type { TSESTree } from '../../types/index';
4
+ import type { PatternVisitorCallback, PatternVisitorOptions } from './PatternVisitor';
5
+ import type { VisitorOptions } from './VisitorBase';
6
+ import { VisitorBase } from './VisitorBase';
7
+ interface VisitPatternOptions extends PatternVisitorOptions {
8
+ processRightHandNodes?: boolean;
9
+ }
10
+ export declare class Visitor extends VisitorBase {
11
+ constructor(optionsOrVisitor: Visitor | VisitorOptions);
12
+ }
13
+ export { VisitorBase, type VisitorOptions } from './VisitorBase';
@@ -0,0 +1,22 @@
1
+ // Vendored from @typescript-eslint/scope-manager@8.68.0 (MIT, Copyright JS Foundation and other contributors).
2
+ // Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
3
+ import type { TSESTree } from '../../types/index';
4
+ import type { VisitorKeys } from '../../visitor-keys/index';
5
+ export interface VisitorOptions {
6
+ childVisitorKeys?: VisitorKeys | null;
7
+ visitChildrenEvenIfSelectorExists?: boolean;
8
+ }
9
+ export declare abstract class VisitorBase {
10
+ constructor(options: VisitorOptions);
11
+ /**
12
+ * Default method for visiting children.
13
+ * @param node the node whose children should be visited
14
+ * @param excludeArr a list of keys to not visit
15
+ */
16
+ visitChildren<T extends TSESTree.Node>(node: T | null | undefined, excludeArr?: (keyof T)[]): void;
17
+ /**
18
+ * Dispatching node.
19
+ */
20
+ visit(node: TSESTree.Node | null | undefined): void;
21
+ }
22
+ export type { VisitorKeys } from '../../visitor-keys/index';
@@ -0,0 +1,3 @@
1
+ // Vendored from @typescript-eslint/scope-manager@8.68.0 (MIT, Copyright JS Foundation and other contributors).
2
+ // Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
3
+ export { Referencer, type ReferencerOptions } from './Referencer';
@@ -0,0 +1,10 @@
1
+ // Vendored from @typescript-eslint/scope-manager@8.68.0 (MIT, Copyright JS Foundation and other contributors).
2
+ // Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
3
+ import type { TSESTree } from '../../types/index';
4
+ import type { ScopeManager } from '../ScopeManager';
5
+ import type { Scope } from './Scope';
6
+ import { ScopeBase } from './ScopeBase';
7
+ import { ScopeType } from './ScopeType';
8
+ export declare class BlockScope extends ScopeBase<ScopeType.block, TSESTree.BlockStatement, Scope> {
9
+ constructor(scopeManager: ScopeManager, upperScope: BlockScope['upper'], block: BlockScope['block']);
10
+ }
@@ -0,0 +1,10 @@
1
+ // Vendored from @typescript-eslint/scope-manager@8.68.0 (MIT, Copyright JS Foundation and other contributors).
2
+ // Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
3
+ import type { TSESTree } from '../../types/index';
4
+ import type { ScopeManager } from '../ScopeManager';
5
+ import type { Scope } from './Scope';
6
+ import { ScopeBase } from './ScopeBase';
7
+ import { ScopeType } from './ScopeType';
8
+ export declare class CatchScope extends ScopeBase<ScopeType.catch, TSESTree.CatchClause, Scope> {
9
+ constructor(scopeManager: ScopeManager, upperScope: CatchScope['upper'], block: CatchScope['block']);
10
+ }
@@ -0,0 +1,10 @@
1
+ // Vendored from @typescript-eslint/scope-manager@8.68.0 (MIT, Copyright JS Foundation and other contributors).
2
+ // Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
3
+ import type { TSESTree } from '../../types/index';
4
+ import type { ScopeManager } from '../ScopeManager';
5
+ import type { Scope } from './Scope';
6
+ import { ScopeBase } from './ScopeBase';
7
+ import { ScopeType } from './ScopeType';
8
+ export declare class ClassFieldInitializerScope extends ScopeBase<ScopeType.classFieldInitializer, TSESTree.Expression, Scope> {
9
+ constructor(scopeManager: ScopeManager, upperScope: ClassFieldInitializerScope['upper'], block: ClassFieldInitializerScope['block']);
10
+ }
@@ -0,0 +1,10 @@
1
+ // Vendored from @typescript-eslint/scope-manager@8.68.0 (MIT, Copyright JS Foundation and other contributors).
2
+ // Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
3
+ import type { TSESTree } from '../../types/index';
4
+ import type { ScopeManager } from '../ScopeManager';
5
+ import type { Scope } from './Scope';
6
+ import { ScopeBase } from './ScopeBase';
7
+ import { ScopeType } from './ScopeType';
8
+ export declare class ClassScope extends ScopeBase<ScopeType.class, TSESTree.ClassDeclaration | TSESTree.ClassExpression, Scope> {
9
+ constructor(scopeManager: ScopeManager, upperScope: ClassScope['upper'], block: ClassScope['block']);
10
+ }
@@ -0,0 +1,10 @@
1
+ // Vendored from @typescript-eslint/scope-manager@8.68.0 (MIT, Copyright JS Foundation and other contributors).
2
+ // Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
3
+ import type { TSESTree } from '../../types/index';
4
+ import type { ScopeManager } from '../ScopeManager';
5
+ import type { Scope } from './Scope';
6
+ import { ScopeBase } from './ScopeBase';
7
+ import { ScopeType } from './ScopeType';
8
+ export declare class ClassStaticBlockScope extends ScopeBase<ScopeType.classStaticBlock, TSESTree.StaticBlock, Scope> {
9
+ constructor(scopeManager: ScopeManager, upperScope: ClassStaticBlockScope['upper'], block: ClassStaticBlockScope['block']);
10
+ }
@@ -0,0 +1,10 @@
1
+ // Vendored from @typescript-eslint/scope-manager@8.68.0 (MIT, Copyright JS Foundation and other contributors).
2
+ // Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
3
+ import type { TSESTree } from '../../types/index';
4
+ import type { ScopeManager } from '../ScopeManager';
5
+ import type { Scope } from './Scope';
6
+ import { ScopeBase } from './ScopeBase';
7
+ import { ScopeType } from './ScopeType';
8
+ export declare class ConditionalTypeScope extends ScopeBase<ScopeType.conditionalType, TSESTree.TSConditionalType, Scope> {
9
+ constructor(scopeManager: ScopeManager, upperScope: ConditionalTypeScope['upper'], block: ConditionalTypeScope['block']);
10
+ }
@@ -0,0 +1,10 @@
1
+ // Vendored from @typescript-eslint/scope-manager@8.68.0 (MIT, Copyright JS Foundation and other contributors).
2
+ // Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
3
+ import type { TSESTree } from '../../types/index';
4
+ import type { ScopeManager } from '../ScopeManager';
5
+ import type { Scope } from './Scope';
6
+ import { ScopeBase } from './ScopeBase';
7
+ import { ScopeType } from './ScopeType';
8
+ export declare class ForScope extends ScopeBase<ScopeType.for, TSESTree.ForInStatement | TSESTree.ForOfStatement | TSESTree.ForStatement, Scope> {
9
+ constructor(scopeManager: ScopeManager, upperScope: ForScope['upper'], block: ForScope['block']);
10
+ }
@@ -0,0 +1,11 @@
1
+ // Vendored from @typescript-eslint/scope-manager@8.68.0 (MIT, Copyright JS Foundation and other contributors).
2
+ // Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
3
+ import type { TSESTree } from '../../types/index';
4
+ import type { ScopeManager } from '../ScopeManager';
5
+ import type { Scope } from './Scope';
6
+ import { ScopeBase } from './ScopeBase';
7
+ import { ScopeType } from './ScopeType';
8
+ export declare class FunctionExpressionNameScope extends ScopeBase<ScopeType.functionExpressionName, TSESTree.FunctionExpression, Scope> {
9
+ readonly functionExpressionScope: true;
10
+ constructor(scopeManager: ScopeManager, upperScope: FunctionExpressionNameScope['upper'], block: FunctionExpressionNameScope['block']);
11
+ }
@@ -0,0 +1,12 @@
1
+ // Vendored from @typescript-eslint/scope-manager@8.68.0 (MIT, Copyright JS Foundation and other contributors).
2
+ // Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
3
+ import type { TSESTree } from '../../types/index';
4
+ import type { Reference } from '../referencer/Reference';
5
+ import type { ScopeManager } from '../ScopeManager';
6
+ import type { Variable } from '../variable';
7
+ import type { Scope } from './Scope';
8
+ import { ScopeBase } from './ScopeBase';
9
+ import { ScopeType } from './ScopeType';
10
+ export declare class FunctionScope extends ScopeBase<ScopeType.function, TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | TSESTree.Program | TSESTree.TSDeclareFunction | TSESTree.TSEmptyBodyFunctionExpression, Scope> {
11
+ constructor(scopeManager: ScopeManager, upperScope: FunctionScope['upper'], block: FunctionScope['block'], isMethodDefinition: boolean);
12
+ }
@@ -0,0 +1,10 @@
1
+ // Vendored from @typescript-eslint/scope-manager@8.68.0 (MIT, Copyright JS Foundation and other contributors).
2
+ // Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
3
+ import type { TSESTree } from '../../types/index';
4
+ import type { ScopeManager } from '../ScopeManager';
5
+ import type { Scope } from './Scope';
6
+ import { ScopeBase } from './ScopeBase';
7
+ import { ScopeType } from './ScopeType';
8
+ export declare class FunctionTypeScope extends ScopeBase<ScopeType.functionType, TSESTree.TSCallSignatureDeclaration | TSESTree.TSConstructorType | TSESTree.TSConstructSignatureDeclaration | TSESTree.TSFunctionType | TSESTree.TSMethodSignature, Scope> {
9
+ constructor(scopeManager: ScopeManager, upperScope: FunctionTypeScope['upper'], block: FunctionTypeScope['block']);
10
+ }
@@ -0,0 +1,18 @@
1
+ // Vendored from @typescript-eslint/scope-manager@8.68.0 (MIT, Copyright JS Foundation and other contributors).
2
+ // Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
3
+ import type { TSESTree } from '../../types/index';
4
+ import type { ScopeManager } from '../ScopeManager';
5
+ import type { ImplicitLibVariableOptions } from '../variable';
6
+ import type { Scope } from './Scope';
7
+ import { ScopeBase } from './ScopeBase';
8
+ import { ScopeType } from './ScopeType';
9
+ export declare class GlobalScope extends ScopeBase<ScopeType.global, TSESTree.Program,
10
+ /**
11
+ * The global scope has no parent.
12
+ */
13
+ null> {
14
+ constructor(scopeManager: ScopeManager, block: GlobalScope['block']);
15
+ addVariables(names: string[]): void;
16
+ close(scopeManager: ScopeManager): Scope | null;
17
+ defineImplicitVariable(name: string, options: ImplicitLibVariableOptions): void;
18
+ }
@@ -0,0 +1,10 @@
1
+ // Vendored from @typescript-eslint/scope-manager@8.68.0 (MIT, Copyright JS Foundation and other contributors).
2
+ // Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
3
+ import type { TSESTree } from '../../types/index';
4
+ import type { ScopeManager } from '../ScopeManager';
5
+ import type { Scope } from './Scope';
6
+ import { ScopeBase } from './ScopeBase';
7
+ import { ScopeType } from './ScopeType';
8
+ export declare class MappedTypeScope extends ScopeBase<ScopeType.mappedType, TSESTree.TSMappedType, Scope> {
9
+ constructor(scopeManager: ScopeManager, upperScope: MappedTypeScope['upper'], block: MappedTypeScope['block']);
10
+ }
@@ -0,0 +1,10 @@
1
+ // Vendored from @typescript-eslint/scope-manager@8.68.0 (MIT, Copyright JS Foundation and other contributors).
2
+ // Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
3
+ import type { TSESTree } from '../../types/index';
4
+ import type { ScopeManager } from '../ScopeManager';
5
+ import type { Scope } from './Scope';
6
+ import { ScopeBase } from './ScopeBase';
7
+ import { ScopeType } from './ScopeType';
8
+ export declare class ModuleScope extends ScopeBase<ScopeType.module, TSESTree.Program, Scope> {
9
+ constructor(scopeManager: ScopeManager, upperScope: ModuleScope['upper'], block: ModuleScope['block']);
10
+ }
@@ -0,0 +1,21 @@
1
+ // Vendored from @typescript-eslint/scope-manager@8.68.0 (MIT, Copyright JS Foundation and other contributors).
2
+ // Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
3
+ import type { BlockScope } from './BlockScope';
4
+ import type { CatchScope } from './CatchScope';
5
+ import type { ClassFieldInitializerScope } from './ClassFieldInitializerScope';
6
+ import type { ClassScope } from './ClassScope';
7
+ import type { ClassStaticBlockScope } from './ClassStaticBlockScope';
8
+ import type { ConditionalTypeScope } from './ConditionalTypeScope';
9
+ import type { ForScope } from './ForScope';
10
+ import type { FunctionExpressionNameScope } from './FunctionExpressionNameScope';
11
+ import type { FunctionScope } from './FunctionScope';
12
+ import type { FunctionTypeScope } from './FunctionTypeScope';
13
+ import type { GlobalScope } from './GlobalScope';
14
+ import type { MappedTypeScope } from './MappedTypeScope';
15
+ import type { ModuleScope } from './ModuleScope';
16
+ import type { SwitchScope } from './SwitchScope';
17
+ import type { TSEnumScope } from './TSEnumScope';
18
+ import type { TSModuleScope } from './TSModuleScope';
19
+ import type { TypeScope } from './TypeScope';
20
+ import type { WithScope } from './WithScope';
21
+ export type Scope = BlockScope | CatchScope | ClassFieldInitializerScope | ClassScope | ClassStaticBlockScope | ConditionalTypeScope | ForScope | FunctionExpressionNameScope | FunctionScope | FunctionTypeScope | GlobalScope | MappedTypeScope | ModuleScope | SwitchScope | TSEnumScope | TSModuleScope | TypeScope | WithScope;
@@ -0,0 +1,91 @@
1
+ // Vendored from @typescript-eslint/scope-manager@8.68.0 (MIT, Copyright JS Foundation and other contributors).
2
+ // Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
3
+ import type { TSESTree } from '../../types/index';
4
+ import type { Definition } from '../definition';
5
+ import type { ReferenceImplicitGlobal } from '../referencer/Reference';
6
+ import type { ScopeManager } from '../ScopeManager';
7
+ import type { FunctionScope } from './FunctionScope';
8
+ import type { GlobalScope } from './GlobalScope';
9
+ import type { ModuleScope } from './ModuleScope';
10
+ import type { Scope } from './Scope';
11
+ import type { TSModuleScope } from './TSModuleScope';
12
+ import { Reference, ReferenceFlag } from '../referencer/Reference';
13
+ import { Variable } from '../variable';
14
+ import { ScopeType } from './ScopeType';
15
+ type VariableScope = FunctionScope | GlobalScope | ModuleScope | TSModuleScope;
16
+ export declare abstract class ScopeBase<Type extends ScopeType, Block extends TSESTree.Node, Upper extends Scope | null> {
17
+ /**
18
+ * A unique ID for this instance - primarily used to help debugging and testing
19
+ */
20
+ readonly $id: number;
21
+ /**
22
+ * The AST node which created this scope.
23
+ * @public
24
+ */
25
+ readonly block: Block;
26
+ /**
27
+ * The array of child scopes. This does not include grandchild scopes.
28
+ * @public
29
+ */
30
+ readonly childScopes: Scope[];
31
+ /**
32
+ * Whether this scope is created by a FunctionExpression.
33
+ * @public
34
+ */
35
+ readonly functionExpressionScope: boolean;
36
+ /**
37
+ * Whether 'use strict' is in effect in this scope.
38
+ * @public
39
+ */
40
+ isStrict: boolean;
41
+ /**
42
+ * List of {@link Reference}s that are left to be resolved (i.e. which
43
+ * need to be linked to the variable they refer to).
44
+ */
45
+ /**
46
+ * Any variable {@link Reference} found in this scope.
47
+ * This includes occurrences of local variables as well as variables from parent scopes (including the global scope).
48
+ * For local variables this also includes defining occurrences (like in a 'var' statement).
49
+ * In a 'function' scope this does not include the occurrences of the formal parameter in the parameter list.
50
+ * @public
51
+ */
52
+ readonly references: Reference[];
53
+ /**
54
+ * The map from variable names to variable objects.
55
+ * @public
56
+ */
57
+ readonly set: Map<string, Variable>;
58
+ /**
59
+ * The {@link Reference}s that are not resolved with this scope.
60
+ * @public
61
+ */
62
+ through: Reference[];
63
+ readonly type: Type;
64
+ /**
65
+ * Reference to the parent {@link Scope}.
66
+ * @public
67
+ */
68
+ readonly upper: Upper;
69
+ /**
70
+ * The scoped {@link Variable}s of this scope.
71
+ * In the case of a 'function' scope this includes the automatic argument `arguments` as its first element, as well
72
+ * as all further formal arguments.
73
+ * This does not include variables which are defined in child scopes.
74
+ * @public
75
+ */
76
+ readonly variables: Variable[];
77
+ readonly variableScope: VariableScope;
78
+ constructor(scopeManager: ScopeManager, type: Type, upperScope: Upper, block: Block, isMethodDefinition: boolean);
79
+ close(_scopeManager: ScopeManager): Scope | null;
80
+ shouldStaticallyClose(): boolean;
81
+ /**
82
+ * To override by function scopes.
83
+ * References in default parameters isn't resolved to variables which are in their function body.
84
+ */
85
+ defineIdentifier(node: TSESTree.Identifier, def: Definition): void;
86
+ defineLiteralIdentifier(node: TSESTree.StringLiteral, def: Definition): void;
87
+ referenceDualValueType(node: TSESTree.Identifier): void;
88
+ referenceType(node: TSESTree.Identifier): void;
89
+ referenceValue(node: TSESTree.Identifier | TSESTree.JSXIdentifier, assign?: ReferenceFlag, writeExpr?: TSESTree.Expression | null, maybeImplicitGlobal?: ReferenceImplicitGlobal | null, init?: boolean): void;
90
+ }
91
+ export {};
@@ -0,0 +1,22 @@
1
+ // Vendored from @typescript-eslint/scope-manager@8.68.0 (MIT, Copyright JS Foundation and other contributors).
2
+ // Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
3
+ export declare enum ScopeType {
4
+ block = "block",
5
+ catch = "catch",
6
+ class = "class",
7
+ classFieldInitializer = "class-field-initializer",
8
+ classStaticBlock = "class-static-block",
9
+ conditionalType = "conditionalType",
10
+ for = "for",
11
+ function = "function",
12
+ functionExpressionName = "function-expression-name",
13
+ functionType = "functionType",
14
+ global = "global",
15
+ mappedType = "mappedType",
16
+ module = "module",
17
+ switch = "switch",
18
+ tsEnum = "tsEnum",
19
+ tsModule = "tsModule",
20
+ type = "type",
21
+ with = "with"
22
+ }
@@ -0,0 +1,10 @@
1
+ // Vendored from @typescript-eslint/scope-manager@8.68.0 (MIT, Copyright JS Foundation and other contributors).
2
+ // Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
3
+ import type { TSESTree } from '../../types/index';
4
+ import type { ScopeManager } from '../ScopeManager';
5
+ import type { Scope } from './Scope';
6
+ import { ScopeBase } from './ScopeBase';
7
+ import { ScopeType } from './ScopeType';
8
+ export declare class SwitchScope extends ScopeBase<ScopeType.switch, TSESTree.SwitchStatement, Scope> {
9
+ constructor(scopeManager: ScopeManager, upperScope: SwitchScope['upper'], block: SwitchScope['block']);
10
+ }
@@ -0,0 +1,10 @@
1
+ // Vendored from @typescript-eslint/scope-manager@8.68.0 (MIT, Copyright JS Foundation and other contributors).
2
+ // Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
3
+ import type { TSESTree } from '../../types/index';
4
+ import type { ScopeManager } from '../ScopeManager';
5
+ import type { Scope } from './Scope';
6
+ import { ScopeBase } from './ScopeBase';
7
+ import { ScopeType } from './ScopeType';
8
+ export declare class TSEnumScope extends ScopeBase<ScopeType.tsEnum, TSESTree.TSEnumDeclaration, Scope> {
9
+ constructor(scopeManager: ScopeManager, upperScope: TSEnumScope['upper'], block: TSEnumScope['block']);
10
+ }
@@ -0,0 +1,10 @@
1
+ // Vendored from @typescript-eslint/scope-manager@8.68.0 (MIT, Copyright JS Foundation and other contributors).
2
+ // Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
3
+ import type { TSESTree } from '../../types/index';
4
+ import type { ScopeManager } from '../ScopeManager';
5
+ import type { Scope } from './Scope';
6
+ import { ScopeBase } from './ScopeBase';
7
+ import { ScopeType } from './ScopeType';
8
+ export declare class TSModuleScope extends ScopeBase<ScopeType.tsModule, TSESTree.TSModuleDeclaration, Scope> {
9
+ constructor(scopeManager: ScopeManager, upperScope: TSModuleScope['upper'], block: TSModuleScope['block']);
10
+ }
@@ -0,0 +1,10 @@
1
+ // Vendored from @typescript-eslint/scope-manager@8.68.0 (MIT, Copyright JS Foundation and other contributors).
2
+ // Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
3
+ import type { TSESTree } from '../../types/index';
4
+ import type { ScopeManager } from '../ScopeManager';
5
+ import type { Scope } from './Scope';
6
+ import { ScopeBase } from './ScopeBase';
7
+ import { ScopeType } from './ScopeType';
8
+ export declare class TypeScope extends ScopeBase<ScopeType.type, TSESTree.TSInterfaceDeclaration | TSESTree.TSTypeAliasDeclaration, Scope> {
9
+ constructor(scopeManager: ScopeManager, upperScope: TypeScope['upper'], block: TypeScope['block']);
10
+ }
@@ -0,0 +1,11 @@
1
+ // Vendored from @typescript-eslint/scope-manager@8.68.0 (MIT, Copyright JS Foundation and other contributors).
2
+ // Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
3
+ import type { TSESTree } from '../../types/index';
4
+ import type { ScopeManager } from '../ScopeManager';
5
+ import type { Scope } from './Scope';
6
+ import { ScopeBase } from './ScopeBase';
7
+ import { ScopeType } from './ScopeType';
8
+ export declare class WithScope extends ScopeBase<ScopeType.with, TSESTree.WithStatement, Scope> {
9
+ constructor(scopeManager: ScopeManager, upperScope: WithScope['upper'], block: WithScope['block']);
10
+ close(scopeManager: ScopeManager): Scope | null;
11
+ }
@@ -0,0 +1,22 @@
1
+ // Vendored from @typescript-eslint/scope-manager@8.68.0 (MIT, Copyright JS Foundation and other contributors).
2
+ // Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
3
+ export * from './BlockScope';
4
+ export * from './CatchScope';
5
+ export * from './ClassFieldInitializerScope';
6
+ export * from './ClassScope';
7
+ export * from './ClassStaticBlockScope';
8
+ export * from './ConditionalTypeScope';
9
+ export * from './ForScope';
10
+ export * from './FunctionExpressionNameScope';
11
+ export * from './FunctionScope';
12
+ export * from './FunctionTypeScope';
13
+ export * from './GlobalScope';
14
+ export * from './MappedTypeScope';
15
+ export * from './ModuleScope';
16
+ export * from './Scope';
17
+ export * from './ScopeType';
18
+ export * from './SwitchScope';
19
+ export * from './TSEnumScope';
20
+ export * from './TSModuleScope';
21
+ export * from './TypeScope';
22
+ export * from './WithScope';
@@ -0,0 +1,34 @@
1
+ // Vendored from @typescript-eslint/scope-manager@8.68.0 (MIT, Copyright JS Foundation and other contributors).
2
+ // Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
3
+ import type { TSESTree } from '../../types/index';
4
+ import { VariableBase } from './VariableBase';
5
+ /**
6
+ * ESLint defines global variables using the eslint-scope Variable class
7
+ * This is declared here for consumers to use
8
+ */
9
+ export declare class ESLintScopeVariable extends VariableBase {
10
+ /**
11
+ * Written to by ESLint.
12
+ * If this key exists, this variable is a global variable added by ESLint.
13
+ * If this is `true`, this variable can be assigned arbitrary values.
14
+ * If this is `false`, this variable is readonly.
15
+ */
16
+ writeable?: boolean;
17
+ /**
18
+ * Written to by ESLint.
19
+ * This property is undefined if there are no globals comment directives.
20
+ * The array of globals comment directives which defined this global variable in the source code file.
21
+ */
22
+ eslintExplicitGlobal?: boolean;
23
+ /**
24
+ * Written to by ESLint.
25
+ * The configured value in config files. This can be different from `variable.writeable` if there are globals comment directives.
26
+ */
27
+ eslintImplicitGlobalSetting?: 'readonly' | 'writable';
28
+ /**
29
+ * Written to by ESLint.
30
+ * If this key exists, it is a global variable added by ESLint.
31
+ * If `true`, this global variable was defined by a globals comment directive in the source code file.
32
+ */
33
+ eslintExplicitGlobalComments?: TSESTree.Comment[];
34
+ }
@@ -0,0 +1,29 @@
1
+ // Vendored from @typescript-eslint/scope-manager@8.68.0 (MIT, Copyright JS Foundation and other contributors).
2
+ // Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
3
+ import type { Scope } from '../scope';
4
+ import type { Variable } from './Variable';
5
+ import { ESLintScopeVariable } from './ESLintScopeVariable';
6
+ export interface ImplicitLibVariableOptions {
7
+ readonly eslintImplicitGlobalSetting?: ESLintScopeVariable['eslintImplicitGlobalSetting'];
8
+ readonly isTypeVariable?: boolean;
9
+ readonly isValueVariable?: boolean;
10
+ readonly writeable?: boolean;
11
+ }
12
+ export interface LibDefinition {
13
+ libs: readonly LibDefinition[];
14
+ variables: readonly [string, ImplicitLibVariableOptions][];
15
+ }
16
+ /**
17
+ * An variable implicitly defined by the TS Lib
18
+ */
19
+ export declare class ImplicitLibVariable extends ESLintScopeVariable implements Variable {
20
+ /**
21
+ * `true` if the variable is valid in a type context, false otherwise
22
+ */
23
+ readonly isTypeVariable: boolean;
24
+ /**
25
+ * `true` if the variable is valid in a value context, false otherwise
26
+ */
27
+ readonly isValueVariable: boolean;
28
+ constructor(scope: Scope, name: string, { eslintImplicitGlobalSetting, isTypeVariable, isValueVariable, writeable, }: ImplicitLibVariableOptions);
29
+ }
@@ -0,0 +1,18 @@
1
+ // Vendored from @typescript-eslint/scope-manager@8.68.0 (MIT, Copyright JS Foundation and other contributors).
2
+ // Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
3
+ import { VariableBase } from './VariableBase';
4
+ /**
5
+ * A Variable represents a locally scoped identifier. These include arguments to functions.
6
+ */
7
+ export declare class Variable extends VariableBase {
8
+ /**
9
+ * `true` if the variable is valid in a type context, false otherwise
10
+ * @public
11
+ */
12
+ get isTypeVariable(): boolean;
13
+ /**
14
+ * `true` if the variable is valid in a value context, false otherwise
15
+ * @public
16
+ */
17
+ get isValueVariable(): boolean;
18
+ }