Integrated support for JavaScript linting and syntax checking using JSLint by Douglas Crockford has been added to CSS HTML Validator v11.0 and above.

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

NOTE: The default JavaScript linting tool is now JSHint because many developers consider it to be more practical because it has more configurable options and is less strict than JSLint.

NOTE: JSLint code quality checking requires jslint.js, which is written in JavaScript and included with CSS HTML Validator. As of v15.0116, Node.js is used to run JSLint instead of cscript.exe. This allows newer versions of JSLint to be used.

WARNING: JSLint will hurt your feelings. Side effects may include headache, irritability, dizziness, snarkiness, stomach pain, defensiveness, dry mouth, cleaner code, and a reduced error rate.

JSLint Options

Enable JSLint lint messages in validation results - Check this box to enable JavaScript linting and syntax checking with JSLint during validations and to display the results in the validation messages. Checking this option will result in slightly slower validation times because JSLint must be run. This option is not enabled by default.

Improve JSLint lint messages - Check this option to enable CSS HTML Validator to make changes to JSLint 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 JSLint output, then uncheck this option. This option is enabled by default.

Text Edit Options

Options - These options used when running JSLint.

The default for v16.0+ is "--browser=true --devel=true --maxerr=30 --white=true --this=true", not including the double quotes.

In v18.0112+, "--single=true" has been added to the default (to allow single quotes).

JSLint Configuration Tips

Various JSLint options can be set in individual script files using special /*jslint*/ comments in JavaScript code. For more information, visit the link at the bottom of this page.

To allow standard browser globals (like document, event, history, screen, etc, but not self or window), browser can be set to true. Use this for the Options (add other options you may want): --browser=true

To allow browser globals (like alert, console, etc) that are useful in development, devel can be set to true. Use this for the Options (add other options you may want): --devel=true

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

To tolerate messy whitespace, white can be set to true. Add this to the Options: --white=true

To allow single quotes, single can be set to true. Add this to the Options: --single=true


hmtoggle_plus1JSLint Notes and More Information
hmtoggle_plus1Options Removed in Newer Versions of JSLint
hmtoggle_plus1Advanced Registry Options