Skip to content

Commit 058405d

Browse files
authored
Merge pull request #307 from windingtree/change-eslint
Update eslinter, add new rules and fix linter errors
2 parents 7957a0e + 9790eaa commit 058405d

14 files changed

+1115
-1007
lines changed

.eslintrc.js

Lines changed: 49 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,51 @@
11
module.exports = {
2-
"env": {
3-
"es6": true,
4-
"node": true
5-
},
6-
"extends": "eslint:recommended",
7-
"parserOptions": {
8-
"ecmaVersion": 8
9-
},
10-
"globals": {
11-
"afterEach": true,
12-
"artifacts": true,
13-
"assert": true,
14-
"beforeEach": true,
15-
"contract": true,
16-
"it": true,
17-
"web3": true
18-
},
19-
"rules": {
20-
"no-console": "off",
21-
"indent": [
22-
"error",
23-
2
24-
],
25-
"linebreak-style": [
26-
"error",
27-
"unix"
28-
],
29-
"quotes": [
30-
"error",
31-
"single"
32-
],
33-
"semi": [
34-
"error",
35-
"always"
36-
]
37-
}
2+
"extends" : [
3+
"standard",
4+
"plugin:promise/recommended"
5+
],
6+
"plugins": [
7+
"promise"
8+
],
9+
"env": {
10+
"browser" : true,
11+
"node" : true,
12+
"mocha" : true,
13+
"jest" : true
14+
},
15+
"globals" : {
16+
"artifacts": false,
17+
"contract": false,
18+
"assert": false,
19+
"web3": false
20+
},
21+
"rules": {
22+
23+
// Strict mode
24+
"strict": [2, "global"],
25+
26+
// Code style
27+
"indent": [2, 2],
28+
"quotes": [2, "single"],
29+
"semi": ["error", "always"],
30+
"space-before-function-paren": ["error", "always"],
31+
"no-use-before-define": 0,
32+
"eqeqeq": [2, "smart"],
33+
"dot-notation": [2, {"allowKeywords": true, "allowPattern": ""}],
34+
"no-redeclare": [2, {"builtinGlobals": true}],
35+
"no-trailing-spaces": [2, { "skipBlankLines": true }],
36+
"eol-last": 1,
37+
"comma-spacing": [2, {"before": false, "after": true}],
38+
"camelcase": [2, {"properties": "always"}],
39+
"no-mixed-spaces-and-tabs": [2, "smart-tabs"],
40+
"comma-dangle": [1, "always-multiline"],
41+
"no-dupe-args": 2,
42+
"no-dupe-keys": 2,
43+
"no-debugger": 0,
44+
"no-undef": 2,
45+
"one-var": [0],
46+
"object-curly-spacing": [2, "always"],
47+
"generator-star-spacing": ["error", "before"],
48+
"promise/avoid-new": 0,
49+
"promise/always-return": 0
50+
}
3851
};

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,12 @@
3232
"devDependencies": {
3333
"chai-bignumber": "^2.0.1",
3434
"coveralls": "^2.13.1",
35-
"eslint": "^4.6.1",
35+
"eslint": "^4.11.0",
36+
"eslint-config-standard": "^10.2.1",
37+
"eslint-plugin-import": "^2.8.0",
38+
"eslint-plugin-node": "^5.2.1",
39+
"eslint-plugin-promise": "^3.6.0",
40+
"eslint-plugin-standard": "^3.0.1",
3641
"ethereumjs-testrpc": "^6.0.1",
3742
"ethereumjs-util": "^5.1.2",
3843
"mocha-lcov-reporter": "^1.3.0",

0 commit comments

Comments
 (0)