.TH "JSLINT" "1" "May 2016" "" "" .SH "NAME" \fBjslint\fR \- a code quality tool .SH SYNOPSIS .P jslint\.js [\-\-anon] [\-\-ass] [\-\-bitwise] [\-\-browser] [\-\-closure] [\-\-color] [\-\-continue] [\-\-debug] [\-\-devel] [\-\-edition] [\-\-eqeq] [\-\-es5] [\-\-evil] [\-\-forin] [\-\-indent] [\-\-json] [\-\-maxerr] [\-\-maxlen] [\-\-newcap] [\-\-node] [\-\-nomen] [\-\-on] [\-\-passfail] [\-\-plusplus] [\-\-predef] [\-\-properties] [\-\-regexp] [\-\-rhino] [\-\-sloppy] [\-\-stupid] [\-\-sub] [\-\-terse] [\-\-todo] [\-\-undef] [\-\-unparam] [\-\-vars] [\-\-white] [\-\-] \|\.\.\. .SH DESCRIPTION .P JSLint is a static analysis tool to locate and correct style problems in Javascript (ECMAScript etc\.) source code\. .SH META OPTIONS .P \fB\-\-color\fP write output in color .P \fB\-\-terse\fP report one error per line with parseable source file/line .P \fB\-\-json\fP output in JSON format .P \fB\-\-edition\fP specify which edition of jslint to use .P \fB\-\-no\-filter\fP allow linting files containing pattern \fBnode_modules\fP .SH LINTING OPTIONS .P \fB\-\-ass\fP Tolerate assignment expressions .P \fB\-\-bitwise\fP Tolerate bitwise operators .P \fB\-\-browser\fP Assume a browser .P \fB\-\-closure\fP Tolerate Google Closure idioms .P \fB\-\-continue\fP Tolerate continue .P \fB\-\-debug\fP Tolerate debugger statements .P \fB\-\-devel\fP Assume console,alert, \.\.\. .P \fB\-\-eqeq\fP Tolerate == and != .P \fB\-\-evil\fP Tolerate eval .P \fB\-\-forin\fP Tolerate unfiltered for in .P \fB\-\-indent\fP Strict white space indentation .P \fB\-\-maxerr\fP Maximum number of errors .P \fB\-\-maxlen\fP Maximum line length .P \fB\-\-newcap\fP Tolerate uncapitalized constructors .P \fB\-\-node\fP Assume Node\.js .P \fB\-\-nomen\fP Tolerate dangling underscore in identifiers .P \fB\-\-passfail\fP Stop on first error .P \fB\-\-plusplus\fP Tolerate ++ and \-\- .P \fB\-\-predef\fP Declare additional predefined globals .P \fB\-\-properties\fP Require all property names to be declared with /\fIproperties\fR/ .P \fB\-\-regexp\fP Tolerate \. and [^\.\.\.]\. in /RegExp/ .P \fB\-\-rhino\fP Assume Rhino .P \fB\-\-sloppy\fP Tolerate missing 'use strict' pragma .P \fB\-\-stupid\fP Tolerate stupidity (typically, use of sync functions) .P \fB\-\-sub\fP Tolerate inefficient subscripting .P \fB\-\-todo\fP Tolerate TODO comments .P \fB\-\-unparam\fP Tolerate unused parameters .P \fB\-\-vars\fP Tolerate many var statements per function .P \fB\-\-white\fP Tolerate messy white space .SH DEPRECATED OPTIONS .P \fB\-\-anon\fP Tolerate no space in anonymous function definition .P \fB\-\-es5\fP Tolerate ECMAScript 5 syntax .P \fB\-\-undef\fP Tolerate variables used before declaration .P \fB\-\-on\fP Tolerate HTML event handlers .P \fB\-\-windows\fP Assume existence of Windows globals .P ##EXAMPLES .P \fIMultiple files:\fR .P .RS 2 .nf jslint lib/color\.js lib/reporter\.js .fi .RE .P \fIAll JSLint options supported\fR .P .RS 2 .nf jslint \-\-white \-\-vars \-\-regexp lib/color\.js .fi .RE .P \fIDefaults to true, but you can specify false\fR .P .RS 2 .nf jslint \-\-bitwise false lib/color\.js .fi .RE .P \fIPass arrays\fR .P .RS 2 .nf jslint \-\-predef $ \-\-predef Backbone lib/color\.js .fi .RE .P \fIJSLint your entire project\fR .P .RS 2 .nf find \. \-name "*\.js" \-print0 | xargs \-0 jslint .fi .RE .P \fIUsing JSLint with a config file\fR .P Start with the included example jslintrc file and customize your options per project or copy it to $HOME/\.jslintrc to apply your setting globally .P ##INSTALLATION .P To install jslint globally, use npm install jslint \-g .P To install jslint locally, use npm install jslint .P When installed locally, jslint can be run as \./node_modules/\.bin/jslint .P ##FILES .P jslint looks for the following config files at startup: .P $HOME/\.jslintrc \./jslintrc \./\.jslintrc .P 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 \fBtrue\fP to enable and \fBfalse\fP to disable boolean options\. An example of a valid option file is: .P { "vars": true, "white": true, "maxlen": 100, "predef": "foo,bar,baz" } .P Comments are not allowed in option files\. .P ##PRECEDENCE .P The order of precedence for options is as follows: .RS 0 .IP 1. 3 in the $HOME/\.jslintrc .IP 2. 3 in \./jslintrc or \./\.jslintrc .IP 3. 3 on the command line .IP 4. 3 in a /*jslint*/ comment .RE .P A higher number indicates a higher precedence, i\.e\. command line options override options specified by an options file, and /*jslint*/ comments in the file being examined have the highest precedence\. .P ##EDITIONS .P You can now specify the edition of jslint with the \fI\-\-edition\fR option\. .P Future versions of this package may include newer editions of jslint; to always use the latest edition of jslint, specify \-\-edition=latest: .P .RS 2 .nf jslint \-\-edition=latest lib/*\.js .fi .RE .P The default edition of jslint will remain stable as long as the leading two components of the version number are the same\. New minor editions may have a different default edition\. .P The previous version of this package (0\.1\.9) shipped an older edition (2013\-02\-03) of jslint\. To revert to that behavior but still have the new config file features, upgrade to 0\.2\.1 of this package and specify \fBedition: '2012\-02\-03'\fP in your jslintrc file or \fB\-\-edition=2013\-02\-03\fP on the command line\. .P We recommend the following practices: .P ###If your project is in maintenance mode .P Choose an edition of jslint and hardcode it into your project's lint config files, e\.g\., \fBedition: '2012\-02\-03'\fP\|\. Specify a fixed version of jslint (e\.g\., "0\.2\.1") as a devDependency in package\.json .P ###If your project needs temporary stability (e\.g\., release phase) .P Use the default edition of jslint (no \fB\-\-edition\fP argument needed) and specify a fixed minor version (e\.g, "~0\.2") as a devDependency in package\.json .P ###If you want the bleeding\-edge version .P Specify \fBedition: 'latest'\fP and use any 'latest version' behavior in package\.json, e\.g\., "*" or ">0\.2\.1" .P ##RETURN VALUES .P jslint returns 1 if it found any problems, 0 otherwise\. .P ##AUTHOR .P jslint is written and maintained by Douglas Crockford \fIhttps://github\.com/douglascrockford/JSLint\fR .P This package is node\-jslint, which provides a command\-line interface for running jslint using the nodejs platform\. node\-jslint was written by Reid Burke and is maintained by Reid Burke, Ryuichi Okumura, and Sam Mikes\. .P ##BUGS .P There are no known bugs\. Submit bugs to \fIhttps://github\.com/reid/node\-jslint/issues\fR .P 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 \fIhttps://plus\.google\.com/communities/104441363299760713736\fR or the issue tracker at \fIhttps://github\.com/douglascrockford/JSLint/issues\fR