Skip to content

Commit ef079c9

Browse files
authored
Update to TS 5.5.2 (#58947)
1 parent aa249c0 commit ef079c9

File tree

8 files changed

+19
-22
lines changed

8 files changed

+19
-22
lines changed

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
"playwright": "^1.44.1",
7777
"source-map-support": "^0.5.21",
7878
"tslib": "^2.6.3",
79-
"typescript": "^5.4.5",
79+
"typescript": "^5.5.2",
8080
"which": "^3.0.1"
8181
},
8282
"overrides": {

src/compiler/checker.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4617,7 +4617,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
46174617
}
46184618
if (moduleResolutionKind === ModuleResolutionKind.Node16 || moduleResolutionKind === ModuleResolutionKind.NodeNext) {
46194619
const isSyncImport = (currentSourceFile.impliedNodeFormat === ModuleKind.CommonJS && !findAncestor(location, isImportCall)) || !!findAncestor(location, isImportEqualsDeclaration);
4620-
const overrideHost = findAncestor(location, l => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l)) as ImportTypeNode | ImportDeclaration | ExportDeclaration | undefined;
4620+
const overrideHost = findAncestor(location, l => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l));
46214621
// An override clause will take effect for type-only imports and import types, and allows importing the types across formats, regardless of
46224622
// normal mode restrictions
46234623
if (isSyncImport && sourceFile.impliedNodeFormat === ModuleKind.ESNext && !hasResolutionModeOverride(overrideHost)) {
@@ -13412,7 +13412,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
1341213412
links[resolutionKind] = resolved || emptySymbols;
1341313413
}
1341413414

13415-
return links[resolutionKind]!;
13415+
return links[resolutionKind];
1341613416
}
1341713417

