Skip to content

Commit

Permalink
Colorize tally output of string formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
ybiquitous committed Nov 2, 2022
1 parent 042d1ad commit 7a6e049
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/formatters/stringFormatter.js
Expand Up @@ -301,10 +301,9 @@ module.exports = function stringFormatter(results, returnValue) {
const total = errorCount + warningCount;

if (total > 0) {
const tally =
`${total} ${pluralize('problem', total)}` +
` (${errorCount} ${pluralize('error', errorCount)}` +
`, ${warningCount} ${pluralize('warning', warningCount)})`;
const error = red(`${errorCount} ${pluralize('error', errorCount)}`);
const warning = yellow(`${warningCount} ${pluralize('warning', warningCount)}`);
const tally = `${total} ${pluralize('problem', total)} (${error}, ${warning})`;

output += `${tally}\n\n`;
}
Expand Down

0 comments on commit 7a6e049

Please sign in to comment.