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?

royhowie
  • 11,075
  • 14
  • 50
  • 67
Gregory Leleytner
  • 159
  • 1
  • 1
  • 7
  • same here not working for me as well – Sagar Rabadiya Oct 14 '15 at 06:46
  • 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. – Allan Kimmer Jensen Mar 02 '16 at 14:01
  • 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. – Jean F. Mar 12 '16 at 04:21

1 Answers1

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

AuthorProxy
  • 7,946
  • 3
  • 27
  • 40