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 3fde6a6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/cyan-cats-destroy.md
@@ -0,0 +1,5 @@
---
"stylelint": patch
---

Fixed: tally output of `string` formatter colorized
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 3fde6a6

Please sign in to comment.