Skip to content

Commit 791a0e4

Browse files
Don't actually emit declarations when we just want the diagnostics for them.
1 parent 85d71b2 commit 791a0e4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/compiler/program.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,9 @@ module ts {
254254
function getDeclarationDiagnosticsForFile(sourceFile: SourceFile): Diagnostic[] {
255255
if (!isDeclarationFile(sourceFile)) {
256256
let resolver = getDiagnosticsProducingTypeChecker().getEmitResolver(sourceFile);
257-
return ts.getDeclarationDiagnostics(getEmitHost(), resolver, sourceFile);
257+
// Don't actually write any files since we're just getting diagnostics.
258+
var writeFile: WriteFileCallback = () => { };
259+
return ts.getDeclarationDiagnostics(getEmitHost(writeFile), resolver, sourceFile);
258260
}
259261
}
260262

0 commit comments

Comments
 (0)