Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Passing options to gulp-jshint

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.

like image 730
whitehawk Avatar asked Feb 11 '14 01:02

whitehawk


1 Answers

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.

like image 181
OverZealous Avatar answered Nov 18 '22 21:11

OverZealous