Skip to content

Commit 2466109

Browse files
authored
Fix build/lint due to differences in master and LKG (#32450)
1 parent e3ba3aa commit 2466109

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/compiler/emitter.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,11 @@ namespace ts {
411411
}
412412
);
413413
if (emitOnlyDtsFiles && declarationTransform.transformed[0].kind === SyntaxKind.SourceFile) {
414-
const sourceFile = declarationTransform.transformed[0] as SourceFile;
414+
// Improved narrowing in master/3.6 makes this cast unnecessary, triggering a lint rule.
415+
// But at the same time, the LKG (3.5) necessitates it because it doesn’t narrow.
416+
// Once the LKG is updated to 3.6, this comment, the cast to `SourceFile`, and the
417+
// tslint directive can be all be removed.
418+
const sourceFile = declarationTransform.transformed[0] as SourceFile; // tslint:disable-line
415419
exportedModulesFromDeclarationEmit = sourceFile.exportedModulesFromDeclarationEmit;
416420
}
417421
}

0 commit comments

Comments
 (0)