简体   繁体   English

将选项传递给gulp-jshint

[英]Passing options to gulp-jshint

I'm using gulp to build my JavaScript. 我正在使用gulp来构建我的JavaScript。 I want to run jshint on my files before I concat them, but I'm having trouble setting options. 我想在连接它们之前在我的文件上运行jshint,但是我在设置选项时遇到了麻烦。 Am I doing this right? 我这样做了吗?

var res = gulp.src(buildutil.produceFileGlob("./src", clientproperties))
            .pipe(exclude('**/test/**'))
            .pipe(jshint({ sub: false }}))
            .pipe(jshint.reporter(stylish))
            .pipe(buildutil.jsmoduleConcat("myfile.js"))
            .pipe(gulp.dest('./dist'))
            .pipe(closureCompiler(closureOptions))
            .pipe(header(buildutil.getBuildHeader()))
            .pipe(gulp.dest('./dist'));

So all this works, and jshint is outputting its errors, but my sub:false flag does not seem to take effect. 所以这一切都有效,jshint正在输出它的错误,但是我的sub:false标志似乎没有生效。

The sub option is set to false by default — you need to set it to true to have any effect . 默认情况下, sub选项设置为false - 您需要将其设置为true才能生效

Otherwise, you are using it correctly. 否则,您正确使用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM