aboutsummaryrefslogtreecommitdiffstats
path: root/gulpfile.js
diff options
context:
space:
mode:
Diffstat (limited to 'gulpfile.js')
-rw-r--r--gulpfile.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/gulpfile.js b/gulpfile.js
index 63eb22a2c..941155ff4 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -9,6 +9,9 @@ var sourcemaps = require('gulp-sourcemaps')
var assign = require('lodash.assign')
var livereload = require('gulp-livereload')
var del = require('del')
+var eslint = require('gulp-eslint')
+var fs = require('fs')
+var path = require('path')
// browser reload
@@ -49,6 +52,25 @@ gulp.task('copy:watch', function(){
gulp.watch(['./app/{_locales,images}/*', './app/scripts/chromereload.js', './app/*.{html,json}'], gulp.series('copy'))
})
+// lint js
+
+gulp.task('lint', function () {
+ // Ignoring node_modules, dist, and docs folders:
+ return gulp.src(['app/**/*.js', 'ui/**/*.js', '!node_modules/**', '!dist/**', '!docs/**', '!app/scripts/chromereload.js'])
+ .pipe(eslint(fs.readFileSync(path.join(__dirname, '.eslintrc'))))
+ // eslint.format() outputs the lint results to the console.
+ // Alternatively use eslint.formatEach() (see Docs).
+ .pipe(eslint.format())
+ // To have the process exit with an error code (1) on
+ // lint error, return the stream and pipe to failAfterError last.
+ .pipe(eslint.failAfterError())
+});
+
+/*
+gulp.task('default', ['lint'], function () {
+ // This will only run if the lint task is successful...
+});
+*/
// build js