Skip to content

Commit

Permalink
Improve error counting, see #1247
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Jun 2, 2022
1 parent 748108a commit fbac887
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion js/scripts/absolute-tsc.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ if ( !args || args.length === 0 ) {
}
} );

// If a line starts without whitespace, it begins a new error
const errorCount = mapped.filter( line => line === line.trim() ).length;

console.log( mapped.join( '\n' ) );
console.log( `${mapped.length} ${mapped.length === 1 ? 'error' : 'errors'} in ${elapsed}ms` );
console.log( `${errorCount} ${errorCount === 1 ? 'error' : 'errors'} in ${elapsed}ms` );
}
} )();

0 comments on commit fbac887

Please sign in to comment.