-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc
77 lines (76 loc) · 2.04 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
{
"extends": "eslint-config-airbnb",
"globals": {
"APP": true, // 允许全局变量APP,
"window": true,
"WebSocket": true
},
"plugins": [
"react",
"import"
],
"parser": "babel-eslint",
"parserOptions": {
"sourceType": "module"
},
"settings": {
"import/resolver": {
"node": {
"extensions": [".js", ".jsx"]
}
},
"import/core-modules": [ // https://github.com/benmosher/eslint-plugin-import#importcore-modules
"@utils", // src/utils
"@utils/theme",
"@utils/request",
"@utils/config",
"@utils/md5",
"@utils/requestFun",
"@utils/figures",
"@utils/calc"
]
},
"rules": {
"no-console": 0,
"react/no-multi-comp": 0,
"react/prop-types": 0,
"import/no-unresolved": [2, { "commonjs": true }],
"import/no-duplicates": 2,
"complexity": [2, 25], // 算法复杂度到25
"max-depth": [2, 3],
"max-len": [2, {"code": 180, "tabWidth": 2, "ignoreUrls": true}],
"max-nested-callbacks": [2, 3],
"camelcase": 2,
"linebreak-style": [0 ,"error", "windows"], // 允许windows开发环境
"no-param-reassign": [2, { "props": false }], // disable the rule specifically for param properties
"max-statements": [2, 100], // 每个方法最多100条语句
"jsx-a11y/no-static-element-interactions": [
"error",
{
"handlers": [
"onClick",
"onMouseDown",
"onMouseUp",
"onKeyPress",
"onKeyDown",
"onKeyUp",
],
},
],
"no-mixed-operators": [
"error",
{
"groups": [
["+", "-"],
["*", "/"],
["%", "**"],
["&", "|", "^", "~", "<<", ">>", ">>>"],
["==", "!=", "===", "!==", ">", ">=", "<", "<="],
["&&", "||"],
["in", "instanceof"]
],
"allowSamePrecedence": true
}
]
}
}