Skip to content

Instantly share code, notes, and snippets.

@osuka
Created January 3, 2014 16:42
Show Gist options
  • Save osuka/8241218 to your computer and use it in GitHub Desktop.
Save osuka/8241218 to your computer and use it in GitHub Desktop.
"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