-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.eslintrc.js
More file actions
31 lines (31 loc) · 994 Bytes
/
.eslintrc.js
File metadata and controls
31 lines (31 loc) · 994 Bytes
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
// 需要先全局安装相关包
// yarn global add eslint typescript typescript-eslint-parser eslint-plugin-typescript eslint-plugin-react eslint-config-alloy
module.exports = {
extends: [
'eslint-config-alloy/typescript-react',
],
globals: {
// 这里填入你的项目需要的全局变量
// 这里值为 false 表示这个全局变量不允许被重新赋值,比如:
//
// jQuery: false,
// $: false
},
rules: {
// 这里填入你的项目需要的个性化配置,比如:
//
// @fixable 一个缩进必须用两个空格替代
'indent': [
'error',
2,
{
SwitchCase: 1,
flatTernaryExpressions: true,
'ignoredNodes': ['JSXElement *']
}
],
'react/jsx-indent-props': [ 'error', 2 ],
// TypeScript的类型无法正确判定
'no-unused-vars': 'off'
}
};