add eslint task to gulp to let us know how we need to write better code

This commit is contained in:
terakilobyte
2015-04-15 18:20:20 -04:00
parent 3748356079
commit 6341b1158b
2 changed files with 11 additions and 3 deletions

View File

@ -5,7 +5,8 @@ var gulp = require('gulp'),
sync = require('browser-sync'),
reload = sync.reload,
inject = require('gulp-inject'),
reloadDelay = 1000;
reloadDelay = 1000,
eslint = require('gulp-eslint');
var paths = {
server: './app.js',
@ -54,11 +55,17 @@ gulp.task('sync', ['serve'], function() {
sync.init(null, {
proxy: 'http://localhost:3000',
logLeval: 'debug',
files: ['public/**/*'],
files: ['public/js/lib/*/*.{js, jsx}'],
port: 3001,
open: true,
reloadDelay: reloadDelay
});
});
gulp.task('default', ['serve', 'sync']);
gulp.task('lint', function() {
return gulp.src(['public/js/lib/**/*'])
.pipe(eslint())
.pipe(eslint.format());
});
gulp.task('default', ['lint', 'serve', 'sync']);

View File

@ -74,6 +74,7 @@
"browser-sync": "^1.8.1",
"chai": "^1.10.0",
"gulp": "^3.8.8",
"gulp-eslint": "^0.9.0",
"gulp-inject": "^1.0.2",
"gulp-nodemon": "^1.0.4",
"mocha": "^2.0.1",