diff options
author | kumavis <kumavis@users.noreply.github.com> | 2016-06-22 05:24:28 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-22 05:24:28 +0800 |
commit | 537328b5298a42f9d20862d42b9012babcda373c (patch) | |
tree | 9a5728447f5b23a918b4a23c12e91ea1b702e527 /gulpfile.js | |
parent | bb7788373d9c234313d651d88c72c18a8e4ca0aa (diff) | |
parent | d7c3e8e9f5182576eb4a990d385ff8ce4ebd417c (diff) | |
download | tangerine-wallet-browser-537328b5298a42f9d20862d42b9012babcda373c.tar tangerine-wallet-browser-537328b5298a42f9d20862d42b9012babcda373c.tar.gz tangerine-wallet-browser-537328b5298a42f9d20862d42b9012babcda373c.tar.bz2 tangerine-wallet-browser-537328b5298a42f9d20862d42b9012babcda373c.tar.lz tangerine-wallet-browser-537328b5298a42f9d20862d42b9012babcda373c.tar.xz tangerine-wallet-browser-537328b5298a42f9d20862d42b9012babcda373c.tar.zst tangerine-wallet-browser-537328b5298a42f9d20862d42b9012babcda373c.zip |
Merge pull request #303 from MetaMask/AutoLint
Auto lint
Diffstat (limited to 'gulpfile.js')
-rw-r--r-- | gulpfile.js | 22 |
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 |