Skip to content

Commit

Permalink
Fixes jshint#978 - Adding the --verbose option handling to the non-er…
Browse files Browse the repository at this point in the history
…ror reporter
  • Loading branch information
jklein committed May 28, 2013
1 parent 559693c commit 09d5041
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/reporters/non_error.js
@@ -1,7 +1,7 @@
"use strict";

module.exports = {
reporter: function (results, data) {
reporter: function (results, data, opts) {
var len = results.length,
str = '',
file, error, globals, unuseds;
Expand All @@ -10,7 +10,14 @@ module.exports = {
file = result.file;
error = result.error;
str += file + ': line ' + error.line + ', col ' +
error.character + ', ' + error.reason + '\n';
error.character + ', ' + error.reason;

// Add the error code if the --verbose option is set
if (opts.verbose) {
str += ' (' + error.code + ')';
}

str += '\n';
});

str += len > 0 ? ("\n" + len + ' error' + ((len === 1) ? '' : 's')) : "";
Expand Down

0 comments on commit 09d5041

Please sign in to comment.