Last active
October 13, 2015 06:17
-
-
Save osbornm/4151801 to your computer and use it in GitHub Desktop.
JSHint Formatters to get Visual Studio auto link to files, etc.
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
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); | |
} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You have to modify WSH to pass the file path to the formatters but thats easy.