安装和使用

安装

$ npm install gulp-jslint --save-dev

用法

在 gulpfile.js 中添加:

var gulp = require('gulp');
var jslint = require('gulp-jslint');

gulp.task('lint', function(){
    return gulp.src(['source.js'])
        .pipe(jslint({ /* this object represents the JSLint directives being passed down */ }))
        .pipe(jslint.reporter( 'my-reporter' ));
});

使用此任务:

$ ./node_modules/gulp/bin/gulp.js lint