gulp-jscs autofix doesn't work

 ̄綄美尐妖づ 提交于 2019-12-10 12:59:13

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!