It's JSLint for Gulp.js.
Simply install with npm by running
npm install gulp-jslint.
var gulp = require'gulp';var jslint = require'gulp-jslint';gulptask'default'return gulpsrc'source.js'pipejslint /* this object represents the JSLint directives being passed down */pipejslintreporter 'my-reporter' ;;
If you would like to specify a custom jslint edition to use, set the property 'edition' in your directives object. These versions should follow what the package node-jslint expects or this property can be set to a pre-loaded jslint function.
All directives being passed to the
jslint() function are standard JSLint directives (for a list of directives,
see the official JSLint docs).
However, to supply a list of global variables for your code, use the directive 'predef' or 'global' like so ('global' is an alias of 'predef' but 'predef' will be prefered since it is the official JSLint standard):
gulptask'default'return gulpsrc'source.js'pipejslintpredef: 'a_global'global: 'a_global';;
gulpfile.js for a more extensive sample gulpfile.
By default, two reporters are provided by gulp-jslint. The first is the default reporter (appropriately named 'default') and the second report is the popular 'jshint-stylish' (named 'stylish').
To use either of these reporters, provide the name of the reporter followed by whatever arguments they expect to the function
gulptask'default'return gulpsrc'source.js'pipejslintpipejslintreporter'default' errorsOnlypipejslintreporter'stylish' options;;
It's probably a good idea to use something like
path.basename() on the
file property to avoid lots of garbage in the
command-line (i.e. path.basename('/path/to/index.js') === 'index.js').
Custom reporters should be either be synchronous or streams. Either way, the reporter will receive a
results object and can
output its report onto the console/logfile the way it wishes.
The results object will contain the following properties:
Copyright (C) 2014-2016 Karim Alibhai. Code is licensed under the MIT license.
Please use the official issues section in GitHub to post issues or feature requests. Stars and helpful comments are much appreciated! :)