@typescript-eslint/typescript-estree 6.0.0-alpha.80 → 6.0.0-alpha.90
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/_ts4.2/dist/convert.d.ts +2 -2
- package/_ts4.2/dist/create-program/shared.d.ts +1 -3
- package/_ts4.2/dist/parseSettings/index.d.ts +4 -4
- package/_ts4.2/dist/parser-options.d.ts +4 -8
- package/dist/ast-converter.d.ts.map +1 -1
- package/dist/ast-converter.js +3 -2
- package/dist/ast-converter.js.map +1 -1
- package/dist/convert.d.ts +2 -2
- package/dist/convert.d.ts.map +1 -1
- package/dist/convert.js +62 -67
- package/dist/convert.js.map +1 -1
- package/dist/create-program/createDefaultProgram.d.ts.map +1 -1
- package/dist/create-program/createDefaultProgram.js +0 -3
- package/dist/create-program/createDefaultProgram.js.map +1 -1
- package/dist/create-program/getWatchProgramsForProjects.d.ts.map +1 -1
- package/dist/create-program/getWatchProgramsForProjects.js +0 -3
- package/dist/create-program/getWatchProgramsForProjects.js.map +1 -1
- package/dist/create-program/shared.d.ts +1 -3
- package/dist/create-program/shared.d.ts.map +1 -1
- package/dist/create-program/shared.js +1 -16
- package/dist/create-program/shared.js.map +1 -1
- package/dist/getModifiers.d.ts.map +1 -1
- package/dist/getModifiers.js +2 -2
- package/dist/getModifiers.js.map +1 -1
- package/dist/node-utils.d.ts.map +1 -1
- package/dist/node-utils.js +18 -5
- package/dist/node-utils.js.map +1 -1
- package/dist/parseSettings/ExpiringCache.js.map +1 -1
- package/dist/parseSettings/createParseSettings.d.ts.map +1 -1
- package/dist/parseSettings/createParseSettings.js +2 -1
- package/dist/parseSettings/createParseSettings.js.map +1 -1
- package/dist/parseSettings/index.d.ts +4 -4
- package/dist/parseSettings/index.d.ts.map +1 -1
- package/dist/parseSettings/warnAboutTSVersion.js +2 -2
- package/dist/parseSettings/warnAboutTSVersion.js.map +1 -1
- package/dist/parser-options.d.ts +4 -8
- package/dist/parser-options.d.ts.map +1 -1
- package/dist/parser.js +1 -1
- package/dist/parser.js.map +1 -1
- package/dist/ts-estree/ts-nodes.d.ts.map +1 -1
- package/package.json +4 -4
package/_ts4.2/dist/convert.d.ts
CHANGED
|
@@ -3,10 +3,11 @@ import type { TSError } from './node-utils';
|
|
|
3
3
|
import type { ParserWeakMap, ParserWeakMapESTreeToTSNode } from './parser-options';
|
|
4
4
|
import type { SemanticOrSyntacticError } from './semantic-or-syntactic-errors';
|
|
5
5
|
import type { TSESTree, TSNode } from './ts-estree';
|
|
6
|
-
interface ConverterOptions {
|
|
6
|
+
export interface ConverterOptions {
|
|
7
7
|
allowInvalidAST?: boolean;
|
|
8
8
|
errorOnUnknownASTType?: boolean;
|
|
9
9
|
shouldPreserveNodeMaps?: boolean;
|
|
10
|
+
suppressDeprecatedPropertyWarnings?: boolean;
|
|
10
11
|
}
|
|
11
12
|
/**
|
|
12
13
|
* Extends and formats a given error object
|
|
@@ -138,5 +139,4 @@ export declare class Converter {
|
|
|
138
139
|
*/
|
|
139
140
|
private convertNode;
|
|
140
141
|
}
|
|
141
|
-
export {};
|
|
142
142
|
//# sourceMappingURL=convert.d.ts.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Program } from 'typescript';
|
|
2
2
|
import * as ts from 'typescript';
|
|
3
|
-
import type { ModuleResolver } from '../parser-options';
|
|
4
3
|
import type { ParseSettings } from '../parseSettings';
|
|
5
4
|
interface ASTAndNoProgram {
|
|
6
5
|
ast: ts.SourceFile;
|
|
@@ -23,12 +22,11 @@ declare function getCanonicalFileName(filePath: string): CanonicalPath;
|
|
|
23
22
|
declare function ensureAbsolutePath(p: string, tsconfigRootDir: string): string;
|
|
24
23
|
declare function canonicalDirname(p: CanonicalPath): CanonicalPath;
|
|
25
24
|
declare function getAstFromProgram(currentProgram: Program, parseSettings: ParseSettings): ASTAndDefiniteProgram | undefined;
|
|
26
|
-
declare function getModuleResolver(moduleResolverPath: string): ModuleResolver;
|
|
27
25
|
/**
|
|
28
26
|
* Hash content for compare content.
|
|
29
27
|
* @param content hashed contend
|
|
30
28
|
* @returns hashed result
|
|
31
29
|
*/
|
|
32
30
|
declare function createHash(content: string): string;
|
|
33
|
-
export { ASTAndDefiniteProgram, ASTAndNoProgram, ASTAndProgram, CORE_COMPILER_OPTIONS, canonicalDirname, CanonicalPath, createDefaultCompilerOptionsFromExtra, createHash, ensureAbsolutePath, getCanonicalFileName, getAstFromProgram,
|
|
31
|
+
export { ASTAndDefiniteProgram, ASTAndNoProgram, ASTAndProgram, CORE_COMPILER_OPTIONS, canonicalDirname, CanonicalPath, createDefaultCompilerOptionsFromExtra, createHash, ensureAbsolutePath, getCanonicalFileName, getAstFromProgram, };
|
|
34
32
|
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -75,10 +75,6 @@ export interface MutableParseSettings {
|
|
|
75
75
|
* Log function, if not `console.log`.
|
|
76
76
|
*/
|
|
77
77
|
log: (message: string) => void;
|
|
78
|
-
/**
|
|
79
|
-
* Path for a module resolver to use for the compiler host's `resolveModuleNames`.
|
|
80
|
-
*/
|
|
81
|
-
moduleResolver: string;
|
|
82
78
|
/**
|
|
83
79
|
* Whether two-way AST node maps are preserved during the AST conversion process.
|
|
84
80
|
*/
|
|
@@ -99,6 +95,10 @@ export interface MutableParseSettings {
|
|
|
99
95
|
* Whether this is part of a single run, rather than a long-running process.
|
|
100
96
|
*/
|
|
101
97
|
singleRun: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Whether deprecated AST properties should skip calling console.warn on accesses.
|
|
100
|
+
*/
|
|
101
|
+
suppressDeprecatedPropertyWarnings: boolean;
|
|
102
102
|
/**
|
|
103
103
|
* If the `tokens` parse option is enabled, retrieved tokens.
|
|
104
104
|
*/
|
|
@@ -58,6 +58,10 @@ interface ParseOptions {
|
|
|
58
58
|
* Set to true to create a top-level array containing all tokens from the file.
|
|
59
59
|
*/
|
|
60
60
|
tokens?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Whether deprecated AST properties should skip calling console.warn on accesses.
|
|
63
|
+
*/
|
|
64
|
+
suppressDeprecatedPropertyWarnings?: boolean;
|
|
61
65
|
}
|
|
62
66
|
interface ParseAndGenerateServicesOptions extends ParseOptions {
|
|
63
67
|
/**
|
|
@@ -153,10 +157,6 @@ interface ParseAndGenerateServicesOptions extends ParseOptions {
|
|
|
153
157
|
*/
|
|
154
158
|
glob?: CacheDurationSeconds;
|
|
155
159
|
};
|
|
156
|
-
/**
|
|
157
|
-
* Path to a file exporting a custom `ModuleResolver`.
|
|
158
|
-
*/
|
|
159
|
-
moduleResolver?: string;
|
|
160
160
|
}
|
|
161
161
|
export type TSESTreeOptions = ParseAndGenerateServicesOptions;
|
|
162
162
|
export interface ParserWeakMap<TKey, TValueBase> {
|
|
@@ -180,9 +180,5 @@ export interface ParserServicesWithoutTypeInformation extends ParserServicesNode
|
|
|
180
180
|
program: null;
|
|
181
181
|
}
|
|
182
182
|
export type ParserServices = ParserServicesWithTypeInformation | ParserServicesWithoutTypeInformation;
|
|
183
|
-
export interface ModuleResolver {
|
|
184
|
-
version: 1;
|
|
185
|
-
resolveModuleNames(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ts.ResolvedProjectReference | undefined, options: ts.CompilerOptions): (ts.ResolvedModule | undefined)[];
|
|
186
|
-
}
|
|
187
183
|
export {};
|
|
188
184
|
//# sourceMappingURL=parser-options.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ast-converter.d.ts","sourceRoot":"","sources":["../src/ast-converter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,wBAAgB,YAAY,CAC1B,GAAG,EAAE,UAAU,EACf,aAAa,EAAE,aAAa,EAC5B,sBAAsB,EAAE,OAAO,GAC9B;IAAE,MAAM,EAAE,QAAQ,CAAC,OAAO,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"ast-converter.d.ts","sourceRoot":"","sources":["../src/ast-converter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,wBAAgB,YAAY,CAC1B,GAAG,EAAE,UAAU,EACf,aAAa,EAAE,aAAa,EAC5B,sBAAsB,EAAE,OAAO,GAC9B;IAAE,MAAM,EAAE,QAAQ,CAAC,OAAO,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CA4DhD"}
|
package/dist/ast-converter.js
CHANGED
|
@@ -18,9 +18,10 @@ function astConverter(ast, parseSettings, shouldPreserveNodeMaps) {
|
|
|
18
18
|
* Recursively convert the TypeScript AST into an ESTree-compatible AST
|
|
19
19
|
*/
|
|
20
20
|
const instance = new convert_1.Converter(ast, {
|
|
21
|
-
allowInvalidAST: parseSettings.allowInvalidAST
|
|
22
|
-
errorOnUnknownASTType: parseSettings.errorOnUnknownASTType
|
|
21
|
+
allowInvalidAST: parseSettings.allowInvalidAST,
|
|
22
|
+
errorOnUnknownASTType: parseSettings.errorOnUnknownASTType,
|
|
23
23
|
shouldPreserveNodeMaps,
|
|
24
|
+
suppressDeprecatedPropertyWarnings: parseSettings.suppressDeprecatedPropertyWarnings,
|
|
24
25
|
});
|
|
25
26
|
const estree = instance.convertProgram();
|
|
26
27
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ast-converter.js","sourceRoot":"","sources":["../src/ast-converter.ts"],"names":[],"mappings":";;;AAGA,uCAAoD;AACpD,yDAAqD;AACrD,6CAA6C;AAE7C,uDAAmD;AAGnD,SAAgB,YAAY,CAC1B,GAAe,EACf,aAA4B,EAC5B,sBAA+B;IAE/B;;;OAGG;IACH,MAAM,EAAE,gBAAgB,EAAE,GAAG,GAAG,CAAC;IACjC,IAAI,gBAAgB,CAAC,MAAM,EAAE;QAC3B,MAAM,IAAA,sBAAY,EAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;KACzC;IAED;;OAEG;IACH,MAAM,QAAQ,GAAG,IAAI,mBAAS,CAAC,GAAG,EAAE;QAClC,eAAe,EAAE,aAAa,CAAC,eAAe
|
|
1
|
+
{"version":3,"file":"ast-converter.js","sourceRoot":"","sources":["../src/ast-converter.ts"],"names":[],"mappings":";;;AAGA,uCAAoD;AACpD,yDAAqD;AACrD,6CAA6C;AAE7C,uDAAmD;AAGnD,SAAgB,YAAY,CAC1B,GAAe,EACf,aAA4B,EAC5B,sBAA+B;IAE/B;;;OAGG;IACH,MAAM,EAAE,gBAAgB,EAAE,GAAG,GAAG,CAAC;IACjC,IAAI,gBAAgB,CAAC,MAAM,EAAE;QAC3B,MAAM,IAAA,sBAAY,EAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;KACzC;IAED;;OAEG;IACH,MAAM,QAAQ,GAAG,IAAI,mBAAS,CAAC,GAAG,EAAE;QAClC,eAAe,EAAE,aAAa,CAAC,eAAe;QAC9C,qBAAqB,EAAE,aAAa,CAAC,qBAAqB;QAC1D,sBAAsB;QACtB,kCAAkC,EAChC,aAAa,CAAC,kCAAkC;KACnD,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,QAAQ,CAAC,cAAc,EAAE,CAAC;IAEzC;;OAEG;IACH,IAAI,CAAC,aAAa,CAAC,KAAK,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE;QAC9C,IAAA,gCAAc,EAAC,MAAM,EAAE;YACrB,KAAK,EAAE,IAAI,CAAC,EAAE;gBACZ,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE;oBACxB,4HAA4H;oBAC5H,mBAAmB;oBACnB,OAAO,IAAI,CAAC,KAAK,CAAC;iBACnB;gBACD,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE;oBACtB,4HAA4H;oBAC5H,mBAAmB;oBACnB,OAAO,IAAI,CAAC,GAAG,CAAC;iBACjB;YACH,CAAC;SACF,CAAC,CAAC;KACJ;IAED;;OAEG;IACH,IAAI,aAAa,CAAC,MAAM,EAAE;QACxB,MAAM,CAAC,MAAM,GAAG,IAAA,0BAAa,EAAC,GAAG,CAAC,CAAC;KACpC;IAED;;OAEG;IACH,IAAI,aAAa,CAAC,OAAO,EAAE;QACzB,MAAM,CAAC,QAAQ,GAAG,IAAA,kCAAe,EAAC,GAAG,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;KACpE;IAED,MAAM,OAAO,GAAG,QAAQ,CAAC,UAAU,EAAE,CAAC;IAEtC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AAC7B,CAAC;AAhED,oCAgEC"}
|
package/dist/convert.d.ts
CHANGED
|
@@ -3,10 +3,11 @@ import type { TSError } from './node-utils';
|
|
|
3
3
|
import type { ParserWeakMap, ParserWeakMapESTreeToTSNode } from './parser-options';
|
|
4
4
|
import type { SemanticOrSyntacticError } from './semantic-or-syntactic-errors';
|
|
5
5
|
import type { TSESTree, TSNode } from './ts-estree';
|
|
6
|
-
interface ConverterOptions {
|
|
6
|
+
export interface ConverterOptions {
|
|
7
7
|
allowInvalidAST?: boolean;
|
|
8
8
|
errorOnUnknownASTType?: boolean;
|
|
9
9
|
shouldPreserveNodeMaps?: boolean;
|
|
10
|
+
suppressDeprecatedPropertyWarnings?: boolean;
|
|
10
11
|
}
|
|
11
12
|
/**
|
|
12
13
|
* Extends and formats a given error object
|
|
@@ -138,5 +139,4 @@ export declare class Converter {
|
|
|
138
139
|
*/
|
|
139
140
|
private convertNode;
|
|
140
141
|
}
|
|
141
|
-
export {};
|
|
142
142
|
//# sourceMappingURL=convert.d.ts.map
|
package/dist/convert.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../src/convert.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAGjC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAyB5C,OAAO,KAAK,EACV,aAAa,EACb,2BAA2B,EAC5B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,KAAK,EAAE,QAAQ,EAAoB,MAAM,EAAE,MAAM,aAAa,CAAC;AAKtE,
|
|
1
|
+
{"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../src/convert.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAGjC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAyB5C,OAAO,KAAK,EACV,aAAa,EACb,2BAA2B,EAC5B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,KAAK,EAAE,QAAQ,EAAoB,MAAM,EAAE,MAAM,aAAa,CAAC;AAKtE,MAAM,WAAW,gBAAgB;IAC/B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,kCAAkC,CAAC,EAAE,OAAO,CAAC;CAC9C;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,EAAE,CAAC,sBAAsB,GAAG,wBAAwB,GAC1D,OAAO,CAMT;AAED,MAAM,WAAW,OAAO;IACtB,qBAAqB,EAAE,2BAA2B,CAAC;IACnD,qBAAqB,EAAE,aAAa,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;CAC7D;AAED,qBAAa,SAAS;;IACpB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAgB;IACpC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAmB;IAC3C,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAiB;IACvD,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAiB;IAEvD,OAAO,CAAC,YAAY,CAAS;IAE7B;;;;;OAKG;gBACS,GAAG,EAAE,EAAE,CAAC,UAAU,EAAE,OAAO,CAAC,EAAE,gBAAgB;IAK1D,UAAU,IAAI,OAAO;IAOrB,cAAc,IAAI,QAAQ,CAAC,OAAO;IAIlC;;;;;;OAMG;IACH,OAAO,CAAC,SAAS;IA4BjB;;;;;OAKG;IACH,OAAO,CAAC,UAAU;IAmElB;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAW/B;;;;;OAKG;IACH,OAAO,CAAC,cAAc;IAItB;;;;;OAKG;IACH,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,UAAU;IAelB,OAAO,CAAC,oCAAoC;IAe5C;;;;;;OAMG;IACH,OAAO,CAAC,qBAAqB;IAqB7B;;;;;OAKG;IACH,OAAO,CAAC,sBAAsB;IAkC9B;;;;;OAKG;IACH,OAAO,CAAC,gDAAgD;IAexD;;;;OAIG;IACH,OAAO,CAAC,kDAAkD;IAe1D;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IAgBzB,OAAO,CAAC,sBAAsB;IA4C9B;;;;OAIG;IACH,OAAO,CAAC,UAAU;IA+FlB,OAAO,CAAC,oBAAoB;IAW5B,OAAO,CAAC,+BAA+B;IA6BvC;;;;;OAKG;IACH,OAAO,CAAC,iBAAiB;IA8BzB,OAAO,CAAC,sBAAsB;IA4C9B,OAAO,CAAC,mBAAmB;IAQ3B;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IAczB,OAAO,CAAC,qBAAqB;IAsB7B;;;;;;;OAOG;IACH,OAAO,CAAC,WAAW;CAo7EpB"}
|
package/dist/convert.js
CHANGED
|
@@ -27,7 +27,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
27
27
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
28
28
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
29
29
|
};
|
|
30
|
-
var _Converter_instances, _Converter_checkIllegalDecorators, _Converter_throwUnlessAllowInvalidAST, _Converter_throwError;
|
|
30
|
+
var _Converter_instances, _Converter_checkIllegalDecorators, _Converter_throwUnlessAllowInvalidAST, _Converter_withDeprecatedAliasGetter, _Converter_throwError;
|
|
31
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
32
|
exports.Converter = exports.convertError = void 0;
|
|
33
33
|
// There's lots of funny stuff due to the typing of ts.Node
|
|
@@ -53,7 +53,7 @@ class Converter {
|
|
|
53
53
|
* @param options additional options for the conversion
|
|
54
54
|
* @returns the converted ESTreeNode
|
|
55
55
|
*/
|
|
56
|
-
constructor(ast, options
|
|
56
|
+
constructor(ast, options) {
|
|
57
57
|
_Converter_instances.add(this);
|
|
58
58
|
this.esTreeNodeToTSNodeMap = new WeakMap();
|
|
59
59
|
this.tsNodeToESTreeNodeMap = new WeakMap();
|
|
@@ -340,10 +340,11 @@ class Converter {
|
|
|
340
340
|
: null;
|
|
341
341
|
}
|
|
342
342
|
if ('typeArguments' in node) {
|
|
343
|
-
result.typeArguments =
|
|
343
|
+
result.typeArguments =
|
|
344
344
|
node.typeArguments && 'pos' in node.typeArguments
|
|
345
345
|
? this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node)
|
|
346
346
|
: null;
|
|
347
|
+
__classPrivateFieldGet(this, _Converter_instances, "m", _Converter_withDeprecatedAliasGetter).call(this, result, 'typeParameters', 'typeArguments');
|
|
347
348
|
}
|
|
348
349
|
if ('typeParameters' in node) {
|
|
349
350
|
result.typeParameters =
|
|
@@ -1182,18 +1183,14 @@ class Converter {
|
|
|
1182
1183
|
});
|
|
1183
1184
|
return result;
|
|
1184
1185
|
}
|
|
1185
|
-
case SyntaxKind.TaggedTemplateExpression:
|
|
1186
|
-
|
|
1187
|
-
? this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node)
|
|
1188
|
-
: undefined;
|
|
1189
|
-
return this.createNode(node, {
|
|
1186
|
+
case SyntaxKind.TaggedTemplateExpression:
|
|
1187
|
+
return this.createNode(node, __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_withDeprecatedAliasGetter).call(this, {
|
|
1190
1188
|
type: ts_estree_1.AST_NODE_TYPES.TaggedTemplateExpression,
|
|
1191
|
-
typeArguments
|
|
1192
|
-
|
|
1189
|
+
typeArguments: node.typeArguments &&
|
|
1190
|
+
this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node),
|
|
1193
1191
|
tag: this.convertChild(node.tag),
|
|
1194
1192
|
quasi: this.convertChild(node.template),
|
|
1195
|
-
});
|
|
1196
|
-
}
|
|
1193
|
+
}, 'typeParameters', 'typeArguments'));
|
|
1197
1194
|
case SyntaxKind.TemplateHead:
|
|
1198
1195
|
case SyntaxKind.TemplateMiddle:
|
|
1199
1196
|
case SyntaxKind.TemplateTail: {
|
|
@@ -1328,7 +1325,7 @@ class Converter {
|
|
|
1328
1325
|
implementsClause ??= heritageClause;
|
|
1329
1326
|
}
|
|
1330
1327
|
}
|
|
1331
|
-
const result = this.createNode(node, {
|
|
1328
|
+
const result = this.createNode(node, __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_withDeprecatedAliasGetter).call(this, {
|
|
1332
1329
|
type: classNodeType,
|
|
1333
1330
|
abstract: (0, node_utils_1.hasModifier)(SyntaxKind.AbstractKeyword, node),
|
|
1334
1331
|
body: this.createNode(node, {
|
|
@@ -1346,13 +1343,11 @@ class Converter {
|
|
|
1346
1343
|
? this.convertChild(extendsClause.types[0].expression)
|
|
1347
1344
|
: null,
|
|
1348
1345
|
superTypeArguments: undefined,
|
|
1349
|
-
superTypeParameters: undefined,
|
|
1350
1346
|
typeParameters: node.typeParameters &&
|
|
1351
1347
|
this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters),
|
|
1352
|
-
});
|
|
1348
|
+
}, 'superTypeParameters', 'superTypeArguments'));
|
|
1353
1349
|
if (extendsClause?.types[0]?.typeArguments) {
|
|
1354
|
-
|
|
1355
|
-
result.superTypeArguments = result.superTypeParameters =
|
|
1350
|
+
result.superTypeArguments =
|
|
1356
1351
|
this.convertTypeArgumentsToTypeParameterInstantiation(extendsClause.types[0].typeArguments, extendsClause.types[0]);
|
|
1357
1352
|
}
|
|
1358
1353
|
return this.fixExports(node, result);
|
|
@@ -1598,29 +1593,27 @@ class Converter {
|
|
|
1598
1593
|
const args = node.arguments.map(el => this.convertChild(el));
|
|
1599
1594
|
const typeArguments = node.typeArguments &&
|
|
1600
1595
|
this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node);
|
|
1601
|
-
const result = this.createNode(node, {
|
|
1596
|
+
const result = this.createNode(node, __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_withDeprecatedAliasGetter).call(this, {
|
|
1602
1597
|
type: ts_estree_1.AST_NODE_TYPES.CallExpression,
|
|
1603
1598
|
callee,
|
|
1604
1599
|
arguments: args,
|
|
1605
1600
|
optional: node.questionDotToken !== undefined,
|
|
1606
1601
|
typeArguments,
|
|
1607
|
-
|
|
1608
|
-
});
|
|
1602
|
+
}, 'typeParameters', 'typeArguments'));
|
|
1609
1603
|
return this.convertChainExpression(result, node);
|
|
1610
1604
|
}
|
|
1611
1605
|
case SyntaxKind.NewExpression: {
|
|
1612
1606
|
const typeArguments = node.typeArguments &&
|
|
1613
1607
|
this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node);
|
|
1614
1608
|
// NOTE - NewExpression cannot have an optional chain in it
|
|
1615
|
-
return this.createNode(node, {
|
|
1609
|
+
return this.createNode(node, __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_withDeprecatedAliasGetter).call(this, {
|
|
1616
1610
|
type: ts_estree_1.AST_NODE_TYPES.NewExpression,
|
|
1617
1611
|
arguments: node.arguments
|
|
1618
1612
|
? node.arguments.map(el => this.convertChild(el))
|
|
1619
1613
|
: [],
|
|
1620
1614
|
callee: this.convertChild(node.expression),
|
|
1621
1615
|
typeArguments,
|
|
1622
|
-
|
|
1623
|
-
});
|
|
1616
|
+
}, 'typeParameters', 'typeArguments'));
|
|
1624
1617
|
}
|
|
1625
1618
|
case SyntaxKind.ConditionalExpression:
|
|
1626
1619
|
return this.createNode(node, {
|
|
@@ -1748,39 +1741,35 @@ class Converter {
|
|
|
1748
1741
|
children: node.children.map(el => this.convertChild(el)),
|
|
1749
1742
|
});
|
|
1750
1743
|
case SyntaxKind.JsxSelfClosingElement: {
|
|
1751
|
-
const typeArguments = node.typeArguments
|
|
1752
|
-
? this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node)
|
|
1753
|
-
: undefined;
|
|
1754
1744
|
return this.createNode(node, {
|
|
1755
1745
|
type: ts_estree_1.AST_NODE_TYPES.JSXElement,
|
|
1756
1746
|
/**
|
|
1757
1747
|
* Convert SyntaxKind.JsxSelfClosingElement to SyntaxKind.JsxOpeningElement,
|
|
1758
1748
|
* TypeScript does not seem to have the idea of openingElement when tag is self-closing
|
|
1759
1749
|
*/
|
|
1760
|
-
openingElement: this.createNode(node, {
|
|
1750
|
+
openingElement: this.createNode(node, __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_withDeprecatedAliasGetter).call(this, {
|
|
1761
1751
|
type: ts_estree_1.AST_NODE_TYPES.JSXOpeningElement,
|
|
1762
|
-
typeArguments
|
|
1763
|
-
|
|
1752
|
+
typeArguments: node.typeArguments
|
|
1753
|
+
? this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node)
|
|
1754
|
+
: undefined,
|
|
1764
1755
|
selfClosing: true,
|
|
1765
1756
|
name: this.convertJSXTagName(node.tagName, node),
|
|
1766
1757
|
attributes: node.attributes.properties.map(el => this.convertChild(el)),
|
|
1767
1758
|
range: (0, node_utils_1.getRange)(node, this.ast),
|
|
1768
|
-
}),
|
|
1759
|
+
}, 'typeParameters', 'typeArguments')),
|
|
1769
1760
|
closingElement: null,
|
|
1770
1761
|
children: [],
|
|
1771
1762
|
});
|
|
1772
1763
|
}
|
|
1773
1764
|
case SyntaxKind.JsxOpeningElement: {
|
|
1774
|
-
|
|
1775
|
-
this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node);
|
|
1776
|
-
return this.createNode(node, {
|
|
1765
|
+
return this.createNode(node, __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_withDeprecatedAliasGetter).call(this, {
|
|
1777
1766
|
type: ts_estree_1.AST_NODE_TYPES.JSXOpeningElement,
|
|
1778
|
-
typeArguments
|
|
1779
|
-
|
|
1767
|
+
typeArguments: node.typeArguments &&
|
|
1768
|
+
this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node),
|
|
1780
1769
|
selfClosing: false,
|
|
1781
1770
|
name: this.convertJSXTagName(node.tagName, node),
|
|
1782
1771
|
attributes: node.attributes.properties.map(el => this.convertChild(el)),
|
|
1783
|
-
});
|
|
1772
|
+
}, 'typeParameters', 'typeArguments'));
|
|
1784
1773
|
}
|
|
1785
1774
|
case SyntaxKind.JsxClosingElement:
|
|
1786
1775
|
return this.createNode(node, {
|
|
@@ -1846,17 +1835,13 @@ class Converter {
|
|
|
1846
1835
|
});
|
|
1847
1836
|
}
|
|
1848
1837
|
// TypeScript specific
|
|
1849
|
-
case SyntaxKind.TypeReference:
|
|
1850
|
-
|
|
1851
|
-
? this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node)
|
|
1852
|
-
: undefined;
|
|
1853
|
-
return this.createNode(node, {
|
|
1838
|
+
case SyntaxKind.TypeReference:
|
|
1839
|
+
return this.createNode(node, __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_withDeprecatedAliasGetter).call(this, {
|
|
1854
1840
|
type: ts_estree_1.AST_NODE_TYPES.TSTypeReference,
|
|
1855
1841
|
typeName: this.convertChild(node.typeName),
|
|
1856
|
-
typeArguments
|
|
1857
|
-
|
|
1858
|
-
});
|
|
1859
|
-
}
|
|
1842
|
+
typeArguments: node.typeArguments &&
|
|
1843
|
+
this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node),
|
|
1844
|
+
}, 'typeParameters', 'typeArguments'));
|
|
1860
1845
|
case SyntaxKind.TypeParameter: {
|
|
1861
1846
|
return this.createNode(node, {
|
|
1862
1847
|
type: ts_estree_1.AST_NODE_TYPES.TSTypeParameter,
|
|
@@ -1865,6 +1850,7 @@ class Converter {
|
|
|
1865
1850
|
default: node.default ? this.convertChild(node.default) : undefined,
|
|
1866
1851
|
in: (0, node_utils_1.hasModifier)(SyntaxKind.InKeyword, node),
|
|
1867
1852
|
out: (0, node_utils_1.hasModifier)(SyntaxKind.OutKeyword, node),
|
|
1853
|
+
const: (0, node_utils_1.hasModifier)(SyntaxKind.ConstKeyword, node),
|
|
1868
1854
|
});
|
|
1869
1855
|
}
|
|
1870
1856
|
case SyntaxKind.ThisType:
|
|
@@ -1922,16 +1908,13 @@ class Converter {
|
|
|
1922
1908
|
falseType: this.convertChild(node.falseType),
|
|
1923
1909
|
});
|
|
1924
1910
|
}
|
|
1925
|
-
case SyntaxKind.TypeQuery:
|
|
1926
|
-
|
|
1927
|
-
this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node);
|
|
1928
|
-
return this.createNode(node, {
|
|
1911
|
+
case SyntaxKind.TypeQuery:
|
|
1912
|
+
return this.createNode(node, __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_withDeprecatedAliasGetter).call(this, {
|
|
1929
1913
|
type: ts_estree_1.AST_NODE_TYPES.TSTypeQuery,
|
|
1930
1914
|
exprName: this.convertChild(node.exprName),
|
|
1931
|
-
typeArguments
|
|
1932
|
-
|
|
1933
|
-
});
|
|
1934
|
-
}
|
|
1915
|
+
typeArguments: node.typeArguments &&
|
|
1916
|
+
this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node),
|
|
1917
|
+
}, 'typeParameters', 'typeArguments'));
|
|
1935
1918
|
case SyntaxKind.MappedType: {
|
|
1936
1919
|
return this.createNode(node, {
|
|
1937
1920
|
type: ts_estree_1.AST_NODE_TYPES.TSMappedType,
|
|
@@ -2038,15 +2021,12 @@ class Converter {
|
|
|
2038
2021
|
: parentKind === SyntaxKind.HeritageClause
|
|
2039
2022
|
? ts_estree_1.AST_NODE_TYPES.TSClassImplements
|
|
2040
2023
|
: ts_estree_1.AST_NODE_TYPES.TSInstantiationExpression;
|
|
2041
|
-
|
|
2042
|
-
this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node);
|
|
2043
|
-
const result = this.createNode(node, {
|
|
2024
|
+
return this.createNode(node, __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_withDeprecatedAliasGetter).call(this, {
|
|
2044
2025
|
type,
|
|
2045
2026
|
expression: this.convertChild(node.expression),
|
|
2046
|
-
typeArguments
|
|
2047
|
-
|
|
2048
|
-
});
|
|
2049
|
-
return result;
|
|
2027
|
+
typeArguments: node.typeArguments &&
|
|
2028
|
+
this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node),
|
|
2029
|
+
}, 'typeParameters', 'typeArguments'));
|
|
2050
2030
|
}
|
|
2051
2031
|
case SyntaxKind.InterfaceDeclaration: {
|
|
2052
2032
|
__classPrivateFieldGet(this, _Converter_instances, "m", _Converter_checkIllegalDecorators).call(this, node);
|
|
@@ -2101,17 +2081,15 @@ class Converter {
|
|
|
2101
2081
|
const token = (0, node_utils_1.findNextToken)(node.getFirstToken(), node, this.ast);
|
|
2102
2082
|
range[0] = token.getStart(this.ast);
|
|
2103
2083
|
}
|
|
2104
|
-
const
|
|
2105
|
-
? this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node)
|
|
2106
|
-
: null;
|
|
2107
|
-
const result = this.createNode(node, {
|
|
2084
|
+
const result = this.createNode(node, __classPrivateFieldGet(this, _Converter_instances, "m", _Converter_withDeprecatedAliasGetter).call(this, {
|
|
2108
2085
|
type: ts_estree_1.AST_NODE_TYPES.TSImportType,
|
|
2109
2086
|
argument: this.convertChild(node.argument),
|
|
2110
2087
|
qualifier: this.convertChild(node.qualifier),
|
|
2111
|
-
typeArguments
|
|
2112
|
-
|
|
2088
|
+
typeArguments: node.typeArguments
|
|
2089
|
+
? this.convertTypeArgumentsToTypeParameterInstantiation(node.typeArguments, node)
|
|
2090
|
+
: null,
|
|
2113
2091
|
range: range,
|
|
2114
|
-
});
|
|
2092
|
+
}, 'typeParameters', 'typeArguments'));
|
|
2115
2093
|
if (node.isTypeOf) {
|
|
2116
2094
|
return this.createNode(node, {
|
|
2117
2095
|
type: ts_estree_1.AST_NODE_TYPES.TSTypeQuery,
|
|
@@ -2395,6 +2373,23 @@ _Converter_instances = new WeakSet(), _Converter_checkIllegalDecorators = functi
|
|
|
2395
2373
|
if (!this.options.allowInvalidAST) {
|
|
2396
2374
|
__classPrivateFieldGet(this, _Converter_instances, "m", _Converter_throwError).call(this, node, message);
|
|
2397
2375
|
}
|
|
2376
|
+
}, _Converter_withDeprecatedAliasGetter = function _Converter_withDeprecatedAliasGetter(node, aliasKey, valueKey) {
|
|
2377
|
+
let errored = false;
|
|
2378
|
+
Object.defineProperty(node, aliasKey, {
|
|
2379
|
+
get: this.options.suppressDeprecatedPropertyWarnings
|
|
2380
|
+
? () => node[valueKey]
|
|
2381
|
+
: () => {
|
|
2382
|
+
if (!this.options.suppressDeprecatedPropertyWarnings) {
|
|
2383
|
+
if (!errored) {
|
|
2384
|
+
// eslint-disable-next-line no-console
|
|
2385
|
+
console.warn(`The '${aliasKey}' property is deprecated on ${node.type} nodes. Use '${valueKey}' instead. See https://typescript-eslint.io/linting/troubleshooting#the-key-property-is-deprecated-on-type-nodes-use-key-instead-warnings.`);
|
|
2386
|
+
errored = true;
|
|
2387
|
+
}
|
|
2388
|
+
}
|
|
2389
|
+
return node[valueKey];
|
|
2390
|
+
},
|
|
2391
|
+
});
|
|
2392
|
+
return node;
|
|
2398
2393
|
}, _Converter_throwError = function _Converter_throwError(node, message) {
|
|
2399
2394
|
let start;
|
|
2400
2395
|
let end;
|