JSLint through command line
To do that, I would first need a command line tool that can execute JS. Once I get that working, I would then send my JS source code over to JSLint.
The JS engine I decided to use is Mozilla's SpiderMonkey.
I downloaded the source code for SpiderMonkey, and then modified it as mentioned here.
I then followed the documentation for building the binaries from source (Link).
Finally I wrote a small script (with JS) that can read my JS source code and send it over to JSLint.
All the required scripts (and binaries for windows) are here: Download.
For windows you will also have to install Microsoft Visual C++ Redistributable package.
To run JSLint over your source code, do a
Edit the first line of run.sh ('cd /full/path/to/jslint/direrctory/').
After which, you need to get the spidermonkey shell. You've got two alternatives to do that:
1. Download and install Wine emulator to use js.exe (You will have to edit run.sh to use js.exe).
2. Two options again:
i) Download the source code from Mozilla.
Modify js/src/shell/js.cpp as mentioned at this link.
ii) Download source from here.
Then head over to the build documentation and follow the 'Easy Build' section.
Copy js/src/shell/js file to the JSLint folder.
I added the command to Geany (text editor), as follows:
If you ever need to update JSLint, get the latest source from github and overwrite jslint.js.