Skip to content

Commit 76f5551

Browse files
committed
Add eslint
1 parent ea581a1 commit 76f5551

File tree

5 files changed

+32
-1
lines changed

5 files changed

+32
-1
lines changed

.eslintrc.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
env:
2+
mocha: true
3+
extends: standard
4+
plugins:
5+
- standard
6+
- promise
7+
rules:
8+
arrow-parens: 0
9+
eqeqeq: 0
10+
no-return-assign: 0 # fails for arrow functions
11+
semi: [2, always]
12+
space-before-function-paren: [2, never]
13+
yoda: 0
14+
arrow-spacing: 2
15+
dot-location: [2, "property"]

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ node_js:
22
- "4"
33
- "6"
44
language: node_js
5+
script:
6+
make lint

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
lint:
2+
@./node_modules/.bin/eslint .
3+
14
test:
25
@NODE_ENV=test ./node_modules/.bin/mocha \
36
--harmony \
47
--reporter spec \
58
--require should \
69
*/test.js
710

8-
.PHONY: test
11+
.PHONY: lint test

Readme.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
A repository containing small examples to illustrate the use of Koa
44
for creating web applications and other HTTP servers.
5+
6+
# Running tests
7+
8+
```bash
9+
make test
10+
make lint
11+
```
512

613
## Included Examples
714

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
},
2727
"devDependencies": {
2828
"co": "*",
29+
"eslint": "^3.8.1",
30+
"eslint-config-standard": "^6.2.0",
31+
"eslint-plugin-promise": "^3.3.0",
32+
"eslint-plugin-standard": "^2.0.1",
2933
"mocha": "*",
3034
"should": "^3.3.2",
3135
"supertest": "*"

0 commit comments

Comments
 (0)