This repository has been archived by the owner on Sep 25, 2020. It is now read-only.
forked from hallettj/jslint.vim
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added (currently defunct) rhino support
- Loading branch information
Showing
5 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/*global JSLINT load readline print */ | ||
|
||
load('fulljslint.js'); | ||
importPackage(java.io); | ||
importPackage(java.lang); | ||
|
||
function readSTDIN() { | ||
// setup the input buffer and output buffer | ||
var stdin = new BufferedReader(new InputStreamReader(System['in'])), | ||
lines = []; | ||
|
||
// read stdin buffer until EOF (or skip) | ||
while (stdin.ready()){ | ||
lines.push(stdin.readLine()); | ||
} | ||
|
||
return lines.join('\n'); | ||
} | ||
|
||
var body = readSTDIN() || arguments[0], | ||
ok = JSLINT(body), | ||
i, | ||
error, | ||
errorCount; | ||
|
||
if (!ok) { | ||
errorCount = JSLINT.errors.length; | ||
for (i = 0; i < errorCount; i += 1) { | ||
error = JSLINT.errors[i]; | ||
if (error && error.reason && error.reason.match(/^Stopping/) === null) { | ||
print([error.line, error.character, error.reason].join(":")); | ||
} | ||
} | ||
} | ||
|
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