No problems running the gulp-jscs plugin to analyze my code using the following task. However when I add fix:true
, nothing changes in the files and JSCS now acts like it isn't running at all... when I remove the object passed into the JSCS plugin and remove the gulp.dest()
line, it will report code style issues.
So, it seems either passing in the fix:true
or tying to write back the fixed files causes JSCS to short circuit internally... ideas?
var $ = require('gulp-load-plugins')({lazy: true});
gulp.task('vet', function () {
log('Analyzing source with JSHint and JSCS');
return gulp
.src(config.allJs, {base: './'})
.pipe($.jshint())
.pipe($.jshint.reporter('jshint-stylish', {verbose: true}))
.pipe($.jscs({fix:true}))
.pipe(gulp.dest('./'));
});
Update 2
I have found a simpler/cleaner way to do, just specify the base parameter
then file.name will contain the full path so you can output to the current directory
so at the end:
Update 1
I have been tackling this problem with this piece of code:
dependencies:
Globally, gulp-foreach iterates over every src with its own stream, rimraf delete the file before writing on vinyl.base destination.
Let me know if it helps.