Add linting for tests

This commit is contained in:
Blade Barringer
2015-11-17 23:14:49 -06:00
parent 94bf181301
commit 553548046f
3 changed files with 32 additions and 3 deletions

View File

@@ -81,6 +81,9 @@
"block-spacing": [2, "always"],
"key-spacing": [2, {"beforeColon": false, "afterColon": true}],
"max-nested-callbacks": [2, 3],
"mocha/no-exclusive-tests": 2,
"mocha/no-global-tests": 2,
"mocha/handle-done-callback": 2,
"new-cap": 2,
"new-parens": 2,
"newline-after-var": 2,
@@ -110,10 +113,17 @@
},
"env": {
"es6": true,
"mocha": true,
"node": true
},
ecmaFeatures : {
modules: true
},
"extends": "eslint:recommended"
"extends": "eslint:recommended",
"globals": {
"expect": true
},
"plugins": [
"mocha"
]
}

View File

@@ -98,6 +98,8 @@
"coveralls": "^2.11.2",
"csv": "~0.3.6",
"deep-diff": "~0.1.4",
"eslint": "^1.9.0",
"eslint-plugin-mocha": "^1.1.0",
"event-stream": "^3.2.2",
"expect.js": "~0.2.0",
"istanbul": "^0.3.14",

View File

@@ -34,4 +34,21 @@ gulp.task('lint:common', () => {
.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']);