This is a java wrapper around the fabulous tool by Douglas Crockford, jslint. It provides a simple interface for detecting potential problems in JavaScript code.
The usage is simple:
% java -jar jslint4java-1.3.1.jar application.js jslint:application.js:11:9:Line breaking error ')'. jslint:application.js:11:10:Missing semicolon.
There are a multitude of options; try --help for more details.
You might also be interested in the ant task. This lets you run jslint as part of your builds. For documentation, see the jslint4java-ant page. If you find this useful, you may also like the jsmin ant task for reducing the size of your JavaScript files.
News
2009-07-31. jslint4java 1.3.1 is released. This release fixes:
- Improved support for NetBeans thanks to Ari Shamash!
- Correct line numbers (previously off by one).
- The ant task now states the full path to the file being checked.
- The build failure now includes the total number of errors found.
- Updated to JSLint 2009-07-25.
2009-07-23. jslint4java 1.3 is released. This release features:
- An upgrade to jslint 2009-07-08.
- The indent option is now supported.
- Add getEdition() call.
- The ant task can now work with any kind of nested resource, not just files.
- Improved documentation.
- The build system has been switched to maven. This means jslint4java is now available as a maven dependency:
<dependency> <groupId>com.googlecode.jslint4java</groupId> <artifactId>jslint4java</artifactId> <version>1.3</version> </dependency>
NB: The package names have changed from net.happygiraffe.jslint to com.googlecode.jslint4java. The most likely place this will affect you is if you are using the antlib support.
2008-12-23. Development of the code has moved to github. Feel free to visit http://github.com/happygiraffe/jslint4java or:
$ git clone git://github.com/happygiraffe/jslint4java.git
2008-09-07. jslint4java 1.2.1 was released.
- Recompiled with Java 5 instead of Java 6.
2008-09-07. jslint4java 1.2 was released.
- Update to latest version of jslint.
- Rework the ant task to be more flexible.