diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 457502f4c14..53d77338024 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -2797,6 +2797,7 @@ namespace ts { // If this is a property-parameter, then also declare the property symbol into the // containing class. if (isParameterPropertyDeclaration(node)) { + // tslint:disable-next-line no-unnecessary-type-assertion const classDeclaration = node.parent.parent; declareSymbol(classDeclaration.symbol.members!, classDeclaration.symbol, node, SymbolFlags.Property | (node.questionToken ? SymbolFlags.Optional : SymbolFlags.None), SymbolFlags.PropertyExcludes); } diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 3b70ce8da11..d0c99aada0c 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -9684,6 +9684,7 @@ namespace ts { break; } } + // tslint:disable-next-line no-unnecessary-type-assertion return links.resolvedType!; // TODO: GH#18217 } @@ -25738,7 +25739,9 @@ namespace ts { if (node.kind === SyntaxKind.VariableDeclaration || node.kind === SyntaxKind.BindingElement) { checkVarDeclaredNamesNotShadowed(node); } + // tslint:disable-next-line no-unnecessary-type-assertion checkCollisionWithRequireExportsInGeneratedCode(node, node.name); + // tslint:disable-next-line no-unnecessary-type-assertion checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name); } } @@ -30401,9 +30404,11 @@ namespace ts { node.kind === SyntaxKind.FunctionExpression || node.kind === SyntaxKind.MethodDeclaration); if (node.flags & NodeFlags.Ambient) { + // tslint:disable-next-line no-unnecessary-type-assertion return grammarErrorOnNode(node.asteriskToken!, Diagnostics.Generators_are_not_allowed_in_an_ambient_context); } if (!node.body) { + // tslint:disable-next-line no-unnecessary-type-assertion return grammarErrorOnNode(node.asteriskToken!, Diagnostics.An_overload_signature_cannot_be_declared_as_a_generator); } } @@ -30444,6 +30449,7 @@ namespace ts { // Modifiers are never allowed on properties except for 'async' on a method declaration if (prop.modifiers) { + // tslint:disable-next-line no-unnecessary-type-assertion for (const mod of prop.modifiers!) { // TODO: GH#19955 if (mod.kind !== SyntaxKind.AsyncKeyword || prop.kind !== SyntaxKind.MethodDeclaration) { grammarErrorOnNode(mod, Diagnostics._0_modifier_cannot_be_used_here, getTextOfNode(mod)); diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 8baeae5d84a..242a5f4eda5 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -251,6 +251,7 @@ namespace ts { // Explicitly do not passthru either `inline` option }); if (emitOnlyDtsFiles && declarationTransform.transformed[0].kind === SyntaxKind.SourceFile) { + // tslint:disable-next-line no-unnecessary-type-assertion const sourceFile = declarationTransform.transformed[0] as SourceFile; exportedModulesFromDeclarationEmit = sourceFile.exportedModulesFromDeclarationEmit; } diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index f0c6ec93366..e45b43a7209 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -3489,10 +3489,12 @@ namespace ts { } if (member.kind === SyntaxKind.GetAccessor && !getAccessor) { + // tslint:disable-next-line no-unnecessary-type-assertion getAccessor = member; } if (member.kind === SyntaxKind.SetAccessor && !setAccessor) { + // tslint:disable-next-line no-unnecessary-type-assertion setAccessor = member; } }