Skip to content

Instantly share code, notes, and snippets.

@osbornm
Last active October 13, 2015 06:17
Show Gist options
  • Save osbornm/4151801 to your computer and use it in GitHub Desktop.
Save osbornm/4151801 to your computer and use it in GitHub Desktop.
JSHint Formatters to get Visual Studio auto link to files, etc.
var formatters = {
errors: function (errors, lines, file) {
var i, error;
for (i = 0; i < errors.length; i++) {
error = errors[i];
if (!error) continue;
lines.push(file + '(' + error.line + ',' + error.character + '): error JSHint: ' + error.reason);
}
},
implieds: function(implieds, lines, file) {
var i, error;
for (i = 0; i < implieds.length; i++) {
error = implieds[i];
if (!error) continue;
lines.push(file + '(' + error.line + '): error JSHint: Implied Global: ' + error.name);
}
},
unused: function(unused, lines, file) {
var i, error;
for (i = 0; i < unused.length; i++) {
error = unused[i];
if (!error) continue;
lines.push(file + '(' + error.line + '): error JSHint: Unused Varible: ' + error.name);
}
}
};
@osbornm
Copy link
Author

osbornm commented Nov 27, 2012

You have to modify WSH to pass the file path to the formatters but thats easy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment