[英]gulp-jshint package: How to send parameters (without .jshintrc file)?
我目前正在嘗試將咕unt的項目遷移到gulp項目。 實際上,在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"] } }
因此,當我在終端中編寫“ grunt jshint”時,它似乎可以正常工作。 但是,在gulpfile中,我這樣寫:
gulp.task("jshint", function() { return gulp.src( basePath + "js/**/*.js" ) .pipe( jshint( { "trailing": true,..., "globals": true } ) ) .pipe( jshint.reporter("default") ); });
但是,當我在終端中寫“ gulp jshint”時,它崩潰了。
我的問題是:有沒有一種方法可以通過gulp-jshint節點包發送不帶.jshintrc文件的jshint參數? (我已經閱讀了npm網站上的文檔,但是我不理解“ lookup”選項)
globals是一個數組,不是true false,這是我的示例。 查找工作就像您在想的那樣。
gulp.src(files.backend)
.pipe(jshint({ "lookup": false, /* other options */ "globals": ['$']}))
.pipe(jshint.reporter(stylish))
.on('error', gutil.log);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.