mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 22:27:26 +01:00
lint: Move test eslint rules to .eslintrc in test directory
This commit is contained in:
@@ -33,7 +33,7 @@ let linter = (src, options) => {
|
|||||||
.pipe(eslint(options))
|
.pipe(eslint(options))
|
||||||
.pipe(eslint.format())
|
.pipe(eslint.format())
|
||||||
.pipe(eslint.failAfterError());
|
.pipe(eslint.failAfterError());
|
||||||
}
|
};
|
||||||
|
|
||||||
// TODO lint client
|
// TODO lint client
|
||||||
// TDOO separate linting cong between
|
// TDOO separate linting cong between
|
||||||
@@ -49,24 +49,7 @@ gulp.task('lint:common', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('lint:tests', () => {
|
gulp.task('lint:tests', () => {
|
||||||
let options = {
|
return linter(TEST_FILES);
|
||||||
rules: {
|
|
||||||
'one-var': 0,
|
|
||||||
'max-nested-callbacks': 0,
|
|
||||||
'no-unused-expressions': 0,
|
|
||||||
'mocha/no-exclusive-tests': 2,
|
|
||||||
'mocha/no-global-tests': 2,
|
|
||||||
'mocha/handle-done-callback': 2,
|
|
||||||
},
|
|
||||||
globals: {
|
|
||||||
'expect': true,
|
|
||||||
'_': true,
|
|
||||||
'sinon': true,
|
|
||||||
},
|
|
||||||
plugins: [ 'mocha' ],
|
|
||||||
};
|
|
||||||
|
|
||||||
return linter(TEST_FILES, options);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('lint', ['lint:server', 'lint:common', 'lint:tests']);
|
gulp.task('lint', ['lint:server', 'lint:common', 'lint:tests']);
|
||||||
|
|||||||
16
test/.eslintrc
Normal file
16
test/.eslintrc
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"rules": {
|
||||||
|
"one-var": 0,
|
||||||
|
"max-nested-callbacks": 0,
|
||||||
|
"no-unused-expressions": 0,
|
||||||
|
"mocha/no-exclusive-tests": 2,
|
||||||
|
"mocha/no-global-tests": 2,
|
||||||
|
"mocha/handle-done-callback": 2
|
||||||
|
},
|
||||||
|
"globals": {
|
||||||
|
"expect": true,
|
||||||
|
"_": true,
|
||||||
|
"sinon": true
|
||||||
|
},
|
||||||
|
"plugins": [ "mocha" ]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user