Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

164 lines (131 sloc) 4.987 kb

node-lint(1) -- Run JSLint from the command-line under node.js

SYNOPSIS

node-lint [options] <file-or-directory> [<file-or-directory> ...]

DESCRIPTION

The node-lint command-line tool allows you to check for problems and ensure
the code quality of your JavaScript files using JSLint.

It is completely extensible so you can use your own custom JSLint config or
even use custom formatters that better integrate with your quality assurance
framework.

OPTIONS

--formatter FILE:
Override the default formatter with your own custom module. See
the examples/ directory for custom formatters that come
bundled with node-lint.

--config FILE:
Override the default config.js with your own config file.

-h, --help:
Display the help and exit.

-v, --version:
Output version information and exit.

: You can run node-lint on specific files or on all \.js* files inside
a directory.

CONFIG

You can customize the JSLint options by modifying the default config.js
file or by providing your own config file with the --config parameter:

node-lint --config path/to/custom.json file1.js file2.js ...

For example, if the default config.json looks like:

{
    "adsafe"       : false,
    "bitwise"      : true,
    "error_prefix" : "\u001b[1m",
    "error_suffix" : ":\u001b[0m "
};

And your custom.json looks like:

{
    "bitwise"      : false,
    "browser"      : false
};

Then the final options will be:

{
    "adsafe"       : false,
    "bitwise"      : false,
    "browser"      : false,
    "error_prefix" : "\u001b[1m",
    "error_suffix" : ":\u001b[0m "
};

JSLINT OPTIONS

  • adsafe:
    True if ADsafe rules should be enforced. See http://www.ADsafe.org/.
  • bitwise:
    True if bitwise operators should not be allowed.
  • browser:
    True if the standard browser globals should be predefined.
  • cap:
    True if upper case HTML should be allowed.
  • css:
    True if CSS workarounds should be tolerated.
  • debug:
    True if debugger statements should be allowed.
    Set this option to false before going into production.
  • devel:
    True if browser globals that are useful in development
    (console, alert, ...) should be predefined.
  • eqeqeq:
    True if === should be required.
  • es5:
    True if ES5 syntax should be allowed.
  • evil:
    True if eval should be allowed.
  • forin:
    True if unfiltered for in statements should be allowed.
  • fragment:
    True if HTML fragments should be allowed.
  • immed:
    True if immediate function invocations must be wrapped in parens
  • indent:
    The number of spaces used for indentation (default is 4)
  • laxbreak:
    True if statement breaks should not be checked.
  • maxerr:
    The maximum number of warnings reported (default is 50)
  • maxlen:
    The maximum number of characters in a line
  • nomen:
    True if names should be checked for initial or trailing underbars
  • newcap:
    True if Initial Caps must be used with constructor functions.
  • on:
    True if HTML event handlers should be allowed.
  • onevar:
    True if only one var statement per function should be allowed.
  • passfail:
    True if the scan should stop on first error.
  • plusplus:
    True if ++ and -- should not be allowed.
  • predef:
    An array of strings (comma separated), the names of predefined global variables.
    predef is used with the option object, but not with the /*jslint */ comment.
    Use the var statement to declare global variables in a script file.
  • regexp:
    True if . and [^...] should not be allowed in RegExp literals.
    These forms should not be used when validating in secure applications.
  • rhino:
    True if the Rhino environment globals should be predefined.
  • safe:
    True if the safe subset rules are enforced. These rules are used by ADsafe.
    It enforces the safe subset rules but not the widget structure rules.
  • strict:
    True if the ES5 "use strict"; pragma is required. Do not use this option carelessly.
  • sub:
    True if subscript notation may be used for expressions better expressed in dot notation.
  • undef:
    True if variables must be declared before used.
  • white:
    True if strict whitespace rules apply.
  • widget:
    True if the Yahoo Widgets globals should be predefined.
  • windows:
    True if the Windows globals should be predefined.

AUTHORS

Originally written by Tav and other node-lint contributors. Forked by jpolo. Contributors list: http://github.com/tav/nodelint/contributors.

REPORTING BUGS

Report node-lint bugs to http://github.com/jpolo/node-lint/issues.

COPYRIGHT

node-lint is under MIT License.

SEE ALSO

node(1)

Jump to Line
Something went wrong with that request. Please try again.