Skip to content

Commit db2212e

Browse files
committed
TS: Only print number of errors if there were any
1 parent 3c1cbce commit db2212e

File tree

1 file changed

+3
-1
lines changed
  • javascript/extractor/lib/typescript/src

1 file changed

+3
-1
lines changed

javascript/extractor/lib/typescript/src/main.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,9 @@ function handleOpenProjectCommand(command: OpenProjectCommand) {
316316

317317
let diagnostics = program.getSemanticDiagnostics()
318318
.filter(d => d.category === ts.DiagnosticCategory.Error);
319-
console.warn('TypeScript: reported ' + diagnostics.length + ' semantic errors.');
319+
if (diagnostics.length > 0) {
320+
console.warn('TypeScript: reported ' + diagnostics.length + ' semantic errors.');
321+
}
320322
for (let diagnostic of diagnostics) {
321323
let text = diagnostic.messageText;
322324
if (text && typeof text !== 'string') {

0 commit comments

Comments
 (0)