Skip to content

Commit 0831eda

Browse files
committed
Keep only errors starting on new screen
1 parent 7960090 commit 0831eda

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

src/compiler/watch.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,6 @@ namespace ts {
2727
};
2828
}
2929

30-
/** @internal */
31-
export const nonClearingMessageCodes: number[] = [
32-
Diagnostics.Found_1_error_Watching_for_file_changes.code,
33-
Diagnostics.Found_0_errors_Watching_for_file_changes.code
34-
];
35-
3630
/**
3731
* @returns Whether the screen was cleared.
3832
*/
@@ -41,7 +35,7 @@ namespace ts {
4135
!options.preserveWatchOutput &&
4236
!options.extendedDiagnostics &&
4337
!options.diagnostics &&
44-
!contains(nonClearingMessageCodes, diagnostic.code)) {
38+
contains(screenStartingMessageCodes, diagnostic.code)) {
4539
system.clearScreen();
4640
return true;
4741
}

src/testRunner/unittests/tscWatchMode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ namespace ts.tscWatch {
110110

111111
function assertWatchDiagnostic(diagnostic: Diagnostic) {
112112
const expected = getWatchDiagnosticWithoutDate(diagnostic);
113-
if (!disableConsoleClears && !contains(nonClearingMessageCodes, diagnostic.code)) {
113+
if (!disableConsoleClears && contains(screenStartingMessageCodes, diagnostic.code)) {
114114
assert.equal(host.screenClears[screenClears], index, `Expected screen clear at this diagnostic: ${expected}`);
115115
screenClears++;
116116
}

0 commit comments

Comments
 (0)