Skip to content

Commit cd47fa3

Browse files
committed
Improve eslint linting and remove js-beautify
ESLint can do the same things as js-beautify now.
1 parent 90af0d8 commit cd47fa3

File tree

2 files changed

+44
-24
lines changed

2 files changed

+44
-24
lines changed

.eslintrc

Lines changed: 41 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,46 @@
33
"node": true
44
},
55
"rules": {
6-
"strict": 0,
7-
"camelcase": 0,
8-
"curly": 0,
9-
"indent": [2, "tab"],
10-
"eol-last": 2,
11-
"no-shadow": 0,
12-
"no-redeclare": 2,
13-
"no-extra-bind": 2,
14-
"no-empty": 0,
15-
"no-process-exit": 2,
16-
"no-underscore-dangle": 0,
17-
"no-use-before-define": 0,
18-
"no-unused-vars": 2,
19-
"consistent-return": 0,
20-
"no-inner-declarations": 2,
21-
"no-loop-func": 2,
22-
"no-undef": 2,
23-
"space-before-function-paren": [2, "never"]
6+
"indent": [2, "tab", { "SwitchCase": 1 }],
7+
"brace-style": ["error", "1tbs"],
8+
"no-eval": "error",
9+
"eol-last": "error",
10+
"no-redeclare": "error",
11+
"no-extra-bind": "error",
12+
"no-process-exit": "error",
13+
"no-inner-declarations": "warn",
14+
"no-loop-func": "warn",
15+
"no-undef": "error",
16+
"no-trailing-spaces": "error",
17+
"space-before-function-paren": ["error", "never"],
18+
"no-multi-spaces": "error",
19+
"space-in-parens": "error",
20+
"space-before-blocks": "error",
21+
"no-unused-vars": "error",
22+
"no-dupe-keys": "error",
23+
"valid-typeof": "error",
24+
"space-infix-ops": "error",
25+
"no-negated-in-lhs": "error",
26+
"no-octal": "error",
27+
"no-regex-spaces": "error",
28+
"no-self-assign": "error",
29+
"no-sparse-arrays": "error",
30+
"no-unexpected-multiline": "error",
31+
"no-unreachable": "error",
32+
"no-extra-semi": "error",
33+
"no-func-assign": "error",
34+
"no-invalid-regexp": "error",
35+
"keyword-spacing": ["error", {
36+
"after": false,
37+
"overrides": {
38+
"try": {"after": true},
39+
"else": {"after": true},
40+
"throw": {"after": true},
41+
"case": {"after": true},
42+
"return": {"after": true},
43+
"finally": {"after": true},
44+
"do": {"after": true}
45+
}
46+
}]
2447
}
2548
}

package.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
"range-parser": "^1.0.3"
1313
},
1414
"devDependencies": {
15-
"eslint": "^2.10.1",
16-
"beautify-lint": "^1.0.4",
17-
"js-beautify": "^1.6.3"
15+
"eslint": "^3.4.0"
1816
},
1917
"licenses": [
2018
{
@@ -33,8 +31,7 @@
3331
},
3432
"scripts": {
3533
"lint": "eslint *.js",
36-
"beautify-lint": "beautify-lint *.js",
37-
"beautify": "beautify-rewrite *.js",
38-
"travis": "npm run lint && npm run beautify-lint && node middleware.js"
34+
"beautify": "npm run lint -- --fix",
35+
"travis": "npm run lint && node middleware.js"
3936
}
4037
}

0 commit comments

Comments
 (0)