[英]gulp-jscs seems to be unable to detect the config (.jscsrc) file, but normal jscs can from the command line
[英]gulp-jscs save report to file
是否可以运行jscs
检查并使用jscs
并将生成的报告保存到文件中?
我希望将junit
样式xml文件报告保存在某个地方。 我可以使用带有>
直接命令行调用来执行此操作,但是如何使用正确的gulp来执行此操作?
您可以使用gulp-log-capture
捕获gulp-jscs
的输出并将其写入文件。
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'));
});
请注意,这将为每个JS输入文件生成一个JUnit样式的XML输出文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.