Lint your Javascript with Rake

First go to http://javascriptlint.com and get the command line version of JSLint for your operating system.
Then use this Rake task to lint your Javascripts in your Rails project.

Can be used as a git pre-commit hook as well.