Skip to content

Instantly share code, notes, and snippets.

@rraallvv
Forked from distractdiverge/XCodeReporter.js
Last active June 8, 2016 18:10
Show Gist options
  • Save rraallvv/08ec800fa2dcf079ce5785b5bc48db85 to your computer and use it in GitHub Desktop.
Save rraallvv/08ec800fa2dcf079ce5785b5bc48db85 to your computer and use it in GitHub Desktop.
A custom reporter for jshint to present errors in a format for XCode to read them.
module.exports = {
reporter: function (res) {
var len = res.length;
var str = "";
res.forEach(function (r) {
var file = r.file;
var err = r.error;
str += file + ":" + err.line + ": error: " + err.reason + "\n";
});
if (str) {
process.stderr.write(str);
process.stdout.write(len + " error" + ((len === 1) ? "" : "s") + "\n");
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment