jslint.js [--ass] [--bitwise] [--browser] [--closure] [--color] [--config] [--continue] [--couch] [--debug] [--devel] [--eqeq] [--evil] [--forin] [--indent] [--json] [--maxerr] [--maxlen] [--newcap] [--node] [--nomen] [--passfail] [--plusplus] [--predef] [--properties] [--regexp] [--rhino] [--sloppy] [--stupid] [--sub] [--terse] [--todo] [--unparam] [--vars] [--version] [--white] [--] <scriptfile>...
JSLint is a static analysis tool to locate and correct style problems in Javascript (ECMAScript etc.) source code.
--color write output in color
--terse report one error per line with parseable source file/line
--json output in JSON format
--version print version and exit
--ass Tolerate assignment expressions
--bitwise Tolerate bitwise operators
--browser Assume a browser
--closure Tolerate Google Closure idioms
--continue Tolerate continue
--couch Tolerate Couch DB
--debug Tolerate debugger statements
--devel Assume console,alert, ...
--eqeq Tolerate == and !=
--evil Tolerate eval
--forin Tolerate unfiltered for in
--indent Strict white space indentation
--maxerr Maximum number of errors
--maxlen Maximum line length
--newcap Tolerate uncapitalized constructors
--node Assume Node.js
--nomen Tolerate dangling underscore in identifiers
--passfail Stop on first error
--plusplus Tolerate ++ and --
--predef Declare additional predefined globals
--properties Require all property names to be declared with /properties/
--regexp Tolerate . and [^...]. in /RegExp/
--rhino Assume Rhino
--sloppy Tolerate missing 'use strict' pragma
--stupid Tolerate stupidity (typically, use of sync functions)
--sub Tolerate inefficient subscripting
--todo Tolerate TODO comments
--unparam Tolerate unused parameters
--vars Tolerate many var statements per function
--white Tolerate messy white space
Multiple files:
jslint lib/color.js lib/reporter.jsAll JSLint options supported
jslint --white --vars --regexp lib/color.jsDefaults to true, but you can specify false
jslint --bitwise false lib/color.jsPass arrays
jslint --predef $ --predef Backbone lib/color.jsJSLint your entire project
jslint **/*.jsUsing JSLint with a config file
See FILES section.To install jslint globally, use
npm install jslint -gTo install jslint locally, use
npm install jslintWhen installed locally, jslint can be run as
./node_modules/.bin/jslintnode-jslint can be configured using JSON in a .jslintrc file.
The format of a jslint options file is a JSON file containing a single object
where the keys are jslint option names and the values are the option argument;
use true to enable and false to disable boolean options. Example:
`~/project/.jslintrc`
{
"indent": 4,
"predef": [
"$"
],
"node": true
}The config is obtained by merging multiple configurations by this order of precedence, where options closer to #1 on this list override others.
/*jslint ... */ directives~, or an environment variable HOME)jslint returns 1 if it found any problems, 0 otherwise.
JSLint is written and maintained by Douglas Crockford. See douglascrockford/JSLint.
This package is node-jslint, which provides a command-line interface for running jslint using the Node.js platform. node-jslint was written by Reid Burke and is maintained by Reid Burke, Ryuichi Okumura, and Sam Mikes.
There are no known bugs. Submit bugs here.
Note that if you are reporting a problem with the way jslint works rather than the way the command-line tools work, we will probably refer you to the JSLint community or the issue tracker at douglascrockford/JSLint.
See LICENSE file.