The default Zeus installation already comes configured for JSLint but it is also possible to configure Zeus to use JSHint as well.
Below are the steps needed to do this configuration.
1. Since JSHint requires Node.js, if you don't have Node.js installed, you will need to do that first of all.
You can download the Node.js installer from here: https://nodejs.org/en/download/
2. Run the installer and make sure you select the option to add it to the PATH.
3. Start a new Zeus instance and use the Tools, Dos Command Line to open up a command prompt.
Run this command:
Code: Select all
npm install jshint -g
Code: Select all
D:\Temp>npm install jshint -g
C:\Users\<Current User>\AppData\Roaming\npm\jshint -> C:\Users\<Current User>\AppData\Roaming\npm\node_modules\jshint\bin\jshint
jshint@2.9.1-rc2 C:\Users\<Current User>\AppData\Roaming\npm\node_modules\jshint
+-- strip-json-comments@1.0.4
+-- exit@0.1.2
+-- shelljs@0.3.0
+-- lodash@3.7.0
+-- console-browserify@1.1.0 (date-now@0.1.4)
+-- cli@0.6.6 (glob@3.2.11)
+-- minimatch@2.0.10 (brace-expansion@1.1.2)
+-- htmlparser2@3.8.3 (domelementtype@1.3.0, entities@1.0.0, domhandler@2.3.0, readable-stream@1.1.13, domutils@1.5.1)
4. Use the Zeus Options, Document Types menu to edit the JScript document type.
5. Move to the Compiler section of the document type and make the following changes.
Change the Command Line to this:
Code: Select all
jshint "$fn"
Code: Select all
line [0-9]+, col [0-9]+
That is all that is required as per the configuration. To check that everything is working run the following test.
1. Create a test.js file containing the following code:
Code: Select all
function main(a, b) {
return a == null;
}
This should result in the following error output being displayed: Click on the error shown above and you will be returned to the line at fault in the test.js file.
Cheers Jussi.