mirror of
https://github.com/koajs/examples.git
synced 2026-01-18 14:38:19 +00:00
Add eslint
This commit is contained in:
parent
ea581a1ea5
commit
76f55514ca
15
.eslintrc.yml
Normal file
15
.eslintrc.yml
Normal 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"]
|
||||
@ -2,3 +2,5 @@ node_js:
|
||||
- "4"
|
||||
- "6"
|
||||
language: node_js
|
||||
script:
|
||||
make lint
|
||||
|
||||
5
Makefile
5
Makefile
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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": "*"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user