Skip to content

Commit

Permalink
Change error count message to be singular/plural-aware
Browse files Browse the repository at this point in the history
  • Loading branch information
fiso committed May 8, 2019
1 parent 1dd3e80 commit 9653690
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,8 @@ sassLint.failOnError = function (results, options, configPath) {
configOptions = this.getConfig(options, configPath).options;

if (errorCount.count > 0) {
throw new exceptions.SassLintFailureError(errorCount.count + ' errors were detected in \n- ' + errorCount.files.join('\n- '));
const pluralized = errorCount.count === 1 ? 'error was' : 'errors were';
throw new exceptions.SassLintFailureError(errorCount.count + ' ' + pluralized + ' detected in \n- ' + errorCount.files.join('\n- '));
}

if (!isNaN(configOptions['max-warnings']) && warningCount.count > configOptions['max-warnings']) {
Expand Down

0 comments on commit 9653690

Please sign in to comment.