Created
January 3, 2014 16:42
-
-
Save osuka/8241218 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
// see http://jshint.com/docs/reporters/ | |
// and https://github.com/jshint/jshint/blob/master/examples/reporter.js | |
module.exports = { | |
reporter: function (res) { | |
var len = res.length; | |
var str = ""; | |
if (!len) { | |
return; | |
} | |
var exec = require('child_process').exec; | |
var child = exec('say "There is a syntax error"'); | |
process.stdout.write('\n ************************************\n'); | |
process.stdout.write('Errors during validation detected:\n'); | |
res.forEach(function (r) { | |
var file = r.file; | |
var err = r.error; | |
str += file + ": line " + err.line + ", col " + | |
err.character + ", " + err.reason + "\n"; | |
}); | |
if (str) { | |
process.stdout.write(str + "\n" + len + " error" + | |
((len === 1) ? "" : "s") + "\n"); | |
} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment