mirror of
https://github.com/zebrajr/express.git
synced 2025-12-06 00:19:48 +01:00
lint: add eslint rules that cover editorconfig
This commit is contained in:
parent
713d2aed93
commit
56e90e3c72
2
.eslintignore
Normal file
2
.eslintignore
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
coverage
|
||||
node_modules
|
||||
7
.eslintrc
Normal file
7
.eslintrc
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"rules": {
|
||||
"eol-last": "error",
|
||||
"indent": ["error", 2, { "SwitchCase": 1 }],
|
||||
"no-trailing-spaces": "error"
|
||||
}
|
||||
}
|
||||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -22,4 +22,5 @@ test_script:
|
|||
- node --version
|
||||
- npm --version
|
||||
- npm run test-ci
|
||||
- npm run lint
|
||||
version: "{build}"
|
||||
|
|
|
|||
|
|
@ -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>'
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ var users = [
|
|||
];
|
||||
|
||||
var userRepos = {
|
||||
tobi: [repos[0], repos[1]]
|
||||
tobi: [repos[0], repos[1]]
|
||||
, loki: [repos[1]]
|
||||
, jane: [repos[2]]
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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/",
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user