mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-15 21:57:22 +01:00
chore: Switch to custom eslint-config
This commit is contained in:
@@ -1,63 +0,0 @@
|
||||
import gulp from 'gulp';
|
||||
import eslint from 'gulp-eslint';
|
||||
|
||||
const SERVER_FILES = [
|
||||
'./website/src/**/api-v3/**/*.js',
|
||||
// Comment these out in develop, uncomment them in api-v3
|
||||
// './website/src/models/user.js',
|
||||
// './website/src/server.js'
|
||||
];
|
||||
const COMMON_FILES = [
|
||||
'./common/script/**/*.js',
|
||||
// @TODO remove these negations as the files are converted over.
|
||||
'!./common/script/index.js',
|
||||
'!./common/script/content/index.js',
|
||||
'!./common/script/ops/**/*.js',
|
||||
'!./common/script/fns/**/*.js',
|
||||
'!./common/script/libs/**/*.js',
|
||||
'!./common/script/public/**/*.js',
|
||||
];
|
||||
const TEST_FILES = [
|
||||
'./test/**/*.js',
|
||||
// @TODO remove these negations as the test files are cleaned up.
|
||||
'!./test/api-legacy/**/*',
|
||||
'!./test/common/simulations/**/*',
|
||||
'!./test/content/**/*',
|
||||
'!./test/server_side/**/*',
|
||||
'!./test/spec/**/*',
|
||||
];
|
||||
|
||||
let linter = (src, options) => {
|
||||
return gulp
|
||||
.src(src)
|
||||
.pipe(eslint(options))
|
||||
.pipe(eslint.format())
|
||||
.pipe(eslint.failAfterError());
|
||||
};
|
||||
|
||||
// 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
|
||||
gulp.task('lint:server', () => {
|
||||
return linter(SERVER_FILES);
|
||||
});
|
||||
|
||||
gulp.task('lint:common', () => {
|
||||
return linter(COMMON_FILES);
|
||||
});
|
||||
|
||||
gulp.task('lint:tests', () => {
|
||||
return linter(TEST_FILES);
|
||||
});
|
||||
|
||||
gulp.task('lint', ['lint:server', 'lint:common', 'lint:tests']);
|
||||
|
||||
gulp.task('lint:watch', () => {
|
||||
gulp.watch([
|
||||
SERVER_FILES,
|
||||
COMMON_FILES,
|
||||
TEST_FILES,
|
||||
], ['lint']);
|
||||
});
|
||||
@@ -338,7 +338,6 @@ gulp.task('test:api-v2:safe', ['test:prepare:server'], (done) => {
|
||||
|
||||
gulp.task('test:all', (done) => {
|
||||
runSequence(
|
||||
'lint',
|
||||
'test:e2e:safe',
|
||||
'test:common:safe',
|
||||
'test:content:safe',
|
||||
|
||||
Reference in New Issue
Block a user