jslint-node1.2.8 • Public • Published
Easily use JSLint through the command line or node modules.
This module is just a node wrapper for this program. It is not written, supported or endorsed by the author of JSLint.
Automatically fetches the latest version of JSLint from its github repository
Supports glob file patterns
Use JSLint in your node modules
Supports watching files and lint them on change
Use npm to install it either globally or project based
npm install -g jslint-node
jslint [options] file_patterns...
Where options can be:
CLI tool options: -u, --update - Update jslint.js file from https://raw.githubusercontent.com/douglascrockford/JSLint/master/jslint.js -v, --version - print the version of this module and also the current edition of JSLint and exit -w, --watch - watch for file changes and run jslint only on changed files. Script never ends -q, --quiet - produce output only on errors -t, --terse - produce terse output -c, --color - use ansi colors on terminal output (default is true), to disable enter -c=false, --color=false, --no-color or -no-c JSLint options: -f, --fudge - report lines/columns starting from 1 instead of 0 (default is true), to disable use --no-fudge, --fudge=false, -f=false or --no-f -d, --devel - assume development mode
If no local copy of the jslint.js file is found the program will attempt to download it from the github repository even without the
Notice that the only command line options passed to jslint are the fudge and devel options. The rest should be placed inside your source files that you want to jslint. It is the right place for these.
Also note that it is your responsibility to call this script with an update flag regulary to benefit from the latest version of JSLint. As a rule of thumb always update/jslint before commiting your code changes.
Through your node code
var linter = ;// Executing the jslinter function takes a boolean flag for refreshing the local jslint.js file// from the github repository or not and returns a promise. If no local jslint.js file is found the// program will attempt to fetch the jslint.js file from the internet anyway;
But then again you are executing code fetched from NPM with your account priviledges. But that is a different story...
See CHANGELOG.md for detailed change history
See LICENSE file.