Skip to content

Commit 15b61dc

Browse files
author
Josh Goldberg
committed
Made watch mode always report summary
1 parent a4ca071 commit 15b61dc

1 file changed

Lines changed: 8 additions & 13 deletions

File tree

src/compiler/watch.ts

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ namespace ts {
127127
emit(): EmitResult;
128128
}
129129

130-
/** @internal */
131130
export type ReportEmitErrorSummary = (errorCount: number) => void;
132131

133132
/**
@@ -234,19 +233,15 @@ namespace ts {
234233
}
235234

236235
function emitFilesAndReportErrorUsingBuilder(builderProgram: BuilderProgram) {
237-
let reportSummary: ReportEmitErrorSummary | undefined;
238236
const compilerOptions = builderProgram.getCompilerOptions();
239-
240-
if (compilerOptions.pretty) {
241-
reportSummary = (errorCount: number) => {
242-
if (errorCount === 1) {
243-
onWatchStatusChange(createCompilerDiagnostic(Diagnostics.Found_1_error, errorCount), sys.newLine, compilerOptions);
244-
}
245-
else {
246-
onWatchStatusChange(createCompilerDiagnostic(Diagnostics.Found_0_errors, errorCount, errorCount), sys.newLine, compilerOptions);
247-
}
248-
};
249-
}
237+
const reportSummary = (errorCount: number) => {
238+
if (errorCount === 1) {
239+
onWatchStatusChange(createCompilerDiagnostic(Diagnostics.Found_1_error, errorCount), sys.newLine, compilerOptions);
240+
}
241+
else {
242+
onWatchStatusChange(createCompilerDiagnostic(Diagnostics.Found_0_errors, errorCount, errorCount), sys.newLine, compilerOptions);
243+
}
244+
};
250245

251246
emitFilesAndReportErrors(builderProgram, reportDiagnostic, reportSummary, writeFileName);
252247
}

0 commit comments

Comments
 (0)