/
.eslintrc
44 lines (44 loc) · 1.09 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
{
"extends": "airbnb-base",
"parser": "babel-eslint",
"env": {
"mocha": true,
"node": true,
"jquery": true,
"browser": true
},
"globals": {
"expect": true,
"swal": true,
"sweetAlert": true,
"storage": true
},
"plugins": [
"react"
],
"rules": {
"react/jsx-uses-react": "error",
"react/jsx-uses-vars": "error",
"no-var": 0,
"camelcase": 2, // 不强制使用驼峰法
"no-trailing-spaces": 0,//一行结束后面不要有空格
"semi": [2, "always"],// 需要有分号
"semi-spacing": 0,
"spaced-comment": 2, // 注释 `//` 后面需要有一个空格
"no-multiple-empty-lines": [1, { "max": 2 }], // 最大间隔行数为2
"quotes": 0, // 字符串建议使用单引号
"space-before-function-paren": 0,
"comma-dangle": 0,
"eqeqeq": 2,
func-names: ["error", "never"],
prefer-arrow-callback: 0,
"new-cap": 0,
"prefer-template": 0,
"class-methods-use-this": 0,
"no-console": 0,
"quote-props": 0,
"object-shorthand": 0,
"arrow-body-style": 0,
"consistent-return": 0
}
}