finish .eslintrc file and update gulp task

This commit is contained in:
Matteo Pagliazzi
2015-11-04 18:25:29 +01:00
parent f02ef9b6be
commit 235f1977ba
2 changed files with 50 additions and 38 deletions

View File

@@ -1,45 +1,15 @@
import gulp from 'gulp';
import eslint from 'gulp-eslint';
import _ from 'lodash';
// TODO remove once we upgrade to lodash 3
const defaultsDeep = _.partialRight(_.merge, _.defaults);
const shared = {
rules: {
indent: [2, 2],
quotes: [2, 'single'],
'linebreak-style': [2, 'unix'],
semi: [2, 'always']
},
extends: 'eslint:recommended',
env: {
es6: true
}
};
gulp.task('lint:client', () => {
// Ignore .coffee files
return gulp.src(['./website/public/js/**/*.js'])
.pipe(eslint(defaultsDeep({
env: {
node: true
}
}, shared)))
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});
// TODO lint client
// TDOO separate linting cong between
gulp.task('lint:server', () => {
// Ignore .coffee files
return gulp.src(['./website/src/**/*.js'])
.pipe(eslint(defaultsDeep({
env: {
browser: true
}
}, shared)))
return gulp
.src(['./website/src/**/api-v3/**/*.js'])
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});
gulp.task('lint', ['lint:server', 'lint:client']);
gulp.task('lint', ['lint:server']);