diff --git a/src/compiler/watch.ts b/src/compiler/watch.ts index 0dfe3968826..1b79e71efb8 100644 --- a/src/compiler/watch.ts +++ b/src/compiler/watch.ts @@ -74,11 +74,15 @@ namespace ts { system.write(output); } : (diagnostic, newLine, options) => { + let output = ""; + if (!clearScreenIfNotWatchingForFileChanges(system, diagnostic, options)) { - system.write(newLine); + output += newLine; } - let output = `${new Date().toLocaleTimeString()} - `; + + output += `${new Date().toLocaleTimeString()} - `; output += `${flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)}${getPlainDiagnosticFollowingNewLines(diagnostic, newLine)}`; + system.write(output); }; }