mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-04 15:07:02 +03:00
Add more strict rules (eslint)
This commit is contained in:
parent
b43bb17cdb
commit
52e2698cdf
38 changed files with 488 additions and 434 deletions
|
|
@ -45,6 +45,8 @@ var
|
|||
gulpif = require('gulp-if'),
|
||||
eol = require('gulp-eol'),
|
||||
livereload = require('gulp-livereload'),
|
||||
eslint = require('gulp-eslint'),
|
||||
cache = require('gulp-cached'),
|
||||
gutil = require('gulp-util')
|
||||
;
|
||||
|
||||
|
|
@ -414,9 +416,10 @@ gulp.task('js:min', ['js:app', 'js:admin', 'js:validate'], function() {
|
|||
|
||||
// lint
|
||||
gulp.task('js:eslint', function() {
|
||||
var eslint = require('gulp-eslint');
|
||||
return gulp.src(cfg.paths.globjsall)
|
||||
.pipe(cache('eslint'))
|
||||
.pipe(eslint())
|
||||
.pipe(gulpif(cfg.watch, plumber({errorHandler: notify.onError("Error: <%= error.message %>")})))
|
||||
.pipe(eslint.format())
|
||||
.pipe(eslint.failAfterError());
|
||||
});
|
||||
|
|
@ -662,6 +665,7 @@ gulp.task('watch', ['fast'], function() {
|
|||
cfg.watch = true;
|
||||
livereload.listen();
|
||||
gulp.watch(cfg.paths.globjs, {interval: cfg.watchInterval}, ['js:app', 'js:admin']);
|
||||
gulp.watch(cfg.paths.globjsall, {interval: cfg.watchInterval}, ['js:validate']);
|
||||
gulp.watch(cfg.paths.less.main.watch, {interval: cfg.watchInterval}, ['css:main']);
|
||||
});
|
||||
|
||||
|
|
@ -669,6 +673,7 @@ gulp.task('watch+', ['fast+'], function() {
|
|||
cfg.watch = true;
|
||||
livereload.listen();
|
||||
gulp.watch(cfg.paths.globjs, {interval: cfg.watchInterval}, ['js:app', 'js:admin']);
|
||||
gulp.watch(cfg.paths.globjsall, {interval: cfg.watchInterval}, ['js:validate']);
|
||||
gulp.watch(cfg.paths.less.main.watch, {interval: cfg.watchInterval}, ['css:main']);
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue