gulp-jscs autofix doesn't work
Asked Answered
M

1

7

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?

Manipur answered 19/6, 2015 at 10:20 Comment(3)
same here not working for me as wellAnchusin
Could you try to add .pipe(jscs.reporter()) after your frist jscs, it might give some information, maybe it's not loading the rules ect.Floc
It seems that all errors are not automatically fixed, could you please add more details like what sort of errors you expect to be fixed. Also please tried to introduce obvious and different kind of errors in your code to check if it fixes some of them.Guevara
C
0

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)); });

Charleton answered 16/3, 2016 at 12:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.