-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
51 lines (51 loc) · 1.31 KB
/
.eslintrc.js
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
module.exports = {
"parser": "babel-eslint",
"env": {
"browser": true,
"es6": true
},
"extends": [
"eslint:recommended",
"standard",
"standard-react"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": [
"babel",
"react"
],
"rules": {
"strict": 0,
"indent": ["warn", 2, { switchCase: 2 }], // 默认2个空格,switch语句里面的case也两个空格
"semi": [1, "never"], // 末尾的;号,不要分号
"quotes": [1, "single"], // 使用单引号
"comma-spacing": [ // 逗号后面的空格
1,
{
before: false,
after: true
}],
"curly": [2, "all"], //必须使用 if(){} 中的{}
"no-unused-vars": [
1,
{
// 允许声明未使用变量
"vars": "all",
}
],
"no-undef": [2, {"typeof": true}], // 不允许未定义的变量
"no-useless-constructor": 0,
"react/no-did-mount-set-state": 0,
"react/prop-types": 0
}
};