-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc
132 lines (128 loc) · 3.28 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
{
"settings": {
"import/resolver": {
"node": {
"extensions": [".js", ".jsx"]
},
"alias": {
"map": [["src", "./src"], ["components", "./src/components"], ["services", "./src/services"]],
"extensions": [".js", ".jsx", ".json"]
}
}
},
"parser": "babel-eslint",
"globals": {
"describe": true,
"it": true,
"expect": true,
"fetch": true,
"jest": true,
"afterEach": true,
"beforeEach": true,
"onmessage": true,
"postMessage": true,
"localStorage": true,
"Promise": false,
"Uint8Array": true,
"cordova": false
},
"env": {
"commonjs": true,
"node": true,
"es6": true,
"browser": true
},
"extends": ["airbnb", "prettier", "prettier/standard", "prettier/react"],
"plugins": ["prettier"],
"rules": {
// standard
"array-callback-return": [0],
"arrow-body-style": [0],
"camelcase": [0],
"class-methods-use-this": [0],
"consistent-return": [0],
"func-names": "off",
"global-require": "off",
"no-bitwise": "off",
"no-console": [0],
"no-continue": [0],
"no-else-return": [0],
"no-empty-pattern": [0],
"no-nested-ternary": [0],
"no-param-reassign": [0],
"no-plusplus": [0],
"no-restricted-syntax": [0],
"no-return-assign": [0],
"no-underscore-dangle": [0],
"no-unused-expressions": [
"error",
{
"allowShortCircuit": true,
"allowTernary": true,
"allowTaggedTemplates": false
}
],
"no-unused-vars": "warn",
"no-use-before-define": [0],
"operator-assignment": ["warn"],
"prefer-arrow-callback": [
"error",
{
"allowNamedFunctions": false,
"allowUnboundThis": true
}
],
"prefer-const": "warn",
"prefer-destructuring": [0],
"prefer-promise-reject-errors": ["warn"],
"prefer-template": [0],
"radix": [0],
// react
"react/destructuring-assignment": ["off"],
"react/forbid-prop-types": [0],
"react/jsx-no-bind": "off",
"react/jsx-filename-extension": [0],
"react/no-array-index-key": "off",
"react/no-multi-comp": [0],
// 下面的校验规则,请手动注释,应用校验规则,当所有人都修改代码满足一下规则
// 以下规则会全部应用
"react/no-string-refs": [0],
"react/prefer-stateless-function": [0],
"react/prop-types": [
"error",
{
"ignore": [],
"customValidators": [],
"skipUndeclared": true
}
],
"react/require-default-props": [
"off",
{
"forbidDefaultForRequired": true
}
],
"react/sort-comp": [0],
// jsx accessibility
"jsx-a11y/anchor-is-valid": [0],
"jsx-a11y/click-events-have-key-events": [0],
"jsx-a11y/label-has-associated-control": [0],
"jsx-a11y/label-has-for": [0],
"jsx-a11y/no-static-element-interactions": [0],
"jsx-a11y/no-noninteractive-element-interactions": ["off"],
// import
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": true,
"optionalDependencies": false,
"peerDependencies": false
}
],
"import/no-named-as-default": ["off"],
"import/order": "off",
"import/prefer-default-export": [0],
// others
"prettier/prettier": "warn"
}
}