Skip to content

Commit fbd7f7d

Browse files
authored
Update typescript-eslint to latest (#43381)
1 parent eb804a9 commit fbd7f7d

File tree

13 files changed

+10697
-142
lines changed

13 files changed

+10697
-142
lines changed

package-lock.json

Lines changed: 10657 additions & 105 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@
5353
"@types/source-map-support": "latest",
5454
"@types/through2": "latest",
5555
"@types/xml2js": "^0.4.0",
56-
"@typescript-eslint/eslint-plugin": "4.5.0",
57-
"@typescript-eslint/experimental-utils": "4.5.0",
58-
"@typescript-eslint/parser": "4.5.0",
56+
"@typescript-eslint/eslint-plugin": "^4.19.0",
57+
"@typescript-eslint/experimental-utils": "^4.19.0",
58+
"@typescript-eslint/parser": "^4.19.0",
5959
"async": "latest",
6060
"azure-devops-node-api": "^10.1.0",
6161
"browser-resolve": "^1.11.2",
@@ -94,7 +94,7 @@
9494
"remove-internal": "^2.9.2",
9595
"source-map-support": "latest",
9696
"through2": "latest",
97-
"typescript": "^4.0.0-dev.20200624",
97+
"typescript": "^4.2.3",
9898
"vinyl": "latest",
9999
"vinyl-sourcemaps-apply": "latest",
100100
"xml2js": "^0.4.19"
@@ -129,6 +129,5 @@
129129
},
130130
"volta": {
131131
"node": "14.15.5"
132-
},
133-
"dependencies": {}
132+
}
134133
}

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11616,7 +11616,7 @@ namespace ts {
1161611616
}
1161711617
}
1161811618

11619-
result.declarations = declarations!;
11619+
result.declarations = declarations;
1162011620
result.nameType = nameType;
1162111621
if (propTypes.length > 2) {
1162211622
// When `propTypes` has the potential to explode in size when normalized, defer normalization until absolutely needed

src/compiler/emitter.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,8 +1166,8 @@ namespace ts {
11661166
tempFlagsStack = [];
11671167
tempFlags = TempFlags.Auto;
11681168
reservedNamesStack = [];
1169-
currentSourceFile = undefined!;
1170-
currentLineMap = undefined!;
1169+
currentSourceFile = undefined;
1170+
currentLineMap = undefined;
11711171
detachedCommentsInfo = undefined;
11721172
setWriter(/*output*/ undefined, /*_sourceMapGenerator*/ undefined);
11731173
}
@@ -3153,10 +3153,10 @@ namespace ts {
31533153

31543154
let body = node.body;
31553155
if (!body) return writeTrailingSemicolon();
3156-
while (body.kind === SyntaxKind.ModuleDeclaration) {
3156+
while (body && isModuleDeclaration(body)) {
31573157
writePunctuation(".");
3158-
emit((<ModuleDeclaration>body).name);
3159-
body = (<ModuleDeclaration>body).body!;
3158+
emit(body.name);
3159+
body = body.body;
31603160
}
31613161

31623162
writeSpace();

src/compiler/factory/nodeFactory.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -555,9 +555,9 @@ namespace ts {
555555
// NOTE: The following properties are commonly set by the binder and are added here to
556556
// ensure declarations have a stable shape.
557557
node.symbol = undefined!; // initialized by binder
558-
node.localSymbol = undefined!; // initialized by binder
559-
node.locals = undefined!; // initialized by binder
560-
node.nextContainer = undefined!; // initialized by binder
558+
node.localSymbol = undefined; // initialized by binder
559+
node.locals = undefined; // initialized by binder
560+
node.nextContainer = undefined; // initialized by binder
561561
return node;
562562
}
563563

src/compiler/parser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,7 @@ namespace ts {
10141014
jsDocDiagnostics = undefined!;
10151015
parsingContext = 0;
10161016
identifiers = undefined!;
1017-
notParenthesizedArrow = undefined!;
1017+
notParenthesizedArrow = undefined;
10181018
topLevel = true;
10191019
}
10201020

src/compiler/transformers/classFields.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ namespace ts {
534534
if (shouldTransformPrivateElements) {
535535
if (isDestructuringAssignment(node)) {
536536
const savedPendingExpressions = pendingExpressions;
537-
pendingExpressions = undefined!;
537+
pendingExpressions = undefined;
538538
node = factory.updateBinaryExpression(
539539
node,
540540
visitNode(node.left, visitorDestructuringTarget),

src/compiler/transformers/module/system.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ namespace ts {
133133
moduleInfo = undefined!;
134134
exportFunction = undefined!;
135135
contextObject = undefined!;
136-
hoistedStatements = undefined!;
136+
hoistedStatements = undefined;
137137
enclosingBlockScopedContainer = undefined!;
138138
return updated;
139139
}

src/compiler/utilities.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5628,8 +5628,8 @@ namespace ts {
56285628
function Symbol(this: Symbol, flags: SymbolFlags, name: __String) {
56295629
this.flags = flags;
56305630
this.escapedName = name;
5631-
this.declarations = undefined!;
5632-
this.valueDeclaration = undefined!;
5631+
this.declarations = undefined;
5632+
this.valueDeclaration = undefined;
56335633
this.id = undefined;
56345634
this.mergeId = undefined;
56355635
this.parent = undefined;

src/harness/fourslashImpl.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -962,12 +962,14 @@ namespace FourSlash {
962962
}
963963

964964
/** Use `getProgram` instead of accessing this directly. */
965-
private _program: ts.Program | undefined;
965+
private _program: ts.Program | undefined | "missing";
966966
/** Use `getChecker` instead of accessing this directly. */
967967
private _checker: ts.TypeChecker | undefined;
968968

969969
private getProgram(): ts.Program {
970-
return this._program || (this._program = this.languageService.getProgram()!); // TODO: GH#18217
970+
if (!this._program) this._program = this.languageService.getProgram() || "missing";
971+
if (this._program === "missing") ts.Debug.fail("Could not retrieve program from language service");
972+
return this._program;
971973
}
972974

973975
private getChecker() {

0 commit comments

Comments
 (0)