04 April 2012

Douglas Crockford's JSLint is meant to be run inside a browser. During development, I'd prefer to run it via the command line, using Google's V8 JavaScript Engine (brew install v8).

Fortunately, the real work has already been done in jslint-v8 by Vladimir Dobriakov. We just have to figure out how to get the Rakefile to compile against our Homebrew-based V8 installation:

$ brew install v8
$ cd /tmp
$ git clone git://github.com/geekq/jslint-v8.git && cd jslint-v8
$ V8_BASEDIR=$(brew --prefix v8) rake
$ cp jslint ~/bin/

I really should make this a Homebrew formula, but I'll save that for another day.