Skip to content

Commit

Permalink
Add eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
bananaappletw committed Oct 20, 2016
1 parent ea581a1 commit 76f5551
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 1 deletion.
15 changes: 15 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -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 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ node_js:
- "4"
- "6"
language: node_js
script:
make lint
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
lint:
@./node_modules/.bin/eslint .

test:
@NODE_ENV=test ./node_modules/.bin/mocha \
--harmony \
--reporter spec \
--require should \
*/test.js

.PHONY: test
.PHONY: lint test
7 changes: 7 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "*"
Expand Down

0 comments on commit 76f5551

Please sign in to comment.