Integrated support for JavaScript linting and syntax checking using JSHint has been added to CSS HTML Validator v16.0 and above, and is now the recommended JavaScript linter (instead of JSLint).

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 CSS 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 CSS 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. See below for some additional options you may want to add.

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 comment to the top of the JavaScript document: /* exported EXPORTED_VAR */

To check ES6 script add "--esversion=6" to the options or this comment to the top of the JavaScript document: /* jshint esversion:6 */

More

hmtoggle_plus1JSHint Notes
hmtoggle_plus1Advanced Registry Options