-
Notifications
You must be signed in to change notification settings - Fork 4
/
.eslintrc
108 lines (108 loc) · 1.57 KB
/
.eslintrc
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
{
"parserOptions":
{
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures":
{
"jsx": true
}
},
"env":
{
"browser": true,
"node": true,
"es6": true,
"mocha": true
},
"plugins": [
"markdown",
"babel"
],
"parser": "babel-eslint",
"rules":
{
// tab缩进
"indent": ["warn", "tab",
{
"SwitchCase": 1
}],
"quotes": 0,
"no-console": 0,
"no-debugger": 1,
"no-var": 1,
"import/named": 0,
"semi": [
1,
"always"
],
"no-trailing-spaces": 0,
"eol-last": 0,
"no-underscore-dangle": 0,
"no-alert": 0,
"no-lone-blocks": 0,
// 关键字周围强制使用空格
"keyword-spacing": [
"error",
{
"before": true,
"after": true
}
],
// 大括号中强制使用空格
"object-curly-spacing": [
"warn",
"always"
],
// 单行代码块前后要加空格
"block-spacing": [
"warn",
"always"
],
// 逗号后面加空格
"comma-spacing": [
"warn",
{
"before": false,
"after": true
}
],
// 分号后面加空格
"semi-spacing": [
"warn",
{
"before": false,
"after": true
}
],
// 在注释前有空白
"spaced-comment": [
"warn",
"always"
],
// 箭头函数前后要有空格
"arrow-spacing": [
"warn",
{
"before": true,
"after": true
}
],
// 对象字面量的属性中键和值之间使用一致的间距
"key-spacing": [
"warn",
{
"beforeColon": false,
"afterColon": true
}
],
// 要求操作符周围有空格
"space-infix-ops": [
"warn",
{
"int32Hint": false
}
],
"jsx-quotes": 1
}
}