diff --git a/src/compiler/tsc.ts b/src/compiler/tsc.ts index 4c9ec6beaff..880180b133e 100644 --- a/src/compiler/tsc.ts +++ b/src/compiler/tsc.ts @@ -359,20 +359,19 @@ namespace ts { // First get and report any syntactic errors. diagnostics = program.getSyntacticDiagnostics(); - reportDiagnostics(diagnostics); // If we didn't have any syntactic errors, then also try getting the global and // semantic errors. if (diagnostics.length === 0) { diagnostics = program.getGlobalDiagnostics(); - reportDiagnostics(diagnostics); if (diagnostics.length === 0) { diagnostics = program.getSemanticDiagnostics(); - reportDiagnostics(diagnostics); } } + reportDiagnostics(diagnostics); + // If the user doesn't want us to emit, then we're done at this point. if (compilerOptions.noEmit) { return diagnostics.length