Why is it needed?
How to use it?
What are its features?
JSLint is highly configurable. If configured so, it can help you detect the following:
- Incorrect syntax
- Undefined variables and functions
- Improperly spelled property names
- Missing semicolons
- Sloppy line breaking
- Extra commas
- Missing parentheses
- Required and forbidden blocks
- Erroneous expression statements
- Unfiltered for-in
- Unintended switch-case fall-through
- Incorrect use of var
- Assignment statement in the condition part
- Type coercion due to == and !=
- Incorrect use of labels
- Unreachable code
- Confusing pluses and minuses
- Presence of with statement, ++/–, bitwise operators, eval, void
- Inefficient regular expressions
- Unsafe characters
- Incorrect constructors and new usage
- JSLint can be found at http://www.jslint.com/ and its documentation, athttp://www.jslint.com/lint.html.
- JSLint is also available as a widget (http://www.widgetgallery.com/?search=jslint) and in command-line versions.
- Criticism: http://dean.edwards.name/weblog/2006/06/jslint/.
- JSLint’s usefulness as a helper tool would be directly proportional to your understanding and correct use of its configuration options (provided as checkboxes). Should you decide to use it, please learn to use it well, otherwise the real issues in your code will be buried in a pile of unimportant ones in JSLint output. All in all, know what you are doing, know which options to turn on and which ones to turn off.