Skip to content
Browse files

Merge pull request #24 from jdiamond/master

jslint output was broken on Windows
  • Loading branch information...
2 parents 402579c + aa733c0 commit 47065878071458833ba4e40ac57eb7ef40dc977a @hallettj committed Feb 25, 2012
Showing with 11 additions and 2 deletions.
  1. +11 −2 ftplugin/javascript/jslint/runjslint.wsf
View
13 ftplugin/javascript/jslint/runjslint.wsf
@@ -24,14 +24,23 @@ var body = readSTDIN() || arguments[0],
ok = JSLINT(body),
i,
error,
- errorCount;
+ errorType,
+ nextError,
+ errorCount,
+ WARN = 'WARNING',
+ ERROR = 'ERROR';
if (!ok) {
errorCount = JSLINT.errors.length;
for (i = 0; i < errorCount; i += 1) {
error = JSLINT.errors[i];
+ errorType = WARN;
if (error && error.reason && error.reason.match(/^Stopping/) === null) {
- WScript.echo([error.line, error.character, error.reason].join(":"));
+ // If jslint stops next, this was an actual error
+ if (nextError && nextError.reason && nextError.reason.match(/^Stopping/) !== null) {
+ errorType = ERROR;
+ }
+ WScript.echo([error.line, error.character, errorType, error.reason].join(":"));
}
}
}

0 comments on commit 4706587

Please sign in to comment.
Something went wrong with that request. Please try again.