summaryrefslogtreecommitdiffstats
path: root/gulpfile.js
diff options
context:
space:
mode:
authorHendrik Leppelsack <hendrik@leppelsack.de>2016-03-09 11:13:16 +0100
committerHendrik Leppelsack <hendrik@leppelsack.de>2016-03-09 11:28:52 +0100
commitdff149a63e80dad707312da15af9be9914bdcc41 (patch)
tree21c2f3c9a65de5d044231383e2f6bc358e6b32b4 /gulpfile.js
parent297d8157455b68a7fe8c5819b7c92fd9b82019ae (diff)
add better js linting
Diffstat (limited to 'gulpfile.js')
-rw-r--r--gulpfile.js19
1 files changed, 16 insertions, 3 deletions
diff --git a/gulpfile.js b/gulpfile.js
index 852a627b..7f262af4 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -1,6 +1,6 @@
var gulp = require('gulp'),
concat = require('gulp-concat'),
- jshint = require('gulp-jshint');
+ eslint = require('gulp-eslint');
gulp.task('js', function() {
return gulp.src([
@@ -10,12 +10,25 @@ gulp.task('js', function() {
'js/services/**/*.js',
'js/filters/**/*.js'
])
- .pipe(jshint('.jshintrc'))
- .pipe(jshint.reporter('default'))
+ .pipe(eslint())
+ .pipe(eslint.format())
.pipe(concat('script.js'))
.pipe(gulp.dest('js/public'));
});
+gulp.task('eslint', function() {
+ return gulp.src([
+ 'js/main.js',
+ 'js/components/**/*.js',
+ 'js/models/**/*.js',
+ 'js/services/**/*.js',
+ 'js/filters/**/*.js'
+ ])
+ .pipe(eslint())
+ .pipe(eslint.format())
+ .pipe(eslint.failAfterError());
+})
+
gulp.task('watch', ['js'], function() {
gulp.watch('js/**/*.js', ['js']);
});