gulp-jshint包:如何发送参数(没有.jshintrc文件)?

我目前正在尝试将一个咕噜项目迁移到一个吞噬项目。 其实,在gruntfile中(对于jshint任务)是这样的:

jshint: { options: { trailing:true, evil:false, indent:4, undef:true, unused:true, node:false, browser:false, loopfunc:true, devel:false }, default: { options: { browser:true, globals: { define:true } }, src: [basePath + "js/**/*.js"] } }

所以,当我在terminal上写下“grunt jshint”时,它似乎工作正常。 但是,在这个gulpfile中,我写下了这个:

gulp.task("jshint", function() { return gulp.src( basePath + "js/**/*.js" ) .pipe( jshint( { "trailing": true,..., "globals": true } ) ) .pipe( jshint.reporter("default") ); });

但是当我在terminal写“gulp jshint”时,它崩溃了。

我的问题是:有没有办法发送jshint参数没有.jshintrc文件与gulp-jshint节点包? (我已经阅读了npm网站上的文档,但是我没有看到“lookup”选项)

全局variables是一个数组,不是真的假,这里是我的例子。 查找工作就像你在想什么。

 gulp.src(files.backend) .pipe(jshint({ "lookup": false, /* other options */ "globals": ['$']})) .pipe(jshint.reporter(stylish)) .on('error', gutil.log);