@typescript-eslint/typescript-estree 6.0.0 → 7.0.0-alpha.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 (37) hide show
  1. package/package.json +3 -3
  2. package/_ts4.3/dist/ast-converter.d.ts +0 -9
  3. package/_ts4.3/dist/clear-caches.d.ts +0 -10
  4. package/_ts4.3/dist/convert-comments.d.ts +0 -11
  5. package/_ts4.3/dist/convert.d.ts +0 -142
  6. package/_ts4.3/dist/create-program/WatchCompilerHostOfConfigFile.d.ts +0 -13
  7. package/_ts4.3/dist/create-program/createDefaultProgram.d.ts +0 -12
  8. package/_ts4.3/dist/create-program/createIsolatedProgram.d.ts +0 -9
  9. package/_ts4.3/dist/create-program/createProjectProgram.d.ts +0 -9
  10. package/_ts4.3/dist/create-program/createSourceFile.d.ts +0 -7
  11. package/_ts4.3/dist/create-program/describeFilePath.d.ts +0 -2
  12. package/_ts4.3/dist/create-program/getScriptKind.d.ts +0 -5
  13. package/_ts4.3/dist/create-program/getWatchProgramsForProjects.d.ts +0 -15
  14. package/_ts4.3/dist/create-program/shared.d.ts +0 -32
  15. package/_ts4.3/dist/create-program/useProvidedPrograms.d.ts +0 -13
  16. package/_ts4.3/dist/createParserServices.d.ts +0 -5
  17. package/_ts4.3/dist/getModifiers.d.ts +0 -4
  18. package/_ts4.3/dist/index.d.ts +0 -13
  19. package/_ts4.3/dist/jsx/xhtml-entities.d.ts +0 -2
  20. package/_ts4.3/dist/node-utils.d.ts +0 -254
  21. package/_ts4.3/dist/parseSettings/ExpiringCache.d.ts +0 -17
  22. package/_ts4.3/dist/parseSettings/createParseSettings.d.ts +0 -6
  23. package/_ts4.3/dist/parseSettings/getProjectConfigFiles.d.ts +0 -12
  24. package/_ts4.3/dist/parseSettings/index.d.ts +0 -117
  25. package/_ts4.3/dist/parseSettings/inferSingleRun.d.ts +0 -15
  26. package/_ts4.3/dist/parseSettings/resolveProjectList.d.ts +0 -19
  27. package/_ts4.3/dist/parseSettings/warnAboutTSVersion.d.ts +0 -3
  28. package/_ts4.3/dist/parser-options.d.ts +0 -184
  29. package/_ts4.3/dist/parser.d.ts +0 -20
  30. package/_ts4.3/dist/semantic-or-syntactic-errors.d.ts +0 -13
  31. package/_ts4.3/dist/simple-traverse.d.ts +0 -14
  32. package/_ts4.3/dist/source-files.d.ts +0 -4
  33. package/_ts4.3/dist/ts-estree/estree-to-ts-node-types.d.ts +0 -178
  34. package/_ts4.3/dist/ts-estree/index.d.ts +0 -4
  35. package/_ts4.3/dist/ts-estree/ts-nodes.d.ts +0 -20
  36. package/_ts4.3/dist/use-at-your-own-risk.d.ts +0 -7
  37. package/_ts4.3/dist/version-check.d.ts +0 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typescript-eslint/typescript-estree",
3
- "version": "6.0.0",
3
+ "version": "7.0.0-alpha.0+6ae1fa74b",
4
4
  "description": "A parser that converts TypeScript source code into an ESTree compatible form",
5
5
  "files": [
6
6
  "dist",
@@ -52,8 +52,8 @@
52
52
  "typecheck": "tsc -p tsconfig.json --noEmit"
53
53
  },
