I have the following (simplified) set-up in my gulpfile:
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var jscs = require('gulp-jscs');
var watch = require('gulp-watch');
var paths = {
scripts: ['js/*.js']
}
var jscsRunner = jscs({
disallowMixedSpacesAndTabs: true // etc
});
var jshintRunner = jshint({
browser: true // etc
});
// this outputs messages from jshint no problem
gulp.task('jshint', function() {
return gulp.src(paths.scripts)
.pipe(jshintRunner)
.pipe(jshint.reporter('default'));
});
// this outputs messages from jscs no problem
gulp.task('jscs', function() {
return gulp.src(paths.scripts)
.pipe(jscsRunner);
});
// this only outputs messages from jshint
gulp.task('watch', function() {
return watch(paths.scripts)
.pipe(jscsRunner)
.pipe(jshintRunner)
.pipe(jshint.reporter('default'));
});
My problem is - as indicated - that in the watch
task no output is generated from jscs
, even though the pipeline is essentially exactly the same as in the jscs
task, where it works as expected.
(I'm running this on Windows.)
EDIT: This issue has been reproduced and discussed here: https://github.com/jscs-dev/gulp-jscs/pull/66