1341813418
/**
@@ -18827,7 +18827,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
1882718827
function getSimplifiedIndexedAccessType(type: IndexedAccessType, writing: boolean): Type {
1882818828
const cache = writing ? "simplifiedForWriting" : "simplifiedForReading";
1882918829
if (type[cache]) {
18830-
return type[cache] === circularConstraintType ? type : type[cache]!;
18830+
return type[cache] === circularConstraintType ? type : type[cache];
1883118831
}
1883218832
type[cache] = circularConstraintType;
1883318833
// We recursively simplify the object type as it may in turn be an indexed access type. For example, with

src/compiler/watch.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,18 +279,18 @@ export function getErrorSummaryText(
279279
) {
280280
if (errorCount === 0) return "";
281281
const nonNilFiles = filesInError.filter(fileInError => fileInError !== undefined);
282-
const distinctFileNamesWithLines = nonNilFiles.map(fileInError => `${fileInError!.fileName}:${fileInError!.line}`)
282+
const distinctFileNamesWithLines = nonNilFiles.map(fileInError => `${fileInError.fileName}:${fileInError.line}`)
283283
.filter((value, index, self) => self.indexOf(value) === index);
284284

285285
const firstFileReference = nonNilFiles[0] && prettyPathForFileError(nonNilFiles[0], host.getCurrentDirectory());
286286

287287
let messageAndArgs: DiagnosticAndArguments;
288288
if (errorCount === 1) {
289-
messageAndArgs = filesInError[0] !== undefined ? [Diagnostics.Found_1_error_in_0, firstFileReference!] : [Diagnostics.Found_1_error];
289+
messageAndArgs = filesInError[0] !== undefined ? [Diagnostics.Found_1_error_in_0, firstFileReference] : [Diagnostics.Found_1_error];
290290
}
291291
else {
292292
messageAndArgs = distinctFileNamesWithLines.length === 0 ? [Diagnostics.Found_0_errors, errorCount] :
293-
distinctFileNamesWithLines.length === 1 ? [Diagnostics.Found_0_errors_in_the_same_file_starting_at_Colon_1, errorCount, firstFileReference!] :
293+
distinctFileNamesWithLines.length === 1 ? [Diagnostics.Found_0_errors_in_the_same_file_starting_at_Colon_1, errorCount, firstFileReference] :
294294
[Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length];
295295
}
296296

src/services/codefixes/fixAddMissingMember.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ function getInfo(sourceFile: SourceFile, tokenPos: number, errorCode: number, ch
385385
if (!classDeclaration && isPrivateIdentifier(token)) return undefined;
386386

387387
// Prefer to change the class instead of the interface if they are merged
388-
const declaration = classDeclaration || find(symbol.declarations, d => isInterfaceDeclaration(d) || isTypeLiteralNode(d)) as InterfaceDeclaration | TypeLiteralNode | undefined;
388+
const declaration = classDeclaration || find(symbol.declarations, d => isInterfaceDeclaration(d) || isTypeLiteralNode(d));
389389
if (declaration && !isSourceFileFromLibrary(program, declaration.getSourceFile())) {
390390
const makeStatic = !isTypeLiteralNode(declaration) && ((leftExpressionType as TypeReference).target || leftExpressionType) !== checker.getDeclaredTypeOfSymbol(symbol);
391391
if (makeStatic && (isPrivateIdentifier(token) || isInterfaceDeclaration(declaration))) return undefined;

src/services/findAllReferences.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ import {
201201
isVoidExpression,
202202
isWriteAccess,
203203
JSDocPropertyLikeTag,
204-
JSDocTag,
205204
length,
206205
map,
207206
mapDefined,
@@ -242,7 +241,6 @@ import {
242241
skipAlias,
243242
some,
244243
SourceFile,
245-
Statement,
246244
StringLiteral,
247245
StringLiteralLike,
248246
stripQuotes,
@@ -377,7 +375,7 @@ function getContextNodeForNodeEntry(node: Node): ContextNode | undefined {
377375
const declOrStatement = findAncestor(validImport, node =>
378376
isDeclaration(node) ||
379377
isStatement(node) ||
380-
isJSDocTag(node))! as NamedDeclaration | Statement | JSDocTag;
378+
isJSDocTag(node))!;
381379
return isDeclaration(declOrStatement) ?
382380
getContextNode(declOrStatement) :
383381
declOrStatement;

src/services/goToDefinition.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,13 @@ export function getDefinitionAtPosition(program: Program, sourceFile: SourceFile
159159
}
160160

161161
if (node.kind === SyntaxKind.AwaitKeyword) {
162-
const functionDeclaration = findAncestor(node, n => isFunctionLikeDeclaration(n)) as FunctionLikeDeclaration | undefined;
162+
const functionDeclaration = findAncestor(node, n => isFunctionLikeDeclaration(n));
163163
const isAsyncFunction = functionDeclaration && some(functionDeclaration.modifiers, node => node.kind === SyntaxKind.AsyncKeyword);
164164
return isAsyncFunction ? [createDefinitionFromSignatureDeclaration(typeChecker, functionDeclaration)] : undefined;
165165
}
166166

167167
if (node.kind === SyntaxKind.YieldKeyword) {
168-
const functionDeclaration = findAncestor(node, n => isFunctionLikeDeclaration(n)) as FunctionLikeDeclaration | undefined;
168+
const functionDeclaration = findAncestor(node, n => isFunctionLikeDeclaration(n));
169169
const isGeneratorFunction = functionDeclaration && functionDeclaration.asteriskToken;
170170
return isGeneratorFunction ? [createDefinitionFromSignatureDeclaration(typeChecker, functionDeclaration)] : undefined;
171171
}

src/services/rename.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import {
1616
getTextOfIdentifierOrLiteral,
1717
getTextOfNode,
1818
getTouchingPropertyName,
19-
ImportSpecifier,
2019
isExternalModuleNameRelative,
2120
isIdentifier,
2221
isImportOrExportSpecifierName,
@@ -136,7 +135,7 @@ function wouldRenameInOtherNodeModules(
136135
): DiagnosticMessage | undefined {
137136
if (!preferences.providePrefixAndSuffixTextForRename && symbol.flags & SymbolFlags.Alias) {
138137
const importSpecifier = symbol.declarations && find(symbol.declarations, decl => isImportSpecifier(decl));
139-
if (importSpecifier && !(importSpecifier as ImportSpecifier).propertyName) {
138+
if (importSpecifier && !importSpecifier.propertyName) {
140139
symbol = checker.getAliasedSymbol(symbol);
141140
}
142141
}

0 commit comments

Comments
 (0)