However, I was bugged by the implementation. So, I’ve rewritten it into a slightly more sensible form. This is now available as jslint4java. The main interface is command line, which is nice as it’s completely self-contained now. But there is also an API which lets you call it from unit tests.
% java -jar jslint+rhino.jar application.js jslint:application.js:11:9:Line breaking error ')'. jslint:application.js:11:10:Missing semicolon.
It’s also been the first time I’ve used enum classes in Java 5. They’re really cute. Being able to enumerate all possible values at run time is really handy. Plus, being able to define additional methods is really handy.
Future directions include:
- More help towards integrating this into a junit test easily.
- An Eclipse plugin would be nice, so that you can get the jslint warnings pop up in the Problems view.
2 replies on “jslint4java”
Anyway, never mind my rambling.
Hmm, good point. Although I suspect that at this point the amount of spell checkers which would need retraining would be substantial…