-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc
69 lines (58 loc) · 1.48 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
{
"parser": "babel-eslint",
"env": {
"es6": true,
"browser": true,
"node": true
},
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 6,
"ecmaFeatures": {
"jsx": true
}
},
"rules": {
// 强制行的最大长度
"max-len": "off",
// 使用分号: 报错级别, 必须
"semi": ["error", "always"],
// 强制使用一致的缩进
"indent": ["warn", 4],
// 禁止出现多行空行: 关闭
"no-multiple-empty-lines": "off",
// 禁止出现多个空格,不包括缩进
"no-multi-spaces": "error",
// 匿名函数需要空格,命名的不需要
"space-before-function-paren": ["error", {
"anonymous": "always",
"named": "never"
}],
// 大括号风格要求
"brace-style": ["error", "1tbs"],
// 逗号风格
"comma-style": ["error", "last"],
// 要求使用骆驼拼写法
"camelcase": ["error", {
"properties": "always"
}],
// 禁止使用eval()
"no-eval": "error",
// react plugin
// ====================
"react/sort-comp": "off",
"react/prop-types": "off",
"react/jsx-first-prop-new-line": "off",
"react/no-multi-comp": "off",
"react/no-string-refs": "off",
"react/jsx-filename-extension": ["warn", {
"extensions": [".js", ".jsx", ".tsx", ".md"]
}],
"react/no-array-index-key": "off",
"react/no-find-dom-node": "off",
"react/require-extension": "off"
},
"plugins": [
"react"
]
}