Is there a possibility to run jscs
check and using gulp and save report it produces to a file?
I want junit
style xml files reports saved somewhere. I can do this using direct command line call with >
but how to do it using proper gulp?
You can use gulp-log-capture
to capture the output of gulp-jscs
and write it to a file.
var logCapture = require('gulp-log-capture');
gulp.task('checkstyle', () => {
return gulp.src('*.js')
.pipe(jscs({fix:true}))
.pipe(logCapture.start(console, 'log'))
.pipe(jscs.reporter('junit'))
.pipe(logCapture.stop('xml'))
.pipe(gulp.dest('junit-reports'));
});
Note that this will produce one JUnit-style XML output file per JS input file.