-
Notifications
You must be signed in to change notification settings - Fork 87
/
.eslintrc.js
55 lines (47 loc) · 1.29 KB
/
.eslintrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
module.exports = {
"root": true,
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2017,
},
"env": {
"browser": true,
},
"rules": {
// 两个空格的缩进
"indent": ["error", 2, { "SwitchCase": 1 }],
// 必须使用双引号
"quotes": ["error", "double"],
// 每行结尾必须带分号或逗号
"semi": ["error", "always"],
"comma-dangle": ["error", "always-multiline"],
// 操作符左右必须加空格
"space-infix-ops": ["error", {"int32Hint": false}],
// 必须使用严格模式
"strict": ["error", "global"],
// 规范逗号使用
"comma-spacing": ["error", {"before": false, "after": true}],
// 规范空格使用
"block-spacing": ["error", "always"],
"func-call-spacing": ["error", "never"],
"no-trailing-spaces": ["error"],
// 去除推荐规则中用不上的规则
"no-useless-escape": ["off"],
"no-unused-vars": ["warn"],
},
"extends": ["eslint:recommended"],
"overrides": [
{
"files": [
"webpack.common.js",
"webpack.conf.js",
"webpack.dev.js",
"webpack.prod.js",
".eslintrc.js",
],
"env": {
"node": true,
},
},
],
};