Add eslint

This commit is contained in:
bananaappletw 2016-10-20 14:02:09 +08:00
parent ea581a1ea5
commit 76f55514ca
5 changed files with 32 additions and 1 deletions

15
.eslintrc.yml Normal file
View File

@ -0,0 +1,15 @@
env:
mocha: true
extends: standard
plugins:
- standard
- promise
rules:
arrow-parens: 0
eqeqeq: 0
no-return-assign: 0 # fails for arrow functions
semi: [2, always]
space-before-function-paren: [2, never]
yoda: 0
arrow-spacing: 2
dot-location: [2, "property"]

View File

@ -2,3 +2,5 @@ node_js:
- "4"
- "6"
language: node_js
script:
make lint

View File

@ -1,3 +1,6 @@
lint:
@./node_modules/.bin/eslint .
test:
@NODE_ENV=test ./node_modules/.bin/mocha \
--harmony \
@ -5,4 +8,4 @@ test:
--require should \
*/test.js
.PHONY: test
.PHONY: lint test

View File

@ -2,6 +2,13 @@
A repository containing small examples to illustrate the use of Koa
for creating web applications and other HTTP servers.
# Running tests
```bash
make test
make lint
```
## Included Examples

View File

@ -26,6 +26,10 @@
},
"devDependencies": {
"co": "*",
"eslint": "^3.8.1",
"eslint-config-standard": "^6.2.0",
"eslint-plugin-promise": "^3.3.0",
"eslint-plugin-standard": "^2.0.1",
"mocha": "*",
"should": "^3.3.2",
"supertest": "*"