2015-09-25 13:44:45 +00:00
|
|
|
import gulp from 'gulp';
|
|
|
|
|
import eslint from 'gulp-eslint';
|
|
|
|
|
|
2015-11-14 13:40:05 +00:00
|
|
|
// TODO lint client
|
|
|
|
|
// TDOO separate linting cong between
|
|
|
|
|
// TODO lint gulp tasks, tests, ...?
|
|
|
|
|
// TODO what about prefer-const rule?
|
|
|
|
|
// TODO remove estraverse dependency once https://github.com/adametry/gulp-eslint/issues/117 sorted out
|
2015-09-25 13:44:45 +00:00
|
|
|
gulp.task('lint:server', () => {
|
2015-11-14 13:40:05 +00:00
|
|
|
return gulp
|
|
|
|
|
.src([
|
|
|
|
|
'./website/src/**/api-v3/**/*.js',
|
2015-11-14 13:49:48 +00:00
|
|
|
// Comment these out in develop, uncomment them in api-v3
|
|
|
|
|
// './website/src/models/user.js',
|
|
|
|
|
// './website/src/server.js'
|
2015-11-14 13:40:05 +00:00
|
|
|
])
|
|
|
|
|
.pipe(eslint())
|
2015-09-25 13:44:45 +00:00
|
|
|
.pipe(eslint.format())
|
|
|
|
|
.pipe(eslint.failAfterError());
|
|
|
|
|
});
|
|
|
|
|
|
2015-11-14 13:49:48 +00:00
|
|
|
gulp.task('lint:common', () => {
|
|
|
|
|
return gulp
|
|
|
|
|
.src([
|
|
|
|
|
'./common/script/**/*.js',
|
|
|
|
|
// @TODO remove these negations as the files are converted over.
|
|
|
|
|
'!./common/script/index.js',
|
|
|
|
|
'!./common/script/content/index.js',
|
|
|
|
|
'!./common/script/src/**/*.js',
|
|
|
|
|
'!./common/script/public/**/*.js',
|
|
|
|
|
])
|
|
|
|
|
.pipe(eslint())
|
|
|
|
|
.pipe(eslint.format())
|
|
|
|
|
.pipe(eslint.failAfterError());
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
gulp.task('lint', ['lint:server', 'lint:common']);
|