-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
57 lines (56 loc) · 1.9 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
52
53
54
55
56
57
const ESwitch = {
Off: 0,
Warn: 1,
Error: 2,
}
module.exports = {
extends: [require.resolve('@umijs/fabric/dist/eslint')],
globals: {
ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION: true,
page: true,
REACT_APP_ENV: true,
},
parserOptions: {
project: './tsconfig.json',
},
rules: {
// 0 = off, 1 = warn, 2 = error
'@typescript-eslint/explicit-function-return-type': ESwitch.Off,
'@typescript-eslint/explicit-module-boundary-types': ESwitch.Off,
'@typescript-eslint/lines-between-class-members': ESwitch.Error,
'@typescript-eslint/member-ordering': ESwitch.Error,
// https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/docs/rules/member-delimiter-style.md
'@typescript-eslint/member-delimiter-style': ESwitch.Off,
'@typescript-eslint/no-for-in-array': ESwitch.Error,
'@typescript-eslint/semi': ESwitch.Off,
'@typescript-eslint/comma-dangle': ESwitch.Off,
'@typescript-eslint/quotes': ESwitch.Off,
'@typescript-eslint/no-empty-function': ESwitch.Off,
'@typescript-eslint/no-explicit-any': ESwitch.Off,
'@typescript-eslint/no-dupe-class-members': ESwitch.Error,
'@typescript-eslint/space-before-function-paren': ESwitch.Off,
// '@typescript-eslint/space-infix-ops': ESwitch.Error,
'@typescript-eslint/keyword-spacing': ESwitch.Error,
'@typescript-eslint/no-unused-vars': ESwitch.Off,
// '@typescript-eslint/no-unused-vars': [ESwitch.Error, {
// 'React': ESwitch.Off
// }],
'@typescript-eslint/no-empty-interface': [
ESwitch.Error,
{
allowSingleExtends: true,
},
],
'@typescript-eslint/explicit-member-accessibility': [
ESwitch.Warn,
{
overrides: {
constructors: 'no-public',
},
},
],
'no-console': ESwitch.Warn,
semi: ['error', 'never'],
// 'space-before-function-paren': ESwitch.Error,
},
}