-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc
109 lines (109 loc) · 2.99 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
109
# 第一部分是规则名
# 第二部分是表示级别:0-不验证;1-警告;2-错误
#
{
"env": {
"browser": true,
},
"extends": "airbnb",
"parser": "babel-eslint",
"rules": {
"indent": [
2,
4
], #缩进四个空格
"react/jsx-indent-props": [
2,
4
],
"object-curly-spacing": [
0,
"never"
], #大括号内是否允许不必要的空格
"max-len": [
0,
80,
4
], #字符串最大长度
"eqeqeq": 0, #必须使用全等
"quotes": [
1,
"single"
], #使用单引号
"jsx-quotes": [
"error",
"prefer-single"
],
"arrow-body-style": 0,
"no-param-reassign": 0,
"no-extra-semi": 1, #多余的分号
"no-use-before-define": [
1,
"nofunc"
], #使用前未定义
"comma-dangle": [
2,
"never"
], #定义数组或对象最后多余的逗号
"no-unused-vars": 0, #变量定义后未使用
"no-confusing-arrow": 0,
"radix": 0,
"no-unused-expressions": 0,
"no-useless-return": 0,
"array-callback-return": 0,
"operator-assignment": 0,
"jsx-a11y/img-has-alt": 0,
"object-property-newline": 0,
"consistent-return": 0,
"no-unneeded-ternary": 0,
"no-else-return": 0,
"space-infix-ops": 0,
"arrow-parens": 0,
"curly": 0,
"one-var": 0,
"no-tabs": 0,
"prefer-template": 0,
"linebreak-style": 0,
"quote-props": [
0,
"always"
], #对象字面量中的属性名是否强制双引号
"no-shadow": 0, #外部作用域中的变量不能与它所包含的作用域中的变量或参数同名
"no-underscore-dangle": 0, #标识符不能以_开头或结尾
"semi": [
1,
"never"
], #语句强制分号结尾
"class-methods-use-this": 0,
"import/no-extraneous-dependencies": 0,
"import/prefer-default-export": 0,
"jsx-a11y/no-static-element-interactions": 0,
"react/prop-types": 0,
"react/sort-comp": 0,
"react/no-unescaped-entities": 0,
"react/prefer-stateless-function": 0,
"react/jsx-filename-extension": [
1,
{
"extensions": [
".js",
".jsx"
]
}
],
"react/jsx-indent": [
2,
4
],
"react/no-unused-prop-types": 0,
"react/no-did-mount-set-state": 0,
"react/forbid-prop-types": 0,
"func-names": 0,
"dot-notation": 0,
"no-plusplus": 0,
"no-undef": 0,
"no-extra-boolean-cast": 0,
"no-nested-ternary": 0,
"no-extend-native": 0
}
}