问题
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:
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));
});
来源:https://stackoverflow.com/questions/30935717/gulp-jscs-autofix-doesnt-work