最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Passing options to gulp-jshint - Stack Overflow

programmeradmin1浏览0评论

I'm using gulp to build my JavaScript. I want to run jshint on my files before I concat them, but I'm having trouble setting options. 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.

I'm using gulp to build my JavaScript. I want to run jshint on my files before I concat them, but I'm having trouble setting options. 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.

Share Improve this question asked Feb 11, 2014 at 1:50 whitehawkwhitehawk 2,42529 silver badges33 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 6

The sub option is set to false by default — you need to set it to true to have any effect.

Otherwise, you are using it correctly.

发布评论

评论列表(0)

  1. 暂无评论