add eslint and standard config

master
Michaël Zasso 2015-10-12 22:35:07 +02:00
parent bfa53fbc28
commit 24ccde947d
4 changed files with 24 additions and 5 deletions

10
.eslintrc Normal file
View File

@ -0,0 +1,10 @@
# Support ES2016 features
parser: babel-eslint
extends: standard
rules:
eqeqeq: 0
semi: [2, always]
space-before-function-paren: [2, never]
yoda: 0

View File

@ -1,7 +1,5 @@
SRC = lib/*.js
include node_modules/make-lint/index.mk
REQUIRED = --require should --require should-http
TESTS = test/application/* \
@ -10,6 +8,9 @@ TESTS = test/application/* \
test/response/* \
test/experimental/index.js
lint:
@./node_modules/.bin/eslint lib test
test:
@NODE_ENV=test node \
./node_modules/.bin/_mocha \
@ -26,7 +27,7 @@ test-cov:
$(TESTS) \
--bail
test-travis:
test-travis: lint
@NODE_ENV=test node \
./node_modules/.bin/istanbul cover \
./node_modules/.bin/_mocha \
@ -39,4 +40,4 @@ test-travis:
bench:
@$(MAKE) -C benchmarks
.PHONY: test bench
.PHONY: lint test bench

View File

@ -44,8 +44,11 @@
},
"devDependencies": {
"babel": "^5.0.0",
"babel-eslint": "^4.1.3",
"eslint": "^1.6.0",
"eslint-config-standard": "^4.4.0",
"eslint-plugin-standard": "^1.3.1",
"istanbul": "^0.3.22",
"make-lint": "^1.0.1",
"mocha": "^2.0.1",
"should": "^6.0.3",
"should-http": "0.0.3",

5
test/.eslintrc Normal file
View File

@ -0,0 +1,5 @@
env:
mocha: true
rules:
space-before-blocks: [2, {functions: never, keywords: always}]