Integrated support for JavaScript linting and syntax checking using JSHint has been added to CSE HTML Validator v16.0 and above (but is not in the lite edition).

To distinguish JSHint messages from other messages, the string "[JSHint]" is prepended to the JSHint messages.

NOTE: JSHint linting and syntax checking requires JSHint, which is written in JavaScript and included with CSE HTML Validator. Node.js is used to run JSHint.

JSHint Options

Enable JSHint lint messages in validation results - Check this box to enable JavaScript linting and syntax checking with JSHint. NOTE: Even if disabled, JSHint may still be run if you try to check/validate a "pure" JavaScript document (like a *.js document). This option is enabled by default.

Improve JSHint lint messages - Check this option to enable CSE HTML Validator to make changes to JSHint message output to try to make the messages more clear and easier to understand for the average web developer. Message IDs may also be added to some messages so that the message can be disable or its type changed. If you want unaltered JSHint output, then uncheck this option. This option is enabled by default.

Text Edit Options

Options - These options used when running JSHint. The default is "--browser=true --devel=true", not including the double quotes.

Registry Options

Some options that are not changeable here can be changed in the registry under the key "HKEY_CURRENT_USER\Software\AI Internet Solutions\CSE HTML Validator v4\Validator DLL\JSHint". For example, the timeout can be changed by changing the "TimeoutSeconds" value.

JSHint Configuration Tips

The JSHint Options page lists many options including options to let JSHint know about some pre-defined global variables. For example, if you want to use globals exposed by modern browsers, make sure "--browser=true" is in the Options string or you can add this to the top of your JavaScript documents: /* jshint browser:true */ or this (which also adds debugging globals like console and alert): /* jshint browser:true, devel:true */

To allow specific globals, like '$' for jQuery, add this comment to the top of a JavaScript file: /* globals $ */ or (if specifying more than one global): /* globals $, MY_GLOBAL1, MY_GLOBAL2, etc */

To blacklist a global: /* globals -BAD_LIB */

To specify global variables that are defined in the current file but used elsewhere, add this to the top of the JavaScript document: /* exported EXPORTED_VAR */

JSHint Notes

JSHint is not developed or maintained by AI Internet Solutions LLC. AI Internet Solutions LLC only provides an interface to JSHint. Therefore, only bugs or problems with the JSHint interface or integration (but not JSHint itself) should be reported to AI Internet Solutions LLC.

Consider only checking JavaScript files that you have control over.

More Information

For more information, including information about available options, please visit the JSHint Documentation page.