Add eslint as "npm run lint" and "posttest" hook

This commit is contained in:
Miroslav Bajtoš 2016-04-01 13:48:07 +02:00 committed by Miroslav Bajtoš
parent fea70e69c9
commit fc1aefb8d4
5 changed files with 26 additions and 3 deletions

1
.eslintignore Normal file
View File

@ -0,0 +1 @@
coverage

13
.eslintrc Normal file
View File

@ -0,0 +1,13 @@
{
"extends": "loopback",
"rules": {
"max-len": ["error", 110, 4, {
"ignoreComments": true,
"ignoreUrls": true,
"ignorePattern": "^\\s*var\\s.+=\\s*(require\\s*\\()|(/)"
}],
// NOTE(bajtos) we should eventuall remove this override
// and fix all of those 100+ violations
"one-var": "off"
}
}

View File

@ -1,2 +0,0 @@
node_modules
support/nodeunit

View File

@ -27,7 +27,9 @@
"clean": "make clean",
"help": "make help",
"refresh": "make refresh",
"test": "make test"
"test": "make test",
"posttest": "npm run lint",
"lint": "eslint ."
},
"engines": [
"node >= 0.6"
@ -41,6 +43,8 @@
"bluebird": "^3.1.1",
"debug": "^2.1.1",
"depd": "^1.0.0",
"eslint": "^2.5.3",
"eslint-config-loopback": "^1.0.0",
"inflection": "^1.6.0",
"loopback-connector": "^2.1.0",
"node-uuid": "^1.4.2",

7
test/.eslintrc Normal file
View File

@ -0,0 +1,7 @@
{
"rules": {
// NOTE(bajtos) We should eventually get rid of this override,
// and fix those 200+ violations instead
"padded-blocks": "off"
}
}