54
54
  "dependencies": {
55
- "@typescript-eslint/types": "6.0.0",
56
- "@typescript-eslint/visitor-keys": "6.0.0",
55
+ "@typescript-eslint/types": "7.0.0-alpha.0+6ae1fa74b",
56
+ "@typescript-eslint/visitor-keys": "7.0.0-alpha.0+6ae1fa74b",
57
57
  "debug": "^4.3.4",
58
58
  "globby": "^11.1.0",
59
59
  "is-glob": "^4.0.3",
@@ -1,9 +0,0 @@
1
- import type { SourceFile } from 'typescript';
2
- import type { ASTMaps } from './convert';
3
- import type { ParseSettings } from './parseSettings';
4
- import type { TSESTree } from './ts-estree';
5
- export declare function astConverter(ast: SourceFile, parseSettings: ParseSettings, shouldPreserveNodeMaps: boolean): {
6
- estree: TSESTree.Program;
7
- astMaps: ASTMaps;
8
- };
9
- //# sourceMappingURL=ast-converter.d.ts.map
@@ -1,10 +0,0 @@
1
- /**
2
- * Clears all of the internal caches.
3
- * Generally you shouldn't need or want to use this.
4
- * Examples of intended uses:
5
- * - In tests to reset parser state to keep tests isolated.
6
- * - In custom lint tooling that iteratively lints one project at a time to prevent OOMs.
7
- */
8
- export declare function clearCaches(): void;
9
- export declare const clearProgramCache: typeof clearCaches;
10
- //# sourceMappingURL=clear-caches.d.ts.map
@@ -1,11 +0,0 @@
1
- import * as ts from 'typescript';
2
- import type { TSESTree } from './ts-estree';
3
- /**
4
- * Convert all comments for the given AST.
5
- * @param ast the AST object
6
- * @param code the TypeScript code
7
- * @returns the converted ESTreeComment
8
- * @private
9
- */
10
- export declare function convertComments(ast: ts.SourceFile, code: string): TSESTree.Comment[];
11
- //# sourceMappingURL=convert-comments.d.ts.map
@@ -1,142 +0,0 @@
1
- import * as ts from 'typescript';
2
- import type { TSError } from './node-utils';
3
- import type { ParserWeakMap, ParserWeakMapESTreeToTSNode } from './parser-options';
4
- import type { SemanticOrSyntacticError } from './semantic-or-syntactic-errors';
5
- import type { TSESTree, TSNode } from './ts-estree';
6
- export interface ConverterOptions {
7
- allowInvalidAST?: boolean;
8
- errorOnUnknownASTType?: boolean;
9
- shouldPreserveNodeMaps?: boolean;
10
- suppressDeprecatedPropertyWarnings?: boolean;
11
- }
12
- /**
13
- * Extends and formats a given error object
14
- * @param error the error object
15
- * @returns converted error object
16
- */
17
- export declare function convertError(error: SemanticOrSyntacticError | ts.DiagnosticWithLocation): TSError;
18
- export interface ASTMaps {
19
- esTreeNodeToTSNodeMap: ParserWeakMapESTreeToTSNode;
20
- tsNodeToESTreeNodeMap: ParserWeakMap<TSNode, TSESTree.Node>;
21
- }
22
- export declare class Converter {
23
- #private;
24
- private readonly ast;
25
- private readonly options;
26
- private readonly esTreeNodeToTSNodeMap;
27
- private readonly tsNodeToESTreeNodeMap;
28
- private allowPattern;
29
- /**
30
- * Converts a TypeScript node into an ESTree node
31
- * @param ast the full TypeScript AST
32
- * @param options additional options for the conversion
33
- * @returns the converted ESTreeNode
34
- */
35
- constructor(ast: ts.SourceFile, options?: ConverterOptions);
36
- getASTMaps(): ASTMaps;
37
- convertProgram(): TSESTree.Program;
38
- /**
39
- * Converts a TypeScript node into an ESTree node.
40
- * @param node the child ts.Node
41
- * @param parent parentNode
42
- * @param allowPattern flag to determine if patterns are allowed
43
- * @returns the converted ESTree node
44
- */
45
- private converter;
46
- /**
47
- * Fixes the exports of the given ts.Node
48
- * @param node the ts.Node
49
- * @param result result
50
- * @returns the ESTreeNode with fixed exports
51
- */
52
- private fixExports;
53
- /**
54
- * Register specific TypeScript node into map with first ESTree node provided
55
- */
56
- private registerTSNodeInNodeMap;
57
- /**
58
- * Converts a TypeScript node into an ESTree node.
59
- * @param child the child ts.Node
60
- * @param parent parentNode
61
- * @returns the converted ESTree node
62
- */
63
- private convertPattern;
64
- /**
65
- * Converts a TypeScript node into an ESTree node.
66
- * @param child the child ts.Node
67
- * @param parent parentNode
68
- * @returns the converted ESTree node
69
- */
70
- private convertChild;
71
- private createNode;
72
- private convertBindingNameWithTypeAnnotation;
73
- /**
74
- * Converts a child into a type annotation. This creates an intermediary
75
- * TypeAnnotation node to match what Flow does.
76
- * @param child The TypeScript AST node to convert.
77
- * @param parent parentNode
78
- * @returns The type annotation node.
79
- */
80
- private convertTypeAnnotation;
81
- /**
82
- * Coverts body Nodes and add a directive field to StringLiterals
83
- * @param nodes of ts.Node
84
- * @param parent parentNode
85
- * @returns Array of body statements
86
- */
87
- private convertBodyExpressions;
88
- /**
89
- * Converts a ts.Node's typeArguments to TSTypeParameterInstantiation node
90
- * @param typeArguments ts.NodeArray typeArguments
91
- * @param node parent used to create this node
92
- * @returns TypeParameterInstantiation node
93
- */
94
- private convertTypeArgumentsToTypeParameterInstantiation;
95
- /**
96
- * Converts a ts.Node's typeParameters to TSTypeParameterDeclaration node
97
- * @param typeParameters ts.Node typeParameters
98
- * @returns TypeParameterDeclaration node
99
- */
100
- private convertTSTypeParametersToTypeParametersDeclaration;
101
- /**
102
- * Converts an array of ts.Node parameters into an array of ESTreeNode params
103
- * @param parameters An array of ts.Node params to be converted
104
- * @returns an array of converted ESTreeNode params
105
- */
106
- private convertParameters;
107
- private convertChainExpression;
108
- /**
109
- * For nodes that are copied directly from the TypeScript AST into
110
- * ESTree mostly as-is. The only difference is the addition of a type
111
- * property instead of a kind property. Recursively copies all children.
112
- */
113
- private deeplyCopy;
114
- private convertJSXIdentifier;
115
- private convertJSXNamespaceOrIdentifier;
116
- /**
117
- * Converts a TypeScript JSX node.tagName into an ESTree node.name
118
- * @param node the tagName object from a JSX ts.Node
119
- * @param parent
120
- * @returns the converted ESTree name object
121
- */
122
- private convertJSXTagName;
123
- private convertMethodSignature;
124
- private convertAssertClasue;
125
- /**
126
- * Uses the provided range location to adjust the location data of the given Node
127
- * @param result The node that will have its location data mutated
128
- * @param childRange The child node range used to expand location
129
- */
130
- private fixParentLocation;
131
- private assertModuleSpecifier;
132
- /**
133
- * Converts a TypeScript node into an ESTree node.
134
- * The core of the conversion logic:
135
- * Identify and convert each relevant TypeScript SyntaxKind
136
- * @param node the child ts.Node
137
- * @param parent parentNode
138
- * @returns the converted ESTree node
139
- */
140
- private convertNode;
141
- }
142
- //# sourceMappingURL=convert.d.ts.map
@@ -1,13 +0,0 @@
1
- import type * as ts from 'typescript';
2
- interface DirectoryStructureHost {
3
- readDirectory?(path: string, extensions?: readonly string[], exclude?: readonly string[], include?: readonly string[], depth?: number): string[];
4
- }
5
- interface CachedDirectoryStructureHost extends DirectoryStructureHost {
6
- readDirectory(path: string, extensions?: readonly string[], exclude?: readonly string[], include?: readonly string[], depth?: number): string[];
7
- }
8
- interface WatchCompilerHostOfConfigFile<T extends ts.BuilderProgram> extends ts.WatchCompilerHostOfConfigFile<T> {
9
- onCachedDirectoryStructureHostCreate(host: CachedDirectoryStructureHost): void;
10
- extraFileExtensions?: readonly ts.FileExtensionInfo[];
11
- }
12
- export { WatchCompilerHostOfConfigFile };
13
- //# sourceMappingURL=WatchCompilerHostOfConfigFile.d.ts.map
@@ -1,12 +0,0 @@
1
- import type { ParseSettings } from '../parseSettings';
2
- import type { ASTAndDefiniteProgram } from './shared';
3
- /**
4
- * @param parseSettings Internal settings for parsing the file
5
- * @returns If found, returns the source file corresponding to the code and the containing program
6
- * @deprecated
7
- * This is a legacy option that comes with severe performance penalties.
8
- * Please do not use it.
9
- */
10
- declare function createDefaultProgram(parseSettings: ParseSettings): ASTAndDefiniteProgram | undefined;
11
- export { createDefaultProgram };
12
- //# sourceMappingURL=createDefaultProgram.d.ts.map
@@ -1,9 +0,0 @@
1
- import type { ParseSettings } from '../parseSettings';
2
- import type { ASTAndDefiniteProgram } from './shared';
3
- /**
4
- * @param code The code of the file being linted
5
- * @returns Returns a new source file and program corresponding to the linted code
6
- */
7
- declare function createIsolatedProgram(parseSettings: ParseSettings): ASTAndDefiniteProgram;
8
- export { createIsolatedProgram };
9
- //# sourceMappingURL=createIsolatedProgram.d.ts.map
@@ -1,9 +0,0 @@
1
- import type { ParseSettings } from '../parseSettings';
2
- import type { ASTAndDefiniteProgram } from './shared';
3
- /**
4
- * @param parseSettings Internal settings for parsing the file
5
- * @returns If found, the source file corresponding to the code and the containing program
6
- */
7
- declare function createProjectProgram(parseSettings: ParseSettings): ASTAndDefiniteProgram | undefined;
8
- export { createProjectProgram };
9
- //# sourceMappingURL=createProjectProgram.d.ts.map
@@ -1,7 +0,0 @@
1
- import * as ts from 'typescript';
2
- import type { ParseSettings } from '../parseSettings';
3
- import type { ASTAndNoProgram } from './shared';
4
- declare function createSourceFile(parseSettings: ParseSettings): ts.SourceFile;
5
- declare function createNoProgram(parseSettings: ParseSettings): ASTAndNoProgram;
6
- export { createSourceFile, createNoProgram };
7
- //# sourceMappingURL=createSourceFile.d.ts.map
@@ -1,2 +0,0 @@
1
- export declare function describeFilePath(filePath: string, tsconfigRootDir: string): string;
2
- //# sourceMappingURL=describeFilePath.d.ts.map
@@ -1,5 +0,0 @@
1
- import * as ts from 'typescript';
2
- declare function getScriptKind(filePath: string, jsx: boolean): ts.ScriptKind;
3
- declare function getLanguageVariant(scriptKind: ts.ScriptKind): ts.LanguageVariant;
4
- export { getScriptKind, getLanguageVariant };
5
- //# sourceMappingURL=getScriptKind.d.ts.map
@@ -1,15 +0,0 @@
1
- import * as ts from 'typescript';
2
- import type { ParseSettings } from '../parseSettings';
3
- /**
4
- * Clear all of the parser caches.
5
- * This should only be used in testing to ensure the parser is clean between tests.
6
- */
7
- declare function clearWatchCaches(): void;
8
- /**
9
- * Calculate project environments using options provided by consumer and paths from config
10
- * @param parseSettings Internal settings for parsing the file
11
- * @returns The programs corresponding to the supplied tsconfig paths
12
- */
13
- declare function getWatchProgramsForProjects(parseSettings: ParseSettings): ts.Program[];
14
- export { clearWatchCaches, getWatchProgramsForProjects };
15
- //# sourceMappingURL=getWatchProgramsForProjects.d.ts.map
@@ -1,32 +0,0 @@
1
- import type { Program } from 'typescript';
2
- import * as ts from 'typescript';
3
- import type { ParseSettings } from '../parseSettings';
4
- interface ASTAndNoProgram {
5
- ast: ts.SourceFile;
6
- program: null;
7
- }
8
- interface ASTAndDefiniteProgram {
9
- ast: ts.SourceFile;
10
- program: ts.Program;
11
- }
12
- type ASTAndProgram = ASTAndDefiniteProgram | ASTAndNoProgram;
13
- /**
14
- * Compiler options required to avoid critical functionality issues
15
- */
16
- declare const CORE_COMPILER_OPTIONS: ts.CompilerOptions;
17
- declare function createDefaultCompilerOptionsFromExtra(parseSettings: ParseSettings): ts.CompilerOptions;
18
- type CanonicalPath = string & {
19
- __brand: unknown;
20
- };
21
- declare function getCanonicalFileName(filePath: string): CanonicalPath;
22
- declare function ensureAbsolutePath(p: string, tsconfigRootDir: string): string;
23
- declare function canonicalDirname(p: CanonicalPath): CanonicalPath;
24
- declare function getAstFromProgram(currentProgram: Program, parseSettings: ParseSettings): ASTAndDefiniteProgram | undefined;
25
- /**
26
- * Hash content for compare content.
27
- * @param content hashed contend
28
- * @returns hashed result
29
- */
30
- declare function createHash(content: string): string;
31
- export { ASTAndDefiniteProgram, ASTAndNoProgram, ASTAndProgram, CORE_COMPILER_OPTIONS, canonicalDirname, CanonicalPath, createDefaultCompilerOptionsFromExtra, createHash, ensureAbsolutePath, getCanonicalFileName, getAstFromProgram, };
32
- //# sourceMappingURL=shared.d.ts.map
@@ -1,13 +0,0 @@
1
- import * as ts from 'typescript';
2
- import type { ParseSettings } from '../parseSettings';
3
- import type { ASTAndDefiniteProgram } from './shared';
4
- declare function useProvidedPrograms(programInstances: Iterable<ts.Program>, parseSettings: ParseSettings): ASTAndDefiniteProgram | undefined;
5
- /**
6
- * Utility offered by parser to help consumers construct their own program instance.
7
- *
8
- * @param configFile the path to the tsconfig.json file, relative to `projectDirectory`
9
- * @param projectDirectory the project directory to use as the CWD, defaults to `process.cwd()`
10
- */
11
- declare function createProgramFromConfigFile(configFile: string, projectDirectory?: string): ts.Program;
12
- export { useProvidedPrograms, createProgramFromConfigFile };
13
- //# sourceMappingURL=useProvidedPrograms.d.ts.map
@@ -1,5 +0,0 @@
1
- import type * as ts from 'typescript';
2
- import type { ASTMaps } from './convert';
3
- import type { ParserServices } from './parser-options';
4
- export declare function createParserServices(astMaps: ASTMaps, program: ts.Program | null): ParserServices;
5
- //# sourceMappingURL=createParserServices.d.ts.map
@@ -1,4 +0,0 @@
1
- import * as ts from 'typescript';
2
- export declare function getModifiers(node: ts.Node | null | undefined, includeIllegalModifiers?: boolean): ts.Modifier[] | undefined;
3
- export declare function getDecorators(node: ts.Node | null | undefined, includeIllegalDecorators?: boolean): ts.Decorator[] | undefined;
4
- //# sourceMappingURL=getModifiers.d.ts.map
@@ -1,13 +0,0 @@
1
- export { AST, parse, parseAndGenerateServices, ParseAndGenerateServicesResult, } from './parser';
2
- export { ParserServices, ParserServicesWithTypeInformation, ParserServicesWithoutTypeInformation, TSESTreeOptions, } from './parser-options';
3
- export { simpleTraverse } from './simple-traverse';
4
- export * from './ts-estree';
5
- export { createProgramFromConfigFile as createProgram } from './create-program/useProvidedPrograms';
6
- export * from './create-program/getScriptKind';
7
- export { getCanonicalFileName } from './create-program/shared';
8
- export { typescriptVersionIsAtLeast } from './version-check';
9
- export * from './getModifiers';
10
- export { TSError } from './node-utils';
11
- export * from './clear-caches';
12
- export declare const version: string;
13
- //# sourceMappingURL=index.d.ts.map
@@ -1,2 +0,0 @@
1
- export declare const xhtmlEntities: Record<string, string>;
2
- //# sourceMappingURL=xhtml-entities.d.ts.map
@@ -1,254 +0,0 @@
1
- import * as ts from 'typescript';
2
- import type { TSESTree, TSNode } from './ts-estree';
3
- import { AST_NODE_TYPES, AST_TOKEN_TYPES } from './ts-estree';
4
- declare const SyntaxKind: typeof ts.SyntaxKind;
5
- type LogicalOperatorKind = ts.SyntaxKind.AmpersandAmpersandToken | ts.SyntaxKind.BarBarToken | ts.SyntaxKind.QuestionQuestionToken;
6
- interface TokenToText extends TSESTree.PunctuatorTokenToText, TSESTree.BinaryOperatorToText {
7
- [SyntaxKind.ImportKeyword]: 'import';
8
- [SyntaxKind.NewKeyword]: 'new';
9
- [SyntaxKind.KeyOfKeyword]: 'keyof';
10
- [SyntaxKind.ReadonlyKeyword]: 'readonly';
11
- [SyntaxKind.UniqueKeyword]: 'unique';
12
- }
13
- type AssignmentOperatorKind = keyof TSESTree.AssignmentOperatorToText;
14
- type BinaryOperatorKind = keyof TSESTree.BinaryOperatorToText;
15
- /**
16
- * Returns true if the given ts.Token is a logical operator
17
- * @param operator the operator token
18
- * @returns is a logical operator
19
- */
20
- export declare function isLogicalOperator(operator: ts.BinaryOperatorToken): operator is ts.Token<LogicalOperatorKind>;
21
- export declare function isESTreeBinaryOperator(operator: ts.BinaryOperatorToken): operator is ts.Token<BinaryOperatorKind>;
22
- type TokenForTokenKind<T extends ts.SyntaxKind> = T extends keyof TokenToText ? TokenToText[T] : string | undefined;
23
- /**
24
- * Returns the string form of the given TSToken SyntaxKind
25
- * @param kind the token's SyntaxKind
26
- * @returns the token applicable token as a string
27
- */
28
- export declare function getTextForTokenKind<T extends ts.SyntaxKind>(kind: T): TokenForTokenKind<T>;
29
- /**
30
- * Returns true if the given ts.Node is a valid ESTree class member
31
- * @param node TypeScript AST node
32
- * @returns is valid ESTree class member
33
- */
34
- export declare function isESTreeClassMember(node: ts.Node): boolean;
35
- /**
36
- * Checks if a ts.Node has a modifier
37
- * @param modifierKind TypeScript SyntaxKind modifier
38
- * @param node TypeScript AST node
39
- * @returns has the modifier specified
40
- */
41
- export declare function hasModifier(modifierKind: ts.KeywordSyntaxKind, node: ts.Node): boolean;
42
- /**
43
- * Get last last modifier in ast
44
- * @param node TypeScript AST node
45
- * @returns returns last modifier if present or null
46
- */
47
- export declare function getLastModifier(node: ts.Node): ts.Modifier | null;
48
- /**
49
- * Returns true if the given ts.Token is a comma
50
- * @param token the TypeScript token
51
- * @returns is comma
52
- */
53
- export declare function isComma(token: ts.Node): token is ts.Token<ts.SyntaxKind.CommaToken>;
54
- /**
55
- * Returns true if the given ts.Node is a comment
56
- * @param node the TypeScript node
57
- * @returns is comment
58
- */
59
- export declare function isComment(node: ts.Node): boolean;
60
- /**
61
- * Returns the binary expression type of the given ts.Token
62
- * @param operator the operator token
63
- * @returns the binary expression type
64
- */
65
- export declare function getBinaryExpressionType(operator: ts.BinaryOperatorToken): {
66
- type: AST_NODE_TYPES.AssignmentExpression;
67
- operator: TokenForTokenKind<AssignmentOperatorKind>;
68
- } | {
69
- type: AST_NODE_TYPES.BinaryExpression;
70
- operator: TokenForTokenKind<BinaryOperatorKind>;
71
- } | {
72
- type: AST_NODE_TYPES.LogicalExpression;
73
- operator: TokenForTokenKind<LogicalOperatorKind>;
74
- };
75
- /**
76
- * Returns line and column data for the given positions,
77
- * @param pos position to check
78
- * @param ast the AST object
79
- * @returns line and column
80
- */
81
- export declare function getLineAndCharacterFor(pos: number, ast: ts.SourceFile): TSESTree.Position;
82
- /**
83
- * Returns line and column data for the given start and end positions,
84
- * for the given AST
85
- * @param range start end data
86
- * @param ast the AST object
87
- * @returns the loc data
88
- */
89
- export declare function getLocFor(range: TSESTree.Range, ast: ts.SourceFile): TSESTree.SourceLocation;
90
- /**
91
- * Check whatever node can contain directive
92
- * @param node
93
- * @returns returns true if node can contain directive
94
- */
95
- export declare function canContainDirective(node: ts.Block | ts.ClassStaticBlockDeclaration | ts.ModuleBlock | ts.SourceFile): boolean;
96
- /**
97
- * Returns range for the given ts.Node
98
- * @param node the ts.Node or ts.Token
99
- * @param ast the AST object
100
- * @returns the range data
101
- */
102
- export declare function getRange(node: Pick<ts.Node, 'getEnd' | 'getStart'>, ast: ts.SourceFile): [
103
- number,
104
- number
105
- ];
106
- /**
107
- * Returns true if a given ts.Node is a JSX token
108
- * @param node ts.Node to be checked
109
- * @returns is a JSX token
110
- */
111
- export declare function isJSXToken(node: ts.Node): boolean;
112
- /**
113
- * Returns the declaration kind of the given ts.Node
114
- * @param node TypeScript AST node
115
- * @returns declaration kind
116
- */
117
- export declare function getDeclarationKind(node: ts.VariableDeclarationList): 'const' | 'let' | 'var';
118
- /**
119
- * Gets a ts.Node's accessibility level
120
- * @param node The ts.Node
121
- * @returns accessibility "public", "protected", "private", or null
122
- */
123
- export declare function getTSNodeAccessibility(node: ts.Node): 'private' | 'protected' | 'public' | undefined;
124
- /**
125
- * Finds the next token based on the previous one and its parent
126
- * Had to copy this from TS instead of using TS's version because theirs doesn't pass the ast to getChildren
127
- * @param previousToken The previous TSToken
128
- * @param parent The parent TSNode
129
- * @param ast The TS AST
130
- * @returns the next TSToken
131
- */
132
- export declare function findNextToken(previousToken: ts.TextRange, parent: ts.Node, ast: ts.SourceFile): ts.Node | undefined;
133
- /**
134
- * Find the first matching ancestor based on the given predicate function.
135
- * @param node The current ts.Node
136
- * @param predicate The predicate function to apply to each checked ancestor
137
- * @returns a matching parent ts.Node
138
- */
139
- export declare function findFirstMatchingAncestor(node: ts.Node, predicate: (node: ts.Node) => boolean): ts.Node | undefined;
140
- /**
141
- * Returns true if a given ts.Node has a JSX token within its hierarchy
142
- * @param node ts.Node to be checked
143
- * @returns has JSX ancestor
144
- */
145
- export declare function hasJSXAncestor(node: ts.Node): boolean;
146
- /**
147
- * Unescape the text content of string literals, e.g. &amp; -> &
148
- * @param text The escaped string literal text.
149
- * @returns The unescaped string literal text.
150
- */
151
- export declare function unescapeStringLiteralText(text: string): string;
152
- /**
153
- * Returns true if a given ts.Node is a computed property
154
- * @param node ts.Node to be checked
155
- * @returns is Computed Property
156
- */
157
- export declare function isComputedProperty(node: ts.Node): node is ts.ComputedPropertyName;
158
- /**
159
- * Returns true if a given ts.Node is optional (has QuestionToken)
160
- * @param node ts.Node to be checked
161
- * @returns is Optional
162
- */
163
- export declare function isOptional(node: {
164
- questionToken?: ts.QuestionToken;
165
- }): boolean;
166
- /**
167
- * Returns true if the node is an optional chain node
168
- */
169
- export declare function isChainExpression(node: TSESTree.Node): node is TSESTree.ChainExpression;
170
- /**
171
- * Returns true of the child of property access expression is an optional chain
172
- */
173
- export declare function isChildUnwrappableOptionalChain(node: ts.CallExpression | ts.ElementAccessExpression | ts.NonNullExpression | ts.PropertyAccessExpression, child: TSESTree.Node): boolean;
174
- /**
175
- * Returns the type of a given ts.Token
176
- * @param token the ts.Token
177
- * @returns the token type
178
- */
179
- export declare function getTokenType(token: ts.Identifier | ts.Token<ts.SyntaxKind>): Exclude<AST_TOKEN_TYPES, AST_TOKEN_TYPES.Block | AST_TOKEN_TYPES.Line>;
180
- /**
181
- * Extends and formats a given ts.Token, for a given AST
182
- * @param token the ts.Token
183
- * @param ast the AST object
184
- * @returns the converted Token
185
- */
186
- export declare function convertToken(token: ts.Token<ts.TokenSyntaxKind>, ast: ts.SourceFile): TSESTree.Token;
187
- /**
188
- * Converts all tokens for the given AST
189
- * @param ast the AST object
190
- * @returns the converted Tokens
191
- */
192
- export declare function convertTokens(ast: ts.SourceFile): TSESTree.Token[];
193
- export declare class TSError extends Error {
194
- readonly fileName: string;
195
- readonly location: {
196
- start: {
197
- line: number;
198
- column: number;
199
- offset: number;
200
- };
201
- end: {
202
- line: number;
203
- column: number;
204
- offset: number;
205
- };
206
- };
207
- constructor(message: string, fileName: string, location: {
208
- start: {
209
- line: number;
210
- column: number;
211
- offset: number;
212
- };
213
- end: {
214
- line: number;
215
- column: number;
216
- offset: number;
217
- };
218
- });
219
- get index(): number;
220
- get lineNumber(): number;
221
- get column(): number;
222
- }
223
- /**
224
- * @param message the error message
225
- * @param ast the AST object
226
- * @param startIndex the index at which the error starts
227
- * @param endIndex the index at which the error ends
228
- * @returns converted error object
229
- */
230
- export declare function createError(message: string, ast: ts.SourceFile, startIndex: number, endIndex?: number): TSError;
231
- export declare function nodeHasIllegalDecorators(node: ts.Node): node is ts.Node & {
232
- illegalDecorators: ts.Node[];
233
- };
234
- /**
235
- * @param n the TSNode
236
- * @param ast the TS AST
237
- */
238
- export declare function nodeHasTokens(n: ts.Node, ast: ts.SourceFile): boolean;
239
- /**
240
- * Like `forEach`, but suitable for use with numbers and strings (which may be falsy).
241
- * @template T
242
- * @template U
243
- * @param array
244
- * @param callback
245
- */
246
- export declare function firstDefined<T, U>(array: readonly T[] | undefined, callback: (element: T, index: number) => U | undefined): U | undefined;
247
- export declare function identifierIsThisKeyword(id: ts.Identifier): boolean;
248
- export declare function isThisIdentifier(node: ts.Node | undefined): node is ts.Identifier;
249
- export declare function isThisInTypeQuery(node: ts.Node): boolean;
250
- export declare function nodeIsPresent(node: ts.Node | undefined): node is ts.Node;
251
- export declare function getContainingFunction(node: ts.Node): ts.SignatureDeclaration | undefined;
252
- export declare function nodeCanBeDecorated(node: TSNode): boolean;
253
- export {};
254
- //# sourceMappingURL=node-utils.d.ts.map
@@ -1,17 +0,0 @@
1
- import type { CacheDurationSeconds } from '@typescript-eslint/types';
2
- export declare const DEFAULT_TSCONFIG_CACHE_DURATION_SECONDS = 30;
3
- export interface CacheLike<Key, Value> {
4
- get(key: Key): Value | void;
5
- set(key: Key, value: Value): this;
6
- }
7
- /**
8
- * A map with key-level expiration.
9
- */
10
- export declare class ExpiringCache<TKey, TValue> implements CacheLike<TKey, TValue> {
11
- #private;
12
- constructor(cacheDurationSeconds: CacheDurationSeconds);
13
- set(key: TKey, value: TValue): this;
14
- get(key: TKey): TValue | undefined;
15
- clear(): void;
16
- }
17
- //# sourceMappingURL=ExpiringCache.d.ts.map
@@ -1,6 +0,0 @@
1
- import type * as ts from 'typescript';
2
- import type { TSESTreeOptions } from '../parser-options';
3
- import type { MutableParseSettings } from './index';
4
- export declare function createParseSettings(code: ts.SourceFile | string, options?: Partial<TSESTreeOptions>): MutableParseSettings;
5
- export declare function clearTSConfigMatchCache(): void;
6
- //# sourceMappingURL=createParseSettings.d.ts.map
@@ -1,12 +0,0 @@
1
- import type { ParseSettings } from '.';
2
- /**
3
- * Checks for a matching TSConfig to a file including its parent directories,
4
- * permanently caching results under each directory it checks.
5
- *
6
- * @remarks
7
- * We don't (yet!) have a way to attach file watchers on disk, but still need to
8
- * cache file checks for rapid subsequent calls to fs.existsSync. See discussion
9
- * in https://github.com/typescript-eslint/typescript-eslint/issues/101.
10
- */
11
- export declare function getProjectConfigFiles(parseSettings: Pick<ParseSettings, 'filePath' | 'tsconfigMatchCache' | 'tsconfigRootDir'>, project: string[] | string | true | null | undefined): string[] | null;
12
- //# sourceMappingURL=getProjectConfigFiles.d.ts.map