I've been doing a fair bit of programming in Dojo lately, and have on occasion run into either inconsistent interfaces, or interfaces that simply fail to load in Internet Explorer. Several people have pointed out to me some optimizations to make, but, being a lazy programmer, I often forget to do so.
To get JSLint running on the command line using the Rhino shipped with Dojo, you'll need to download the following file:
Put these files in a directory of your choosing. Then, create a file called "jslint", with the following:
#!/bin/sh exec java \ -jar /path/to/dojo/util/shrinksafe/custom_rhino.jar \ /path/to/jslint.js $1
Note: you'll need to put in the correct paths to your Dojo installation as well as to where you placed the jslint.js file.
Make that file executable, and put it somewhere on your path. Once you do, you can invoke it quite simply:
and get some nice output. Something I will often do is to grab all JS files in a tree using globbing, and then pass them individually to the linter. In zsh, that might look like this:
% for f in *.js;do jslint $f;done