I’ve found two approaches :
Build instructions for the lazy – uncompress/extract the files from the archive, then :
- cd jsl-0.3.0/src
- make -f Makefile.ref
- cp Linux_All_DBG.OBJ/jsl /usr/local/bin
Usage looks a bit like :
jsl -process $file
As per the ‘help’ documentation, it returns different exit codes depending how things went (e.g. 0 – everything good; 1 – warnings etc).
Aside from the annoying compile step, this seemed the easiest to setup, and friendliest to use from the command line.
Mozilla’s Rhino & JSLint.js
This is the approach expected by Neil’s TestSuite above (more soon, perhaps).
Download the Mozilla Rhino thing – for me this is a simple ‘apt-get install rhino‘ YMMV.
- export CLASSPATH=/usr/share/java/js.jar
Again, this will give some sort of return error code if it can’t parse it – but it’s not yet running through jslint… which is what we really want.
Firstly, download JSLint.js via https://github.com/douglascrockford/JSLint/blob/master/fulljslint.js (click on the ‘raw’ button)…
- (Requires CLASSPATH thing from above)
- result = JSLINT(to_test, null);
If ‘result’ is ‘false’ then you can inspect the errors via JSLINT.errors.
Next up, getting frontend-test-suite running, or something based upon it….