From 15b61dcd6b0d36b48805acfd47db16b5e1b602fb Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Fri, 9 Mar 2018 14:09:38 -0800 Subject: [PATCH] Made watch mode always report summary --- src/compiler/watch.ts | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/compiler/watch.ts b/src/compiler/watch.ts index ac46e28c42e..550a15ba9a0 100644 --- a/src/compiler/watch.ts +++ b/src/compiler/watch.ts @@ -127,7 +127,6 @@ namespace ts { emit(): EmitResult; } - /** @internal */ export type ReportEmitErrorSummary = (errorCount: number) => void; /** @@ -234,19 +233,15 @@ namespace ts { } function emitFilesAndReportErrorUsingBuilder(builderProgram: BuilderProgram) { - let reportSummary: ReportEmitErrorSummary | undefined; const compilerOptions = builderProgram.getCompilerOptions(); - - if (compilerOptions.pretty) { - reportSummary = (errorCount: number) => { - if (errorCount === 1) { - onWatchStatusChange(createCompilerDiagnostic(Diagnostics.Found_1_error, errorCount), sys.newLine, compilerOptions); - } - else { - onWatchStatusChange(createCompilerDiagnostic(Diagnostics.Found_0_errors, errorCount, errorCount), sys.newLine, compilerOptions); - } - }; - } + const reportSummary = (errorCount: number) => { + if (errorCount === 1) { + onWatchStatusChange(createCompilerDiagnostic(Diagnostics.Found_1_error, errorCount), sys.newLine, compilerOptions); + } + else { + onWatchStatusChange(createCompilerDiagnostic(Diagnostics.Found_0_errors, errorCount, errorCount), sys.newLine, compilerOptions); + } + }; emitFilesAndReportErrors(builderProgram, reportDiagnostic, reportSummary, writeFileName); }