mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
Add linting for tests
This commit is contained in:
12
.eslintrc
12
.eslintrc
@@ -81,6 +81,9 @@
|
|||||||
"block-spacing": [2, "always"],
|
"block-spacing": [2, "always"],
|
||||||
"key-spacing": [2, {"beforeColon": false, "afterColon": true}],
|
"key-spacing": [2, {"beforeColon": false, "afterColon": true}],
|
||||||
"max-nested-callbacks": [2, 3],
|
"max-nested-callbacks": [2, 3],
|
||||||
|
"mocha/no-exclusive-tests": 2,
|
||||||
|
"mocha/no-global-tests": 2,
|
||||||
|
"mocha/handle-done-callback": 2,
|
||||||
"new-cap": 2,
|
"new-cap": 2,
|
||||||
"new-parens": 2,
|
"new-parens": 2,
|
||||||
"newline-after-var": 2,
|
"newline-after-var": 2,
|
||||||
@@ -110,10 +113,17 @@
|
|||||||
},
|
},
|
||||||
"env": {
|
"env": {
|
||||||
"es6": true,
|
"es6": true,
|
||||||
|
"mocha": true,
|
||||||
"node": true
|
"node": true
|
||||||
},
|
},
|
||||||
ecmaFeatures : {
|
ecmaFeatures : {
|
||||||
modules: true
|
modules: true
|
||||||
},
|
},
|
||||||
"extends": "eslint:recommended"
|
"extends": "eslint:recommended",
|
||||||
|
"globals": {
|
||||||
|
"expect": true
|
||||||
|
},
|
||||||
|
"plugins": [
|
||||||
|
"mocha"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,6 +98,8 @@
|
|||||||
"coveralls": "^2.11.2",
|
"coveralls": "^2.11.2",
|
||||||
"csv": "~0.3.6",
|
"csv": "~0.3.6",
|
||||||
"deep-diff": "~0.1.4",
|
"deep-diff": "~0.1.4",
|
||||||
|
"eslint": "^1.9.0",
|
||||||
|
"eslint-plugin-mocha": "^1.1.0",
|
||||||
"event-stream": "^3.2.2",
|
"event-stream": "^3.2.2",
|
||||||
"expect.js": "~0.2.0",
|
"expect.js": "~0.2.0",
|
||||||
"istanbul": "^0.3.14",
|
"istanbul": "^0.3.14",
|
||||||
|
|||||||
@@ -34,4 +34,21 @@ gulp.task('lint:common', () => {
|
|||||||
.pipe(eslint.failAfterError());
|
.pipe(eslint.failAfterError());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
gulp.task('lint:tests', () => {
|
||||||
|
return gulp
|
||||||
|
.src([
|
||||||
|
'./test/**/*.js',
|
||||||
|
// @TODO remove these negations as the test files are cleaned up.
|
||||||
|
'!./test/api-legacy/**/*',
|
||||||
|
'!./test/common/**/*',
|
||||||
|
'!./test/content/**/*',
|
||||||
|
'!./test/e2e/**/*',
|
||||||
|
'!./test/server_side/**/*',
|
||||||
|
'!./test/spec/**/*',
|
||||||
|
])
|
||||||
|
.pipe(eslint())
|
||||||
|
.pipe(eslint.format())
|
||||||
|
.pipe(eslint.failAfterError());
|
||||||
|
});
|
||||||
|
|
||||||
gulp.task('lint', ['lint:server', 'lint:common']);
|
gulp.task('lint', ['lint:server', 'lint:common']);
|
||||||
|
|||||||
Reference in New Issue
Block a user