您好,我有以下 gulp 任务对解决方案进行 linting 并在 linting 过程中出现任何错误后失败,我希望它因文本而失败,而不仅仅是在一堆中摔倒,我不知道如何实现这一点。任何帮助,将不胜感激。
gulp.task('lint-solution', function(done){
log('Linting solution')
return gulp.src(['../CRMPortal/**/*.js','../Common/**/*.js','!../Common/scripts/**/*','!../node_modules/**','!../CRMPortal/dist/**','!../CRMPortal/gulpfile.js'])
.pipe($.eslint({configFile: ".eslintrc.json"}))
.pipe($.eslint.format(
reporter, function(results){
fs.writeFileSync(path.join(__dirname,'report.html'), results);
}
))
.pipe($.eslint.failAfterError()); <-- I want text I provide to be printed on error here should that be the case , not just the error
})
目前(显然)我得到的只是:
Message:
Failed with 1 error