gulp-jscs autofix doesn't work

497 Views Asked by At

I have the following code in my gulpfile.js

gulp.src(['server.js'])
    .pipe(jscs({fix: true}))
    .pipe(gulp.dest('prod-app'));

But in prod-app/server.js is the same file as server.js. Without any fixes. How to fix it?

1

There are 1 best solutions below

0
On

You can read about base option to modify a lot of scripts together here and use it like this:

gulp.task('lint-jscs-fix', function() { return gulp.src(quantumArtScripts, { base: './' }) .pipe(jscs({ fix: true })) .pipe(jscs.reporter()) // log all errors that should be fixed .pipe(gulp.dest('.')) // destination of files .on('error', console.error.bind(console)); });