lint: add eslint rules that cover editorconfig

This commit is contained in:
Douglas Christopher Wilson 2017-08-05 23:37:39 -04:00
parent 713d2aed93
commit 56e90e3c72
18 changed files with 34 additions and 20 deletions

2
.eslintignore Normal file
View File

@ -0,0 +1,2 @@
coverage
node_modules

7
.eslintrc Normal file
View File

@ -0,0 +1,7 @@
{
"rules": {
"eol-last": "error",
"indent": ["error", 2, { "SwitchCase": 1 }],
"no-trailing-spaces": "error"
}
}

View File

@ -27,5 +27,7 @@ before_install:
# Update Node.js modules
- "test ! -d node_modules || npm prune"
- "test ! -d node_modules || npm rebuild"
script: "npm run-script test-ci"
script:
- "npm run test-ci"
- "npm run lint"
after_script: "npm install coveralls@2.10.0 && cat ./coverage/lcov.info | coveralls"

View File

@ -22,4 +22,5 @@ test_script:
- node --version
- npm --version
- npm run test-ci
- npm run lint
version: "{build}"

View File

@ -75,7 +75,7 @@ app.resource('/users', User);
app.get('/', function(req, res){
res.send([
'<h1>Examples:</h1> <ul>'
'<h1>Examples:</h1> <ul>'
, '<li>GET /users</li>'
, '<li>GET /users/1</li>'
, '<li>GET /users/3</li>'

View File

@ -61,7 +61,7 @@ var users = [
];
var userRepos = {
tobi: [repos[0], repos[1]]
tobi: [repos[0], repos[1]]
, loki: [repos[1]]
, jane: [repos[2]]
};

View File

@ -61,6 +61,7 @@
"body-parser": "1.17.2",
"cookie-parser": "~1.4.3",
"ejs": "2.5.7",
"eslint": "2.13.1",
"express-session": "1.15.3",
"hbs": "4.0.1",
"istanbul": "0.4.5",
@ -87,6 +88,7 @@
"lib/"
],
"scripts": {
"lint": "eslint .",
"test": "mocha --require test/support/env --reporter spec --bail --check-leaks test/ test/acceptance/",
"test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --require test/support/env --reporter spec --check-leaks test/ test/acceptance/",
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --require test/support/env --reporter dot --check-leaks test/ test/acceptance/",