Update typescript-eslint to latest (#43381)
This commit is contained in:
parent
eb804a9706
commit
fbd7f7db20
10762
package-lock.json
generated
10762
package-lock.json
generated
File diff suppressed because it is too large
Load diff
11
package.json
11
package.json
|
@ -53,9 +53,9 @@
|
|||
"@types/source-map-support": "latest",
|
||||
"@types/through2": "latest",
|
||||
"@types/xml2js": "^0.4.0",
|
||||
"@typescript-eslint/eslint-plugin": "4.5.0",
|
||||
"@typescript-eslint/experimental-utils": "4.5.0",
|
||||
"@typescript-eslint/parser": "4.5.0",
|
||||
"@typescript-eslint/eslint-plugin": "^4.19.0",
|
||||
"@typescript-eslint/experimental-utils": "^4.19.0",
|
||||
"@typescript-eslint/parser": "^4.19.0",
|
||||
"async": "latest",
|
||||
"azure-devops-node-api": "^10.1.0",
|
||||
"browser-resolve": "^1.11.2",
|
||||
|
@ -94,7 +94,7 @@
|
|||
"remove-internal": "^2.9.2",
|
||||
"source-map-support": "latest",
|
||||
"through2": "latest",
|
||||
"typescript": "^4.0.0-dev.20200624",
|
||||
"typescript": "^4.2.3",
|
||||
"vinyl": "latest",
|
||||
"vinyl-sourcemaps-apply": "latest",
|
||||
"xml2js": "^0.4.19"
|
||||
|
@ -129,6 +129,5 @@
|
|||
},
|
||||
"volta": {
|
||||
"node": "14.15.5"
|
||||
},
|
||||
"dependencies": {}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11616,7 +11616,7 @@ namespace ts {
|
|||
}
|
||||
}
|
||||
|
||||
result.declarations = declarations!;
|
||||
result.declarations = declarations;
|
||||
result.nameType = nameType;
|
||||
if (propTypes.length > 2) {
|
||||
// When `propTypes` has the potential to explode in size when normalized, defer normalization until absolutely needed
|
||||
|
|
|
@ -1166,8 +1166,8 @@ namespace ts {
|
|||
tempFlagsStack = [];
|
||||
tempFlags = TempFlags.Auto;
|
||||
reservedNamesStack = [];
|
||||
currentSourceFile = undefined!;
|
||||
currentLineMap = undefined!;
|
||||
currentSourceFile = undefined;
|
||||
currentLineMap = undefined;
|
||||
detachedCommentsInfo = undefined;
|
||||
setWriter(/*output*/ undefined, /*_sourceMapGenerator*/ undefined);
|
||||
}
|
||||
|
@ -3153,10 +3153,10 @@ namespace ts {
|
|||
|
||||
let body = node.body;
|
||||
if (!body) return writeTrailingSemicolon();
|
||||
while (body.kind === SyntaxKind.ModuleDeclaration) {
|
||||
while (body && isModuleDeclaration(body)) {
|
||||
writePunctuation(".");
|
||||
emit((<ModuleDeclaration>body).name);
|
||||
body = (<ModuleDeclaration>body).body!;
|
||||
emit(body.name);
|
||||
body = body.body;
|
||||
}
|
||||
|
||||
writeSpace();
|
||||
|
|
|
@ -555,9 +555,9 @@ namespace ts {
|
|||
// NOTE: The following properties are commonly set by the binder and are added here to
|
||||
// ensure declarations have a stable shape.
|
||||
node.symbol = undefined!; // initialized by binder
|
||||
node.localSymbol = undefined!; // initialized by binder
|
||||
node.locals = undefined!; // initialized by binder
|
||||
node.nextContainer = undefined!; // initialized by binder
|
||||
node.localSymbol = undefined; // initialized by binder
|
||||
node.locals = undefined; // initialized by binder
|
||||
node.nextContainer = undefined; // initialized by binder
|
||||
return node;
|
||||
}
|
||||
|
||||
|
|
|
@ -1014,7 +1014,7 @@ namespace ts {
|
|||
jsDocDiagnostics = undefined!;
|
||||
parsingContext = 0;
|
||||
identifiers = undefined!;
|
||||
notParenthesizedArrow = undefined!;
|
||||
notParenthesizedArrow = undefined;
|
||||
topLevel = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -534,7 +534,7 @@ namespace ts {
|
|||
if (shouldTransformPrivateElements) {
|
||||
if (isDestructuringAssignment(node)) {
|
||||
const savedPendingExpressions = pendingExpressions;
|
||||
pendingExpressions = undefined!;
|
||||
pendingExpressions = undefined;
|
||||
node = factory.updateBinaryExpression(
|
||||
node,
|
||||
visitNode(node.left, visitorDestructuringTarget),
|
||||
|
|
|
@ -133,7 +133,7 @@ namespace ts {
|
|||
moduleInfo = undefined!;
|
||||
exportFunction = undefined!;
|
||||
contextObject = undefined!;
|
||||
hoistedStatements = undefined!;
|
||||
hoistedStatements = undefined;
|
||||
enclosingBlockScopedContainer = undefined!;
|
||||
return updated;
|
||||
}
|
||||
|
|
|
@ -5628,8 +5628,8 @@ namespace ts {
|
|||
function Symbol(this: Symbol, flags: SymbolFlags, name: __String) {
|
||||
this.flags = flags;
|
||||
this.escapedName = name;
|
||||
this.declarations = undefined!;
|
||||
this.valueDeclaration = undefined!;
|
||||
this.declarations = undefined;
|
||||
this.valueDeclaration = undefined;
|
||||
this.id = undefined;
|
||||
this.mergeId = undefined;
|
||||
this.parent = undefined;
|
||||
|
|
|
@ -962,12 +962,14 @@ namespace FourSlash {
|
|||
}
|
||||
|
||||
/** Use `getProgram` instead of accessing this directly. */
|
||||
private _program: ts.Program | undefined;
|
||||
private _program: ts.Program | undefined | "missing";
|
||||
/** Use `getChecker` instead of accessing this directly. */
|
||||
private _checker: ts.TypeChecker | undefined;
|
||||
|
||||
private getProgram(): ts.Program {
|
||||
return this._program || (this._program = this.languageService.getProgram()!); // TODO: GH#18217
|
||||
if (!this._program) this._program = this.languageService.getProgram() || "missing";
|
||||
if (this._program === "missing") ts.Debug.fail("Could not retrieve program from language service");
|
||||
return this._program;
|
||||
}
|
||||
|
||||
private getChecker() {
|
||||
|
|
|
@ -772,9 +772,9 @@ namespace ts.server {
|
|||
|
||||
this.rootFiles = undefined!;
|
||||
this.rootFilesMap = undefined!;
|
||||
this.externalFiles = undefined!;
|
||||
this.program = undefined!;
|
||||
this.builderState = undefined!;
|
||||
this.externalFiles = undefined;
|
||||
this.program = undefined;
|
||||
this.builderState = undefined;
|
||||
this.resolutionCache.clear();
|
||||
this.resolutionCache = undefined!;
|
||||
this.cachedUnresolvedImportsPerFile = undefined!;
|
||||
|
@ -784,7 +784,7 @@ namespace ts.server {
|
|||
// Clean up file watchers waiting for missing files
|
||||
if (this.missingFilesMap) {
|
||||
clearMap(this.missingFilesMap, closeFileWatcher);
|
||||
this.missingFilesMap = undefined!;
|
||||
this.missingFilesMap = undefined;
|
||||
}
|
||||
this.clearGeneratedFileWatch();
|
||||
this.clearInvalidateResolutionOfFailedLookupTimer();
|
||||
|
@ -1087,7 +1087,7 @@ namespace ts.server {
|
|||
const start = timestamp();
|
||||
this.hasInvalidatedResolution = this.resolutionCache.createHasInvalidatedResolution();
|
||||
this.resolutionCache.startCachingPerDirectoryResolution();
|
||||
this.program = this.languageService.getProgram()!; // TODO: GH#18217
|
||||
this.program = this.languageService.getProgram(); // TODO: GH#18217
|
||||
this.dirty = false;
|
||||
this.resolutionCache.finishCachingPerDirectoryResolution();
|
||||
|
||||
|
@ -1096,8 +1096,9 @@ namespace ts.server {
|
|||
// bump up the version if
|
||||
// - oldProgram is not set - this is a first time updateGraph is called
|
||||
// - newProgram is different from the old program and structure of the old program was not reused.
|
||||
const hasNewProgram = this.program && (!oldProgram || (this.program !== oldProgram && !(this.program.structureIsReused & StructureIsReused.Completely)));
|
||||
if (hasNewProgram) {
|
||||
let hasNewProgram = false;
|
||||
if (this.program && (!oldProgram || (this.program !== oldProgram && !(this.program.structureIsReused & StructureIsReused.Completely)))) {
|
||||
hasNewProgram = true;
|
||||
if (oldProgram) {
|
||||
for (const f of oldProgram.getSourceFiles()) {
|
||||
const newFile = this.program.getSourceFileByPath(f.resolvedPath);
|
||||
|
@ -1163,7 +1164,7 @@ namespace ts.server {
|
|||
}
|
||||
|
||||
if (!this.importSuggestionsCache.isEmpty()) {
|
||||
if (this.hasAddedorRemovedFiles || oldProgram && !this.program.structureIsReused) {
|
||||
if (this.hasAddedorRemovedFiles || oldProgram && !this.program!.structureIsReused) {
|
||||
this.importSuggestionsCache.clear();
|
||||
}
|
||||
else if (this.dirtyFilesForSuggestions && oldProgram && this.program) {
|
||||
|
@ -1204,7 +1205,7 @@ namespace ts.server {
|
|||
this.print(/*writeProjectFileNames*/ true);
|
||||
}
|
||||
else if (this.program !== oldProgram) {
|
||||
this.writeLog(`Different program with same set of files:: structureIsReused:: ${this.program.structureIsReused}`);
|
||||
this.writeLog(`Different program with same set of files:: structureIsReused:: ${this.program?.structureIsReused}`);
|
||||
}
|
||||
return hasNewProgram;
|
||||
}
|
||||
|
|
|
@ -1326,7 +1326,7 @@ namespace ts {
|
|||
public close(): void {
|
||||
// Forget all the registered shims
|
||||
clear(this._shims);
|
||||
this.documentRegistry = undefined!;
|
||||
this.documentRegistry = undefined;
|
||||
}
|
||||
|
||||
public registerShim(shim: Shim): void {
|
||||
|
|
|
@ -197,13 +197,13 @@ namespace ts.SymbolDisplay {
|
|||
}
|
||||
|
||||
if (callExpressionLike) {
|
||||
signature = typeChecker.getResolvedSignature(callExpressionLike)!; // TODO: GH#18217
|
||||
signature = typeChecker.getResolvedSignature(callExpressionLike); // TODO: GH#18217
|
||||
|
||||
const useConstructSignatures = callExpressionLike.kind === SyntaxKind.NewExpression || (isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === SyntaxKind.SuperKeyword);
|
||||
|
||||
const allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures();
|
||||
|
||||
if (!contains(allSignatures, signature.target) && !contains(allSignatures, signature)) {
|
||||
if (signature && !contains(allSignatures, signature.target) && !contains(allSignatures, signature)) {
|
||||
// Get the first signature if there is one -- allSignatures may contain
|
||||
// either the original signature or its target, so check for either
|
||||
signature = allSignatures.length ? allSignatures[0] : undefined;
|
||||
|
@ -278,7 +278,7 @@ namespace ts.SymbolDisplay {
|
|||
if (locationIsSymbolDeclaration) {
|
||||
const allSignatures = functionDeclaration.kind === SyntaxKind.Constructor ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures();
|
||||
if (!typeChecker.isImplementationOfOverload(functionDeclaration)) {
|
||||
signature = typeChecker.getSignatureFromDeclaration(functionDeclaration)!; // TODO: GH#18217
|
||||
signature = typeChecker.getSignatureFromDeclaration(functionDeclaration); // TODO: GH#18217
|
||||
}
|
||||
else {
|
||||
signature = allSignatures[0];
|
||||
|
@ -294,8 +294,9 @@ namespace ts.SymbolDisplay {
|
|||
addPrefixForAnyFunctionOrVar(functionDeclaration.kind === SyntaxKind.CallSignature &&
|
||||
!(type.symbol.flags & SymbolFlags.TypeLiteral || type.symbol.flags & SymbolFlags.ObjectLiteral) ? type.symbol : symbol, symbolKind);
|
||||
}
|
||||
|
||||
addSignatureDisplayParts(signature, allSignatures);
|
||||
if (signature) {
|
||||
addSignatureDisplayParts(signature, allSignatures);
|
||||
}
|
||||
hasAddedSymbolInfo = true;
|
||||
hasMultipleSignatures = allSignatures.length > 1;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue