Add ESLint (WIP)

This commit is contained in:
haad 2016-03-06 17:00:01 +01:00
parent f112e52745
commit 0411ce26d3
3 changed files with 43 additions and 1 deletions

34
.eslintrc.json Normal file
View File

@ -0,0 +1,34 @@
{
"extends": "standard",
"plugins": [
"standard"
],
"ecmaFeatures": {
"modules": true
},
"env": {
"es6": true,
"node": true
},
"rules": {
"semi": [ 2, "always" ],
"quotes": [ 1, "single" ],
"no-undef": 0,
"global-strict": 0,
"no-extra-semi": 1,
"no-underscore-dangle": 0,
"no-console": 0,
"no-multi-spaces": 0,
"no-extra-bind": 0,
"curly": 0,
"no-use-before-define": 0,
"quotes": 0,
"no-unused-vars": 1,
"no-irregular-whitespace": 0,
"camelcase": 0,
"new-cap": 0,
"space-before-function-paren": 0,
"handle-callback-err": 0,
"keyword-spacing": 0
}
}

View File

@ -123,6 +123,12 @@ Keep tests running while development:
mocha -w
```
#### Lint
*Work in progress! Throws an error "Parsing error: The keyword 'await' is reserved".*
```
npm run lint
```
### TODO
- Fix encryption
- Caching

View File

@ -20,9 +20,11 @@
"socket.io-client": "1.3.7"
},
"devDependencies": {
"eslint": "^2.3.0",
"mocha": "^2.3.4"
},
"scripts": {
"test": "mocha"
"test": "mocha",
"lint": "$(npm bin)/eslint ./src || true"
}
}