Last active
June 8, 2016 18:08
-
-
Save distractdiverge/5682111 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.
This file contains hidden or 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
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