Despite it's usefulness, the JSLint as we know it, has a little problem: it is an online tool, hosted on Crockford's server.
Wouldn't it be wonderful if JSLint were a command line tool?
Install the JSLint Node.js module:
$ sudo npm install jslint -g
With that, JSLint command line is installed on your system. It's just a matter of invoking the jslint command now. I will show you how to do so using some examples.
To lint a single file named application.js:
$ jslint application.js
$ find . -name '*.js' -print0 | xargs -0 jslint
JSLint accepts more than a dozen options, you can find them in under the Options tab on http://www.jslint.com.
To pass JSLint parameters for a single file:
$ jslint --strict --white application.js
To pass JSLint parameters for all the files in the current directory:
$ find . -name '*.js' -print0 | xargs -0 jslint --strict --white
Parameter-less options passed to jslint are all set to
true by default, if you want to set it
false, just specify 'false' after the option.
Here is an example of setting an option to
$ jslint --bitwise false application.js
There you have it, JSLint right at your command line. If you aren't already, I would highly recommend you use JSLint on your projects.