-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
95 lines (85 loc) · 2.47 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
module.exports = {
extends: ['alloy', 'alloy/react', 'alloy/typescript'],
globals: {},
settings: {
react: {
version: '16.0'
}
},
rules: {
'arrow-parens': 'error',
complexity: 'off',
'max-nested-callbacks': ['error', 4],
// 禁止不必要的布尔转换
'no-extra-boolean-cast': 'error',
// 禁止不必要的括号
'no-extra-parens': 'off',
// 强制使用有效的 JSDoc 注释
// 'valid-jsdoc': 'error',
// 类的箭头函数方法中的this会被误判
'no-invalid-this': 'off',
'no-param-reassign': 'off',
'no-return-await': 'off',
'no-unused-vars': 'off',
'no-undefined': 'off',
'no-shadow': 'error',
'object-curly-spacing': ['error', 'always'],
'prefer-template': 'error',
'prefer-object-spread': 'off',
radix: 'off',
'react/jsx-fragments': 'off',
'require-atomic-updates': 'off',
// 允许使用 { ... } as XXX
'@typescript-eslint/consistent-type-assertions': 'off',
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-this-alias': 'off',
'@typescript-eslint/no-object-literal-type-assertion': 'off',
'@typescript-eslint/prefer-function-type': 'off',
'@typescript-eslint/unified-signatures': 'off',
'@typescript-eslint/member-ordering': [
'error',
{
default: [
'public-static-field',
'protected-static-field',
'private-static-field',
'public-instance-field',
'protected-instance-field',
'private-instance-field',
'public-field',
'protected-field',
'private-field',
'static-field',
'instance-field',
'field',
'constructor',
'public-static-method',
'protected-static-method',
'private-static-method',
'public-instance-method',
'protected-instance-method',
'private-instance-method',
'public-method',
'protected-method',
'private-method',
'static-method',
'instance-method',
'method'
]
}
]
},
overrides: [
{
files: ['*.d.ts'],
rules: {
'no-dupe-class-members': 'off',
'no-use-before-define': 'off',
'no-useless-constructor': 'off'
}
}
]
};