@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.
- package/package.json +1 -6
- package/src/aria-definitions.js +1 -1
- package/src/ast/ast-utils.d.ts +1 -1
- package/src/ast/module-binding.d.ts +1 -1
- package/src/ast/spellings.d.ts +1 -1
- package/src/ast/static-expression.d.ts +1 -1
- package/src/ast/type-syntax.d.ts +1 -1
- package/src/ast-node-types.d.ts +1 -1
- package/src/index.d.ts +6 -3
- package/src/resolver/dependency-analysis.d.ts +29 -0
- package/src/resolver/dependency-analysis.js +1 -1
- package/src/rule-creation/browser-escape-hatch-rule.d.ts +1 -1
- package/src/rule-creation/connection-config.d.ts +1 -1
- package/src/rule-creation/driver-origin.d.ts +1 -1
- package/src/rule-creation/generated-file.d.ts +1 -1
- package/src/rule-creation/hardcoded-credentials-rule.d.ts +9 -2
- package/src/rule-creation/mass-assignment-rule.d.ts +9 -2
- package/src/rule-creation/message-source.d.ts +1 -1
- package/src/rule-creation/minified-file.d.ts +1 -1
- package/src/rule-creation/mock-context.d.ts +1 -1
- package/src/rule-creation/module-evidence.d.ts +1 -1
- package/src/rule-creation/raw-identifier-rule.d.ts +9 -2
- package/src/rule-creation/request-source.d.ts +1 -1
- package/src/rule-creation/require-tls-rule.d.ts +8 -2
- package/src/rule-creation/rule-creator.d.ts +1 -1
- package/src/rule-creation/rule-creator.js +1 -1
- package/src/rule-creation/sdk-api-key-rule.d.ts +1 -1
- package/src/rule-creation/sdk-flow.d.ts +1 -1
- package/src/rule-creation/sql-injection-rule.d.ts +8 -2
- package/src/rule-creation/sql-position.d.ts +1 -1
- package/src/rule-creation/sql-safety.d.ts +1 -1
- package/src/rule-creation/system-prompt-injection-rule.d.ts +1 -1
- package/src/rule-creation/unscoped-mutation-rule.d.ts +9 -2
- package/src/rule-creation/value-follow.d.ts +1 -1
- package/src/security/security-utils.d.ts +1 -1
- package/src/types/estree/project-service/createProjectService.d.ts +67 -0
- package/src/types/estree/project-service/index.d.ts +3 -0
- package/src/types/estree/scope-manager/ScopeManager.d.ts +77 -0
- package/src/types/estree/scope-manager/analyze.d.ts +55 -0
- package/src/types/estree/scope-manager/definition/CatchClauseDefinition.d.ts +10 -0
- package/src/types/estree/scope-manager/definition/ClassNameDefinition.d.ts +10 -0
- package/src/types/estree/scope-manager/definition/Definition.d.ts +14 -0
- package/src/types/estree/scope-manager/definition/DefinitionBase.d.ts +35 -0
- package/src/types/estree/scope-manager/definition/DefinitionType.d.ts +15 -0
- package/src/types/estree/scope-manager/definition/FunctionNameDefinition.d.ts +10 -0
- package/src/types/estree/scope-manager/definition/ImplicitGlobalVariableDefinition.d.ts +10 -0
- package/src/types/estree/scope-manager/definition/ImportBindingDefinition.d.ts +11 -0
- package/src/types/estree/scope-manager/definition/ParameterDefinition.d.ts +14 -0
- package/src/types/estree/scope-manager/definition/TSEnumMemberDefinition.d.ts +10 -0
- package/src/types/estree/scope-manager/definition/TSEnumNameDefinition.d.ts +10 -0
- package/src/types/estree/scope-manager/definition/TSModuleNameDefinition.d.ts +10 -0
- package/src/types/estree/scope-manager/definition/TypeDefinition.d.ts +10 -0
- package/src/types/estree/scope-manager/definition/VariableDefinition.d.ts +10 -0
- package/src/types/estree/scope-manager/definition/index.d.ts +15 -0
- package/src/types/estree/scope-manager/index.d.ts +10 -0
- package/src/types/estree/scope-manager/referencer/PatternVisitor.d.ts +16 -0
- package/src/types/estree/scope-manager/referencer/Reference.d.ts +88 -0
- package/src/types/estree/scope-manager/referencer/Referencer.d.ts +28 -0
- package/src/types/estree/scope-manager/referencer/Visitor.d.ts +13 -0
- package/src/types/estree/scope-manager/referencer/VisitorBase.d.ts +22 -0
- package/src/types/estree/scope-manager/referencer/index.d.ts +3 -0
- package/src/types/estree/scope-manager/scope/BlockScope.d.ts +10 -0
- package/src/types/estree/scope-manager/scope/CatchScope.d.ts +10 -0
- package/src/types/estree/scope-manager/scope/ClassFieldInitializerScope.d.ts +10 -0
- package/src/types/estree/scope-manager/scope/ClassScope.d.ts +10 -0
- package/src/types/estree/scope-manager/scope/ClassStaticBlockScope.d.ts +10 -0
- package/src/types/estree/scope-manager/scope/ConditionalTypeScope.d.ts +10 -0
- package/src/types/estree/scope-manager/scope/ForScope.d.ts +10 -0
- package/src/types/estree/scope-manager/scope/FunctionExpressionNameScope.d.ts +11 -0
- package/src/types/estree/scope-manager/scope/FunctionScope.d.ts +12 -0
- package/src/types/estree/scope-manager/scope/FunctionTypeScope.d.ts +10 -0
- package/src/types/estree/scope-manager/scope/GlobalScope.d.ts +18 -0
- package/src/types/estree/scope-manager/scope/MappedTypeScope.d.ts +10 -0
- package/src/types/estree/scope-manager/scope/ModuleScope.d.ts +10 -0
- package/src/types/estree/scope-manager/scope/Scope.d.ts +21 -0
- package/src/types/estree/scope-manager/scope/ScopeBase.d.ts +91 -0
- package/src/types/estree/scope-manager/scope/ScopeType.d.ts +22 -0
- package/src/types/estree/scope-manager/scope/SwitchScope.d.ts +10 -0
- package/src/types/estree/scope-manager/scope/TSEnumScope.d.ts +10 -0
- package/src/types/estree/scope-manager/scope/TSModuleScope.d.ts +10 -0
- package/src/types/estree/scope-manager/scope/TypeScope.d.ts +10 -0
- package/src/types/estree/scope-manager/scope/WithScope.d.ts +11 -0
- package/src/types/estree/scope-manager/scope/index.d.ts +22 -0
- package/src/types/estree/scope-manager/variable/ESLintScopeVariable.d.ts +34 -0
- package/src/types/estree/scope-manager/variable/ImplicitLibVariable.d.ts +29 -0
- package/src/types/estree/scope-manager/variable/Variable.d.ts +18 -0
- package/src/types/estree/scope-manager/variable/VariableBase.d.ts +44 -0
- package/src/types/estree/scope-manager/variable/index.d.ts +8 -0
- package/src/types/estree/types/generated/ast-spec.d.ts +2215 -0
- package/src/types/estree/types/index.d.ts +6 -0
- package/src/types/estree/types/lib.d.ts +3 -0
- package/src/types/estree/types/parser-options.d.ts +83 -0
- package/src/types/estree/types/ts-estree.d.ts +190 -0
- package/src/types/estree/typescript-estree/clear-caches.d.ts +11 -0
- package/src/types/estree/typescript-estree/create-program/getScriptKind.d.ts +5 -0
- package/src/types/estree/typescript-estree/create-program/shared.d.ts +29 -0
- package/src/types/estree/typescript-estree/create-program/useProvidedPrograms.d.ts +13 -0
- package/src/types/estree/typescript-estree/getModifiers.d.ts +5 -0
- package/src/types/estree/typescript-estree/index.d.ts +16 -0
- package/src/types/estree/typescript-estree/node-utils.d.ts +191 -0
- package/src/types/estree/typescript-estree/parseSettings/ExpiringCache.d.ts +17 -0
- package/src/types/estree/typescript-estree/parseSettings/candidateTSConfigRootDirs.d.ts +5 -0
- package/src/types/estree/typescript-estree/parseSettings/index.d.ts +128 -0
- package/src/types/estree/typescript-estree/parser-options.d.ts +220 -0
- package/src/types/estree/typescript-estree/parser.d.ts +19 -0
- package/src/types/estree/typescript-estree/simple-traverse.d.ts +13 -0
- package/src/types/estree/typescript-estree/ts-estree/estree-to-ts-node-types.d.ts +180 -0
- package/src/types/estree/typescript-estree/ts-estree/index.d.ts +5 -0
- package/src/types/estree/typescript-estree/ts-estree/ts-nodes.d.ts +19 -0
- package/src/types/estree/typescript-estree/version-check.d.ts +6 -0
- package/src/types/estree/typescript-estree/version.d.ts +3 -0
- package/src/types/estree/typescript-estree/withoutProjectParserOptions.d.ts +11 -0
- package/src/types/estree/utils/ast-utils/eslint-utils/PatternMatcher.d.ts +49 -0
- package/src/types/estree/utils/ast-utils/eslint-utils/ReferenceTracker.d.ts +73 -0
- package/src/types/estree/utils/ast-utils/eslint-utils/astUtilities.d.ts +85 -0
- package/src/types/estree/utils/ast-utils/eslint-utils/index.d.ts +7 -0
- package/src/types/estree/utils/ast-utils/eslint-utils/predicates.d.ts +33 -0
- package/src/types/estree/utils/ast-utils/eslint-utils/scopeAnalysis.d.ts +18 -0
- package/src/types/estree/utils/ast-utils/helpers.d.ts +20 -0
- package/src/types/estree/utils/ast-utils/index.d.ts +6 -0
- package/src/types/estree/utils/ast-utils/misc.d.ts +12 -0
- package/src/types/estree/utils/ast-utils/predicates.d.ts +70 -0
- package/src/types/estree/utils/eslint-utils/InferTypesFromRule.d.ts +11 -0
- package/src/types/estree/utils/eslint-utils/RuleCreator.d.ts +34 -0
- package/src/types/estree/utils/eslint-utils/applyDefault.d.ts +10 -0
- package/src/types/estree/utils/eslint-utils/deepMerge.d.ts +16 -0
- package/src/types/estree/utils/eslint-utils/getParserServices.d.ts +24 -0
- package/src/types/estree/utils/eslint-utils/index.d.ts +8 -0
- package/src/types/estree/utils/eslint-utils/nullThrows.d.ts +14 -0
- package/src/types/estree/utils/index.d.ts +8 -0
- package/src/types/estree/utils/json-schema.d.ts +389 -0
- package/src/types/estree/utils/ts-eslint/AST.d.ts +10 -0
- package/src/types/estree/utils/ts-eslint/Config.d.ts +293 -0
- package/src/types/estree/utils/ts-eslint/ESLint.d.ts +9 -0
- package/src/types/estree/utils/ts-eslint/Linter.d.ts +257 -0
- package/src/types/estree/utils/ts-eslint/Parser.d.ts +96 -0
- package/src/types/estree/utils/ts-eslint/ParserOptions.d.ts +3 -0
- package/src/types/estree/utils/ts-eslint/Processor.d.ts +65 -0
- package/src/types/estree/utils/ts-eslint/Rule.d.ts +633 -0
- package/src/types/estree/utils/ts-eslint/RuleTester.d.ts +185 -0
- package/src/types/estree/utils/ts-eslint/Scope.d.ts +44 -0
- package/src/types/estree/utils/ts-eslint/SourceCode.d.ts +356 -0
- package/src/types/estree/utils/ts-eslint/eslint/ESLintShared.d.ts +383 -0
- package/src/types/estree/utils/ts-eslint/eslint/FlatESLint.d.ts +89 -0
- package/src/types/estree/utils/ts-eslint/eslint/LegacyESLint.d.ts +74 -0
- package/src/types/estree/utils/ts-eslint/index.d.ts +13 -0
- package/src/types/estree/utils/ts-estree.d.ts +5 -0
- package/src/types/estree/utils/ts-utils/NoInfer.d.ts +11 -0
- package/src/types/estree/utils/ts-utils/index.d.ts +4 -0
- package/src/types/estree/utils/ts-utils/isArray.d.ts +3 -0
- package/src/types/estree/visitor-keys/get-keys.d.ts +4 -0
- package/src/types/estree/visitor-keys/index.d.ts +4 -0
- package/src/types/estree/visitor-keys/visitor-keys.d.ts +4 -0
- package/src/types/meta-augmentation.d.ts +1 -1
- package/src/types/type-utils.d.ts +1 -1
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/types@8.68.0 (MIT, Copyright JS Foundation and other contributors).
|
|
2
|
+
// Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
|
|
3
|
+
export { AST_NODE_TYPES, AST_TOKEN_TYPES } from './generated/ast-spec';
|
|
4
|
+
export * from './lib';
|
|
5
|
+
export * from './parser-options';
|
|
6
|
+
export * from './ts-estree';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/types@8.68.0 (MIT, Copyright JS Foundation and other contributors).
|
|
2
|
+
// Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
|
|
3
|
+
export type Lib = 'decorators' | 'decorators.legacy' | 'dom' | 'dom.asynciterable' | 'dom.iterable' | 'es5' | 'es6' | 'es7' | 'es2015' | 'es2015.collection' | 'es2015.core' | 'es2015.generator' | 'es2015.iterable' | 'es2015.promise' | 'es2015.proxy' | 'es2015.reflect' | 'es2015.symbol' | 'es2015.symbol.wellknown' | 'es2016' | 'es2016.array.include' | 'es2016.full' | 'es2016.intl' | 'es2017' | 'es2017.arraybuffer' | 'es2017.date' | 'es2017.full' | 'es2017.intl' | 'es2017.object' | 'es2017.sharedmemory' | 'es2017.string' | 'es2017.typedarrays' | 'es2018' | 'es2018.asyncgenerator' | 'es2018.asynciterable' | 'es2018.full' | 'es2018.intl' | 'es2018.promise' | 'es2018.regexp' | 'es2019' | 'es2019.array' | 'es2019.full' | 'es2019.intl' | 'es2019.object' | 'es2019.string' | 'es2019.symbol' | 'es2020' | 'es2020.bigint' | 'es2020.date' | 'es2020.full' | 'es2020.intl' | 'es2020.number' | 'es2020.promise' | 'es2020.sharedmemory' | 'es2020.string' | 'es2020.symbol.wellknown' | 'es2021' | 'es2021.full' | 'es2021.intl' | 'es2021.promise' | 'es2021.string' | 'es2021.weakref' | 'es2022' | 'es2022.array' | 'es2022.error' | 'es2022.full' | 'es2022.intl' | 'es2022.object' | 'es2022.regexp' | 'es2022.string' | 'es2023' | 'es2023.array' | 'es2023.collection' | 'es2023.full' | 'es2023.intl' | 'es2024' | 'es2024.arraybuffer' | 'es2024.collection' | 'es2024.full' | 'es2024.object' | 'es2024.promise' | 'es2024.regexp' | 'es2024.sharedmemory' | 'es2024.string' | 'es2025' | 'es2025.collection' | 'es2025.float16' | 'es2025.full' | 'es2025.intl' | 'es2025.iterator' | 'es2025.promise' | 'es2025.regexp' | 'esnext' | 'esnext.array' | 'esnext.asynciterable' | 'esnext.bigint' | 'esnext.collection' | 'esnext.date' | 'esnext.decorators' | 'esnext.disposable' | 'esnext.error' | 'esnext.float16' | 'esnext.full' | 'esnext.intl' | 'esnext.iterator' | 'esnext.object' | 'esnext.promise' | 'esnext.regexp' | 'esnext.sharedmemory' | 'esnext.string' | 'esnext.symbol' | 'esnext.temporal' | 'esnext.typedarrays' | 'esnext.weakref' | 'lib' | 'scripthost' | 'webworker' | 'webworker.asynciterable' | 'webworker.importscripts' | 'webworker.iterable';
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/types@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 { Program } from 'typescript';
|
|
4
|
+
import type { Lib } from './lib';
|
|
5
|
+
export type DebugLevel = boolean | ('eslint' | 'typescript' | 'typescript-eslint')[];
|
|
6
|
+
export type CacheDurationSeconds = number | 'Infinity';
|
|
7
|
+
export type EcmaVersion = 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | 2025 | 2026 | 'latest' | undefined;
|
|
8
|
+
export type SourceTypeClassic = 'module' | 'script';
|
|
9
|
+
export type SourceType = 'commonjs' | SourceTypeClassic;
|
|
10
|
+
export type JSDocParsingMode = 'all' | 'none' | 'type-info';
|
|
11
|
+
/**
|
|
12
|
+
* Granular options to configure the project service.
|
|
13
|
+
*/
|
|
14
|
+
export interface ProjectServiceOptions {
|
|
15
|
+
/**
|
|
16
|
+
* Globs of files to allow running with the default project compiler options
|
|
17
|
+
* despite not being matched by the project service.
|
|
18
|
+
*/
|
|
19
|
+
allowDefaultProject?: string[];
|
|
20
|
+
/**
|
|
21
|
+
* Path to a TSConfig to use instead of TypeScript's default project configuration.
|
|
22
|
+
* @default 'tsconfig.json'
|
|
23
|
+
*/
|
|
24
|
+
defaultProject?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Whether to allow TypeScript plugins as configured in the TSConfig.
|
|
27
|
+
*/
|
|
28
|
+
loadTypeScriptPlugins?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* The maximum number of files {@link allowDefaultProject} may match.
|
|
31
|
+
* Each file match slows down linting, so if you do need to use this, please
|
|
32
|
+
* file an informative issue on typescript-eslint explaining why - so we can
|
|
33
|
+
* help you avoid using it!
|
|
34
|
+
* @default 8
|
|
35
|
+
*/
|
|
36
|
+
maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING?: number;
|
|
37
|
+
}
|
|
38
|
+
export interface ParserOptions {
|
|
39
|
+
[additionalProperties: string]: unknown;
|
|
40
|
+
cacheLifetime?: {
|
|
41
|
+
glob?: CacheDurationSeconds;
|
|
42
|
+
};
|
|
43
|
+
debugLevel?: DebugLevel;
|
|
44
|
+
ecmaFeatures?: {
|
|
45
|
+
[key: string]: unknown;
|
|
46
|
+
globalReturn?: boolean | undefined;
|
|
47
|
+
jsx?: boolean | undefined;
|
|
48
|
+
} | undefined;
|
|
49
|
+
ecmaVersion?: EcmaVersion;
|
|
50
|
+
emitDecoratorMetadata?: boolean;
|
|
51
|
+
errorOnTypeScriptSyntacticAndSemanticIssues?: boolean;
|
|
52
|
+
errorOnUnknownASTType?: boolean;
|
|
53
|
+
experimentalDecorators?: boolean;
|
|
54
|
+
extraFileExtensions?: string[];
|
|
55
|
+
filePath?: string;
|
|
56
|
+
isolatedDeclarations?: boolean;
|
|
57
|
+
jsDocParsingMode?: JSDocParsingMode;
|
|
58
|
+
jsxFragmentName?: string | null;
|
|
59
|
+
jsxPragma?: string | null;
|
|
60
|
+
lib?: Lib[];
|
|
61
|
+
programs?: Program[] | null;
|
|
62
|
+
project?: boolean | string | string[] | null;
|
|
63
|
+
projectFolderIgnoreList?: string[];
|
|
64
|
+
projectService?: boolean | ProjectServiceOptions;
|
|
65
|
+
range?: boolean;
|
|
66
|
+
sourceType?: SourceType | undefined;
|
|
67
|
+
tokens?: boolean;
|
|
68
|
+
tsconfigRootDir?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Controls how the parser reacts when run with a TypeScript version that is
|
|
71
|
+
* not officially supported by typescript-eslint.
|
|
72
|
+
* - `'warn'` (default): log a warning to the console.
|
|
73
|
+
* - `'error'`: throw, causing the lint run to fail. Useful in CI to prevent
|
|
74
|
+
* unsupported TypeScript versions from being merged unnoticed.
|
|
75
|
+
* - `'ignore'`: do nothing.
|
|
76
|
+
*/
|
|
77
|
+
onUnsupportedTypeScriptVersion?: 'error' | 'ignore' | 'warn';
|
|
78
|
+
/**
|
|
79
|
+
* @deprecated Use {@link onUnsupportedTypeScriptVersion} instead.
|
|
80
|
+
* `true` is equivalent to `'warn'` and `false` is equivalent to `'ignore'`.
|
|
81
|
+
*/
|
|
82
|
+
warnOnUnsupportedTypeScriptVersion?: boolean;
|
|
83
|
+
}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/types@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 * as TSESTree from './generated/ast-spec';
|
|
4
|
+
declare module './generated/ast-spec' {
|
|
5
|
+
interface BaseNode {
|
|
6
|
+
parent: TSESTree.Node;
|
|
7
|
+
}
|
|
8
|
+
interface Program {
|
|
9
|
+
/**
|
|
10
|
+
* @remarks This never-used property exists only as a convenience for code that tries to access node parents repeatedly.
|
|
11
|
+
*/
|
|
12
|
+
parent?: never;
|
|
13
|
+
}
|
|
14
|
+
interface AccessorPropertyComputedName {
|
|
15
|
+
parent: TSESTree.ClassBody;
|
|
16
|
+
}
|
|
17
|
+
interface AccessorPropertyNonComputedName {
|
|
18
|
+
parent: TSESTree.ClassBody;
|
|
19
|
+
}
|
|
20
|
+
interface TSAbstractAccessorPropertyComputedName {
|
|
21
|
+
parent: TSESTree.ClassBody;
|
|
22
|
+
}
|
|
23
|
+
interface TSAbstractAccessorPropertyNonComputedName {
|
|
24
|
+
parent: TSESTree.ClassBody;
|
|
25
|
+
}
|
|
26
|
+
interface VariableDeclaratorDefiniteAssignment {
|
|
27
|
+
parent: TSESTree.VariableDeclaration;
|
|
28
|
+
}
|
|
29
|
+
interface VariableDeclaratorMaybeInit {
|
|
30
|
+
parent: TSESTree.VariableDeclaration;
|
|
31
|
+
}
|
|
32
|
+
interface VariableDeclaratorNoInit {
|
|
33
|
+
parent: TSESTree.VariableDeclaration;
|
|
34
|
+
}
|
|
35
|
+
interface UsingInForOfDeclarator {
|
|
36
|
+
parent: TSESTree.VariableDeclaration;
|
|
37
|
+
}
|
|
38
|
+
interface UsingInNormalContextDeclarator {
|
|
39
|
+
parent: TSESTree.VariableDeclaration;
|
|
40
|
+
}
|
|
41
|
+
interface CatchClause {
|
|
42
|
+
parent: TSESTree.TryStatement;
|
|
43
|
+
}
|
|
44
|
+
interface ClassBody {
|
|
45
|
+
parent: TSESTree.ClassDeclaration | TSESTree.ClassExpression;
|
|
46
|
+
}
|
|
47
|
+
interface ImportAttribute {
|
|
48
|
+
parent: TSESTree.ExportAllDeclaration | TSESTree.ExportNamedDeclaration | TSESTree.ImportDeclaration | TSESTree.TSImportType;
|
|
49
|
+
}
|
|
50
|
+
interface ImportDefaultSpecifier {
|
|
51
|
+
parent: TSESTree.ImportDeclaration;
|
|
52
|
+
}
|
|
53
|
+
interface ImportNamespaceSpecifier {
|
|
54
|
+
parent: TSESTree.ImportDeclaration;
|
|
55
|
+
}
|
|
56
|
+
interface ImportSpecifier {
|
|
57
|
+
parent: TSESTree.ExportAllDeclaration | TSESTree.ExportNamedDeclaration | TSESTree.ImportDeclaration;
|
|
58
|
+
}
|
|
59
|
+
interface ExportDefaultDeclaration {
|
|
60
|
+
parent: TSESTree.BlockStatement | TSESTree.Program | TSESTree.TSModuleBlock;
|
|
61
|
+
}
|
|
62
|
+
interface ExportNamedDeclarationWithoutSourceWithMultiple {
|
|
63
|
+
parent: TSESTree.BlockStatement | TSESTree.Program | TSESTree.TSModuleBlock;
|
|
64
|
+
}
|
|
65
|
+
interface ExportNamedDeclarationWithoutSourceWithSingle {
|
|
66
|
+
parent: TSESTree.BlockStatement | TSESTree.Program | TSESTree.TSModuleBlock;
|
|
67
|
+
}
|
|
68
|
+
interface ExportNamedDeclarationWithSource {
|
|
69
|
+
parent: TSESTree.BlockStatement | TSESTree.Program | TSESTree.TSModuleBlock;
|
|
70
|
+
}
|
|
71
|
+
interface FunctionDeclarationWithName {
|
|
72
|
+
parent: TSESTree.BlockStatement | TSESTree.ExportDefaultDeclaration | TSESTree.ExportNamedDeclaration | TSESTree.Program;
|
|
73
|
+
}
|
|
74
|
+
interface FunctionDeclarationWithOptionalName {
|
|
75
|
+
parent: TSESTree.ExportDefaultDeclaration;
|
|
76
|
+
}
|
|
77
|
+
interface JSXAttribute {
|
|
78
|
+
parent: TSESTree.JSXOpeningElement;
|
|
79
|
+
}
|
|
80
|
+
interface JSXClosingElement {
|
|
81
|
+
parent: TSESTree.JSXElement;
|
|
82
|
+
}
|
|
83
|
+
interface JSXClosingFragment {
|
|
84
|
+
parent: TSESTree.JSXFragment;
|
|
85
|
+
}
|
|
86
|
+
interface JSXOpeningElement {
|
|
87
|
+
parent: TSESTree.JSXElement;
|
|
88
|
+
}
|
|
89
|
+
interface JSXOpeningFragment {
|
|
90
|
+
parent: TSESTree.JSXFragment;
|
|
91
|
+
}
|
|
92
|
+
interface JSXSpreadAttribute {
|
|
93
|
+
parent: TSESTree.JSXOpeningElement;
|
|
94
|
+
}
|
|
95
|
+
interface MethodDefinitionComputedName {
|
|
96
|
+
parent: TSESTree.ClassBody;
|
|
97
|
+
}
|
|
98
|
+
interface MethodDefinitionNonComputedName {
|
|
99
|
+
parent: TSESTree.ClassBody;
|
|
100
|
+
}
|
|
101
|
+
interface TSAbstractMethodDefinitionComputedName {
|
|
102
|
+
parent: TSESTree.ClassBody;
|
|
103
|
+
}
|
|
104
|
+
interface TSAbstractMethodDefinitionNonComputedName {
|
|
105
|
+
parent: TSESTree.ClassBody;
|
|
106
|
+
}
|
|
107
|
+
interface PropertyComputedName {
|
|
108
|
+
parent: TSESTree.ObjectExpression | TSESTree.ObjectPattern;
|
|
109
|
+
}
|
|
110
|
+
interface PropertyNonComputedName {
|
|
111
|
+
parent: TSESTree.ObjectExpression | TSESTree.ObjectPattern;
|
|
112
|
+
}
|
|
113
|
+
interface PropertyDefinitionComputedName {
|
|
114
|
+
parent: TSESTree.ClassBody;
|
|
115
|
+
}
|
|
116
|
+
interface PropertyDefinitionNonComputedName {
|
|
117
|
+
parent: TSESTree.ClassBody;
|
|
118
|
+
}
|
|
119
|
+
interface TSAbstractPropertyDefinitionComputedName {
|
|
120
|
+
parent: TSESTree.ClassBody;
|
|
121
|
+
}
|
|
122
|
+
interface TSAbstractPropertyDefinitionNonComputedName {
|
|
123
|
+
parent: TSESTree.ClassBody;
|
|
124
|
+
}
|
|
125
|
+
interface SpreadElement {
|
|
126
|
+
parent: TSESTree.ArrayExpression | TSESTree.CallExpression | TSESTree.NewExpression | TSESTree.ObjectExpression;
|
|
127
|
+
}
|
|
128
|
+
interface StaticBlock {
|
|
129
|
+
parent: TSESTree.ClassBody;
|
|
130
|
+
}
|
|
131
|
+
interface SwitchCase {
|
|
132
|
+
parent: TSESTree.SwitchStatement;
|
|
133
|
+
}
|
|
134
|
+
interface TemplateElement {
|
|
135
|
+
parent: TSESTree.TemplateLiteral | TSESTree.TSTemplateLiteralType;
|
|
136
|
+
}
|
|
137
|
+
interface TSCallSignatureDeclaration {
|
|
138
|
+
parent: TSESTree.TSInterfaceBody | TSESTree.TSTypeLiteral;
|
|
139
|
+
}
|
|
140
|
+
interface TSConstructSignatureDeclaration {
|
|
141
|
+
parent: TSESTree.TSInterfaceBody | TSESTree.TSTypeLiteral;
|
|
142
|
+
}
|
|
143
|
+
interface TSClassImplements {
|
|
144
|
+
parent: TSESTree.ClassDeclaration | TSESTree.ClassExpression;
|
|
145
|
+
}
|
|
146
|
+
interface TSEnumBody {
|
|
147
|
+
parent: TSESTree.TSEnumDeclaration;
|
|
148
|
+
}
|
|
149
|
+
interface TSEnumMember {
|
|
150
|
+
parent: TSESTree.TSEnumBody;
|
|
151
|
+
}
|
|
152
|
+
interface TSIndexSignature {
|
|
153
|
+
parent: TSESTree.ClassBody | TSESTree.TSInterfaceBody | TSESTree.TSTypeLiteral;
|
|
154
|
+
}
|
|
155
|
+
interface TSInterfaceBody {
|
|
156
|
+
parent: TSESTree.TSInterfaceDeclaration;
|
|
157
|
+
}
|
|
158
|
+
interface TSInterfaceHeritage {
|
|
159
|
+
parent: TSESTree.TSInterfaceBody;
|
|
160
|
+
}
|
|
161
|
+
interface TSMethodSignatureComputedName {
|
|
162
|
+
parent: TSESTree.TSInterfaceBody | TSESTree.TSTypeLiteral;
|
|
163
|
+
}
|
|
164
|
+
interface TSMethodSignatureNonComputedName {
|
|
165
|
+
parent: TSESTree.TSInterfaceBody | TSESTree.TSTypeLiteral;
|
|
166
|
+
}
|
|
167
|
+
interface TSModuleBlock {
|
|
168
|
+
parent: TSESTree.TSModuleDeclaration;
|
|
169
|
+
}
|
|
170
|
+
interface TSParameterProperty {
|
|
171
|
+
parent: TSESTree.FunctionLike;
|
|
172
|
+
}
|
|
173
|
+
interface TSPropertySignatureComputedName {
|
|
174
|
+
parent: TSESTree.TSInterfaceBody | TSESTree.TSTypeLiteral;
|
|
175
|
+
}
|
|
176
|
+
interface TSPropertySignatureNonComputedName {
|
|
177
|
+
parent: TSESTree.TSInterfaceBody | TSESTree.TSTypeLiteral;
|
|
178
|
+
}
|
|
179
|
+
interface TSTypeParameter {
|
|
180
|
+
parent: TSESTree.TSInferType | TSESTree.TSMappedType | TSESTree.TSTypeParameterDeclaration;
|
|
181
|
+
}
|
|
182
|
+
interface ExportSpecifierWithIdentifierLocal {
|
|
183
|
+
parent: TSESTree.ExportNamedDeclaration;
|
|
184
|
+
}
|
|
185
|
+
interface ExportSpecifierWithStringOrLiteralLocal {
|
|
186
|
+
parent: TSESTree.ExportNamedDeclaration;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
export * as TSESTree from './generated/ast-spec';
|
|
190
|
+
export type NodeWithParent = Exclude<TSESTree.Node, TSESTree.Program>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/typescript-estree@8.68.0 (MIT, Copyright JS Foundation and other contributors).
|
|
2
|
+
// Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
|
|
3
|
+
/**
|
|
4
|
+
* Clears all of the internal caches.
|
|
5
|
+
* Generally you shouldn't need or want to use this.
|
|
6
|
+
* Examples of intended uses:
|
|
7
|
+
* - In tests to reset parser state to keep tests isolated.
|
|
8
|
+
* - In custom lint tooling that iteratively lints one project at a time to prevent OOMs.
|
|
9
|
+
*/
|
|
10
|
+
export declare function clearCaches(): void;
|
|
11
|
+
export declare const clearProgramCache: typeof clearCaches;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/typescript-estree@8.68.0 (MIT, Copyright JS Foundation and other contributors).
|
|
2
|
+
// Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
|
|
3
|
+
import * as ts from 'typescript';
|
|
4
|
+
export declare function getScriptKind(filePath: string, jsx: boolean): ts.ScriptKind;
|
|
5
|
+
export declare function getLanguageVariant(scriptKind: ts.ScriptKind): ts.LanguageVariant;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/typescript-estree@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 { Program } from 'typescript';
|
|
4
|
+
import * as ts from 'typescript';
|
|
5
|
+
import type { ParseSettings } from '../parseSettings';
|
|
6
|
+
export interface ASTAndNoProgram {
|
|
7
|
+
ast: ts.SourceFile;
|
|
8
|
+
program: null;
|
|
9
|
+
}
|
|
10
|
+
export interface ASTAndDefiniteProgram {
|
|
11
|
+
ast: ts.SourceFile;
|
|
12
|
+
program: ts.Program;
|
|
13
|
+
}
|
|
14
|
+
export type ASTAndProgram = ASTAndDefiniteProgram | ASTAndNoProgram;
|
|
15
|
+
export declare const DEFAULT_EXTRA_FILE_EXTENSIONS: Set<string>;
|
|
16
|
+
export declare function createDefaultCompilerOptionsFromExtra(parseSettings: ParseSettings): ts.CompilerOptions;
|
|
17
|
+
export type CanonicalPath = {
|
|
18
|
+
__brand: unknown;
|
|
19
|
+
} & string;
|
|
20
|
+
export declare function getCanonicalFileName(filePath: string): CanonicalPath;
|
|
21
|
+
export declare function ensureAbsolutePath(p: string, tsconfigRootDir: string): string;
|
|
22
|
+
export declare function canonicalDirname(p: CanonicalPath): CanonicalPath;
|
|
23
|
+
export declare function getAstFromProgram(currentProgram: Program, filePath: string): ASTAndDefiniteProgram | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Hash content for compare content.
|
|
26
|
+
* @param content hashed contend
|
|
27
|
+
* @returns hashed result
|
|
28
|
+
*/
|
|
29
|
+
export declare function createHash(content: string): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/typescript-estree@8.68.0 (MIT, Copyright JS Foundation and other contributors).
|
|
2
|
+
// Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
|
|
3
|
+
import * as ts from 'typescript';
|
|
4
|
+
import type { ParseSettings } from '../parseSettings';
|
|
5
|
+
import type { ASTAndDefiniteProgram } from './shared';
|
|
6
|
+
export declare function useProvidedPrograms(programInstances: Iterable<ts.Program>, parseSettings: ParseSettings): ASTAndDefiniteProgram;
|
|
7
|
+
/**
|
|
8
|
+
* Utility offered by parser to help consumers construct their own program instance.
|
|
9
|
+
*
|
|
10
|
+
* @param configFile the path to the tsconfig.json file, relative to `projectDirectory`
|
|
11
|
+
* @param projectDirectory the project directory to use as the CWD, defaults to `process.cwd()`
|
|
12
|
+
*/
|
|
13
|
+
export declare function createProgramFromConfigFile(configFile: string, projectDirectory?: string): ts.Program;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/typescript-estree@8.68.0 (MIT, Copyright JS Foundation and other contributors).
|
|
2
|
+
// Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
|
|
3
|
+
import * as ts from 'typescript';
|
|
4
|
+
export declare function getModifiers(node: ts.Node | null | undefined, includeIllegalModifiers?: boolean): ts.Modifier[] | undefined;
|
|
5
|
+
export declare function getDecorators(node: ts.Node | null | undefined, includeIllegalDecorators?: boolean): ts.Decorator[] | undefined;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/typescript-estree@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 './clear-caches';
|
|
4
|
+
export * from './create-program/getScriptKind';
|
|
5
|
+
export { getCanonicalFileName } from './create-program/shared';
|
|
6
|
+
export { createProgramFromConfigFile as createProgram } from './create-program/useProvidedPrograms';
|
|
7
|
+
export * from './getModifiers';
|
|
8
|
+
export { TSError } from './node-utils';
|
|
9
|
+
export { type AST, parse, parseAndGenerateServices, type ParseAndGenerateServicesResult, } from './parser';
|
|
10
|
+
export type { ParserServices, ParserServicesWithoutTypeInformation, ParserServicesWithTypeInformation, TSESTreeOptions, } from './parser-options';
|
|
11
|
+
export { addCandidateTSConfigRootDir, clearCandidateTSConfigRootDirs, } from './parseSettings/candidateTSConfigRootDirs';
|
|
12
|
+
export { simpleTraverse } from './simple-traverse';
|
|
13
|
+
export * from './ts-estree';
|
|
14
|
+
export { typescriptVersionIsAtLeast } from './version-check';
|
|
15
|
+
export { version } from './version';
|
|
16
|
+
export { withoutProjectParserOptions } from './withoutProjectParserOptions';
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/typescript-estree@8.68.0 (MIT, Copyright JS Foundation and other contributors).
|
|
2
|
+
// Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
|
|
3
|
+
import * as ts from 'typescript';
|
|
4
|
+
import type { TSESTree } from './ts-estree';
|
|
5
|
+
import { AST_NODE_TYPES, AST_TOKEN_TYPES } from './ts-estree';
|
|
6
|
+
declare const SyntaxKind: typeof ts.SyntaxKind;
|
|
7
|
+
type LogicalOperatorKind = ts.SyntaxKind.AmpersandAmpersandToken | ts.SyntaxKind.BarBarToken | ts.SyntaxKind.QuestionQuestionToken;
|
|
8
|
+
interface TokenToText extends TSESTree.PunctuatorTokenToText, TSESTree.BinaryOperatorToText {
|
|
9
|
+
[SyntaxKind.ImportKeyword]: 'import';
|
|
10
|
+
[SyntaxKind.KeyOfKeyword]: 'keyof';
|
|
11
|
+
[SyntaxKind.NewKeyword]: 'new';
|
|
12
|
+
[SyntaxKind.ReadonlyKeyword]: 'readonly';
|
|
13
|
+
[SyntaxKind.UniqueKeyword]: 'unique';
|
|
14
|
+
}
|
|
15
|
+
type AssignmentOperatorKind = keyof TSESTree.AssignmentOperatorToText;
|
|
16
|
+
type BinaryOperatorKind = keyof TSESTree.BinaryOperatorToText;
|
|
17
|
+
type DeclarationKind = TSESTree.VariableDeclaration['kind'];
|
|
18
|
+
/**
|
|
19
|
+
* Returns true if the given ts.Token is a logical operator
|
|
20
|
+
*/
|
|
21
|
+
export declare function isLogicalOperator(operator: ts.BinaryOperatorToken): operator is ts.Token<LogicalOperatorKind>;
|
|
22
|
+
export declare function isESTreeBinaryOperator(operator: ts.BinaryOperatorToken): operator is ts.Token<BinaryOperatorKind>;
|
|
23
|
+
type TokenForTokenKind<T extends ts.SyntaxKind> = T extends keyof TokenToText ? TokenToText[T] : string | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Returns the string form of the given TSToken SyntaxKind
|
|
26
|
+
*/
|
|
27
|
+
export declare function getTextForTokenKind<T extends ts.SyntaxKind>(kind: T): TokenForTokenKind<T>;
|
|
28
|
+
/**
|
|
29
|
+
* Returns true if the given ts.Node is a valid ESTree class member
|
|
30
|
+
*/
|
|
31
|
+
export declare function isESTreeClassMember(node: ts.Node): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Checks if a ts.Node has a modifier
|
|
34
|
+
*/
|
|
35
|
+
export declare function hasModifier(modifierKind: ts.KeywordSyntaxKind, node: ts.Node): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Get last last modifier in ast
|
|
38
|
+
* @returns returns last modifier if present or null
|
|
39
|
+
*/
|
|
40
|
+
export declare function getLastModifier(node: ts.Node): ts.Modifier | null;
|
|
41
|
+
/**
|
|
42
|
+
* Returns true if the given ts.Token is a comma
|
|
43
|
+
*/
|
|
44
|
+
export declare function isComma(token: ts.Node): token is ts.Token<ts.SyntaxKind.CommaToken>;
|
|
45
|
+
/**
|
|
46
|
+
* Returns true if the given ts.Node is a comment
|
|
47
|
+
*/
|
|
48
|
+
export declare function isComment(node: ts.Node): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Returns the binary expression type of the given ts.Token
|
|
51
|
+
*/
|
|
52
|
+
export declare function getBinaryExpressionType(operator: ts.BinaryOperatorToken): {
|
|
53
|
+
operator: TokenForTokenKind<AssignmentOperatorKind>;
|
|
54
|
+
type: AST_NODE_TYPES.AssignmentExpression;
|
|
55
|
+
} | {
|
|
56
|
+
operator: TokenForTokenKind<BinaryOperatorKind>;
|
|
57
|
+
type: AST_NODE_TYPES.BinaryExpression;
|
|
58
|
+
} | {
|
|
59
|
+
operator: TokenForTokenKind<LogicalOperatorKind>;
|
|
60
|
+
type: AST_NODE_TYPES.LogicalExpression;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Returns line and column data for the given positions
|
|
64
|
+
*/
|
|
65
|
+
export declare function getLineAndCharacterFor(pos: number, ast: ts.SourceFile): TSESTree.Position;
|
|
66
|
+
/**
|
|
67
|
+
* Returns line and column data for the given start and end positions,
|
|
68
|
+
* for the given AST
|
|
69
|
+
*/
|
|
70
|
+
export declare function getLocFor(range: TSESTree.Range, ast: ts.SourceFile): TSESTree.SourceLocation;
|
|
71
|
+
/**
|
|
72
|
+
* Check whatever node can contain directive
|
|
73
|
+
*/
|
|
74
|
+
export declare function canContainDirective(node: ts.Block | ts.ClassStaticBlockDeclaration | ts.ModuleBlock | ts.SourceFile): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Returns range for the given ts.Node
|
|
77
|
+
*/
|
|
78
|
+
export declare function getRange(node: Pick<ts.Node, 'getEnd' | 'getStart'>, ast: ts.SourceFile): [number, number];
|
|
79
|
+
/**
|
|
80
|
+
* Returns true if a given ts.Node is a JSX token
|
|
81
|
+
*/
|
|
82
|
+
export declare function isJSXToken(node: ts.Node): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Returns the declaration kind of the given ts.Node
|
|
85
|
+
*/
|
|
86
|
+
export declare function getDeclarationKind(node: ts.VariableDeclarationList): DeclarationKind;
|
|
87
|
+
/**
|
|
88
|
+
* Gets a ts.Node's accessibility level
|
|
89
|
+
*/
|
|
90
|
+
export declare function getTSNodeAccessibility(node: ts.Node): 'private' | 'protected' | 'public' | undefined;
|
|
91
|
+
/**
|
|
92
|
+
* Finds the next token based on the previous one and its parent
|
|
93
|
+
* Had to copy this from TS instead of using TS's version because theirs doesn't pass the ast to getChildren
|
|
94
|
+
*/
|
|
95
|
+
export declare function findNextToken(previousToken: ts.TextRange, parent: ts.Node, ast: ts.SourceFile): ts.Node | undefined;
|
|
96
|
+
/**
|
|
97
|
+
* Find the first matching ancestor based on the given predicate function.
|
|
98
|
+
* @param node The current ts.Node
|
|
99
|
+
* @param predicate The predicate function to apply to each checked ancestor
|
|
100
|
+
* @returns a matching parent ts.Node
|
|
101
|
+
*/
|
|
102
|
+
export declare function findFirstMatchingAncestor(node: ts.Node, predicate: (node: ts.Node) => boolean): ts.Node | undefined;
|
|
103
|
+
/**
|
|
104
|
+
* Returns true if a given ts.Node has a JSX token within its hierarchy
|
|
105
|
+
*/
|
|
106
|
+
export declare function hasJSXAncestor(node: ts.Node): boolean;
|
|
107
|
+
/**
|
|
108
|
+
* Unescape the text content of string literals, e.g. & -> &
|
|
109
|
+
* @param text The escaped string literal text.
|
|
110
|
+
* @returns The unescaped string literal text.
|
|
111
|
+
*/
|
|
112
|
+
export declare function unescapeStringLiteralText(text: string): string;
|
|
113
|
+
/**
|
|
114
|
+
* Returns true if a given ts.Node is a computed property
|
|
115
|
+
*/
|
|
116
|
+
export declare function isComputedProperty(node: ts.Node): node is ts.ComputedPropertyName;
|
|
117
|
+
/**
|
|
118
|
+
* Returns true if a given ts.Node is optional (has QuestionToken)
|
|
119
|
+
* @param node ts.Node to be checked
|
|
120
|
+
*/
|
|
121
|
+
export declare function isOptional(node: {
|
|
122
|
+
questionToken?: ts.QuestionToken;
|
|
123
|
+
}): boolean;
|
|
124
|
+
/**
|
|
125
|
+
* Returns true if the node is an optional chain node
|
|
126
|
+
*/
|
|
127
|
+
export declare function isChainExpression(node: TSESTree.Node): node is TSESTree.ChainExpression;
|
|
128
|
+
/**
|
|
129
|
+
* Returns true of the child of property access expression is an optional chain
|
|
130
|
+
*/
|
|
131
|
+
export declare function isChildUnwrappableOptionalChain(node: ts.CallExpression | ts.ElementAccessExpression | ts.NonNullExpression | ts.PropertyAccessExpression, child: TSESTree.Node): boolean;
|
|
132
|
+
/**
|
|
133
|
+
* Returns the type of a given ts.Token
|
|
134
|
+
*/
|
|
135
|
+
export declare function getTokenType(token: ts.Identifier | ts.Token<ts.SyntaxKind>): Exclude<AST_TOKEN_TYPES, AST_TOKEN_TYPES.Block | AST_TOKEN_TYPES.Line>;
|
|
136
|
+
/**
|
|
137
|
+
* Extends and formats a given ts.Token, for a given AST
|
|
138
|
+
*/
|
|
139
|
+
export declare function convertToken(token: ts.Token<ts.TokenSyntaxKind>, ast: ts.SourceFile): TSESTree.Token;
|
|
140
|
+
/**
|
|
141
|
+
* Converts all tokens for the given AST
|
|
142
|
+
* @param ast the AST object
|
|
143
|
+
* @returns the converted Tokens
|
|
144
|
+
*/
|
|
145
|
+
export declare function convertTokens(ast: ts.SourceFile): TSESTree.Token[];
|
|
146
|
+
export declare class TSError extends Error {
|
|
147
|
+
readonly fileName: string;
|
|
148
|
+
readonly location: {
|
|
149
|
+
end: {
|
|
150
|
+
column: number;
|
|
151
|
+
line: number;
|
|
152
|
+
offset: number;
|
|
153
|
+
};
|
|
154
|
+
start: {
|
|
155
|
+
column: number;
|
|
156
|
+
line: number;
|
|
157
|
+
offset: number;
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
name: string;
|
|
161
|
+
constructor(message: string, fileName: string, location: {
|
|
162
|
+
end: {
|
|
163
|
+
column: number;
|
|
164
|
+
line: number;
|
|
165
|
+
offset: number;
|
|
166
|
+
};
|
|
167
|
+
start: {
|
|
168
|
+
column: number;
|
|
169
|
+
line: number;
|
|
170
|
+
offset: number;
|
|
171
|
+
};
|
|
172
|
+
});
|
|
173
|
+
get index(): number;
|
|
174
|
+
get lineNumber(): number;
|
|
175
|
+
get column(): number;
|
|
176
|
+
}
|
|
177
|
+
export declare function createError(node: ts.Node, message: string): TSError;
|
|
178
|
+
export declare function createError(node: number | ts.Node | TSESTree.Range, message: string, sourceFile: ts.SourceFile): TSError;
|
|
179
|
+
export declare function nodeHasTokens(n: ts.Node, ast: ts.SourceFile): boolean;
|
|
180
|
+
/**
|
|
181
|
+
* Like `forEach`, but suitable for use with numbers and strings (which may be falsy).
|
|
182
|
+
*/
|
|
183
|
+
export declare function firstDefined<T, U>(array: readonly T[] | undefined, callback: (element: T, index: number) => U | undefined): U | undefined;
|
|
184
|
+
export declare function identifierIsThisKeyword(id: ts.Identifier): boolean;
|
|
185
|
+
export declare function isThisIdentifier(node: ts.Node | undefined): node is ts.Identifier;
|
|
186
|
+
export declare function isThisInTypeQuery(node: ts.Node): boolean;
|
|
187
|
+
export declare function isValidAssignmentTarget(node: ts.Node): boolean;
|
|
188
|
+
export declare function getNamespaceModifiers(node: ts.ModuleDeclaration): ts.Modifier[] | undefined;
|
|
189
|
+
export declare function declarationNameToString(node: ts.Node): string;
|
|
190
|
+
export declare function isEntityNameExpression(node: ts.Node): node is ts.EntityNameExpression;
|
|
191
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/typescript-estree@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 { CacheDurationSeconds } from '../../types/index';
|
|
4
|
+
export declare const DEFAULT_TSCONFIG_CACHE_DURATION_SECONDS = 30;
|
|
5
|
+
export interface CacheLike<Key, Value> {
|
|
6
|
+
get(key: Key): Value | undefined;
|
|
7
|
+
set(key: Key, value: Value): this;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A map with key-level expiration.
|
|
11
|
+
*/
|
|
12
|
+
export declare class ExpiringCache<Key, Value> implements CacheLike<Key, Value> {
|
|
13
|
+
constructor(cacheDurationSeconds: CacheDurationSeconds);
|
|
14
|
+
clear(): void;
|
|
15
|
+
get(key: Key): Value | undefined;
|
|
16
|
+
set(key: Key, value: Value): this;
|
|
17
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/typescript-estree@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 function addCandidateTSConfigRootDir(candidate: string): void;
|
|
4
|
+
export declare function clearCandidateTSConfigRootDirs(): void;
|
|
5
|
+
export declare function getInferredTSConfigRootDir(): string;
|