tools/gulpfile.js

23 lines
440 B
JavaScript
Raw Normal View History

2019-06-25 14:58:08 +02:00
const gulp = require('gulp');
const eslint = require('gulp-eslint');
const srcDir = [
'src/*.js',
'src/**/*.js',
];
function checkSrc() {
return gulp.src(srcDir)
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
}
function watchEslint() {
gulp.watch(srcDir, checkSrc);
}
gulp.task('check:lint', checkSrc);
gulp.task('watch:lint', watchEslint);
gulp.task('default', gulp.parallel('watch:lint'));