-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
42 lines (42 loc) · 1.12 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
module.exports = {
extends: ["eslint-config-alloy/react"],
globals: {
// 这里填入你的项目需要的全局变量
// 这里值为 false 表示这个全局变量不允许被重新赋值,比如:
//
// React: false,
// ReactDOM: false
},
parser: "@typescript-eslint/parser", //! 这行还是挺关键的,要不然tsx文件会报eslint: error Parsing error: The keyword 'const' is reserved
parserOptions: {
ecmaFeatures: {
jsx: true
},
ecmaVersion: 2018,
sourceType: "module"
},
rules: {
// 这里填入你的项目需要的个性化配置,比如:
//
// // @fixable 一个缩进必须用两个空格替代
// 'indent': [
// 'error',
// 2,
// {
// SwitchCase: 1,
// flatTernaryExpressions: true
// }
// ],
// // @fixable jsx 的 children 缩进必须为两个空格
// 'react/jsx-indent': [
// 'error',
// 2
// ],
// // @fixable jsx 的 props 缩进必须为两个空格
// 'react/jsx-indent-props': [
// 'error',
// 2
// ]
"no-console": 2
}
};