Open gucong3000 opened 7 years ago
关键的代码时这样的:
return gulp.src(globs, {
stripBOM: false,
base: process.cwd()
})
// 排除二进制文件
.pipe(filter(file => !(file && file.isBuffer() && fileType(file.contents))))
// 排除`.gitignore`中定义的文件
.pipe(gitignore())
// htmlhint
.pipe(gulpif(file => /\.html?$/i.test(file.path), htmlhint(config)))
// eslint
.pipe(gulpif(file => /\.jsx?$/i.test(file.path), eslint(config)))
// stylelint
.pipe(gulpif(file => /\.s?css$/i.test(file.path), postcss([stylelint(config)])))
// editorconfig
.pipe(fix ? eclint.fix() : eclint.check())
// 错误汇报
.pipe(fix ? gulp.dest(".") : reporter());
很高兴见到ghooks被加入到项目中来,我想为本项目安装更多的linter,@doyoe ,请确认一下哪些是你愿意接受的。