1
1
module . exports = {
2
2
root : true ,
3
3
parser : '@typescript-eslint/parser' ,
4
+ parserOptions : {
5
+ project : './tsconfig.json'
6
+ } ,
4
7
plugins : [
5
8
'@typescript-eslint' ,
6
9
] ,
@@ -15,31 +18,19 @@ module.exports = {
15
18
'@typescript-eslint/ban-ts-comment' : [ 'off' ] ,
16
19
'@typescript-eslint/adjacent-overload-signatures' : [ 'error' ] ,
17
20
'@typescript-eslint/ban-types' : [ 'error' , {
21
+ extendDefaults : true ,
18
22
types : {
19
- Object : {
20
- message : 'Avoid using the `Object` type. Did you mean `object`?' ,
21
- fixWith : 'object'
22
- } ,
23
- Function : {
24
- message : 'Avoid using the `Function` type. Prefer a specific function type, like `() => void`.' ,
25
- fixWith : 'function'
26
- } ,
27
- Boolean : {
28
- message : 'Avoid using the `Boolean` type. Did you mean `boolean`?' ,
29
- fixWith : 'boolean'
30
- } ,
31
- Number : {
32
- message : 'Avoid using the `Number` type. Did you mean `number`?' ,
33
- fixWith : 'number'
34
- } ,
35
- String : {
36
- message : 'Avoid using the `String` type. Did you mean `string`?' ,
37
- fixWith : 'string'
38
- } ,
39
- Symbol : {
40
- message : 'Avoid using the `Symbol` type. Did you mean `symbol`?' ,
41
- fixWith : 'symbol'
42
- } ,
23
+ /**
24
+ * we are using `{}` as noop
25
+ * e.g. `type A<P> = B & (P extends Q ? C : {})`
26
+ * will get `B & C` when `P extends Q` and `B` otherwise
27
+ */
28
+ '{}' : false ,
29
+ /**
30
+ * we actually need a type accepting any function-like value
31
+ * e.g. `type Methods = Record<string, Function>`
32
+ */
33
+ 'Function' : false ,
43
34
}
44
35
} ] ,
45
36
'@typescript-eslint/member-delimiter-style' : [ 'error' , {
@@ -54,7 +45,7 @@ module.exports = {
54
45
} ] ,
55
46
'@typescript-eslint/naming-convention' : [ 'error' , {
56
47
selector : 'enum' ,
57
- format : [ 'UPPER_CASE' ] ,
48
+ format : [ 'PascalCase' , ' UPPER_CASE'] ,
58
49
leadingUnderscore : 'forbid' ,
59
50
trailingUnderscore : 'forbid' ,
60
51
} , {
@@ -66,6 +57,7 @@ module.exports = {
66
57
'@typescript-eslint/array-type' : [ 'error' , {
67
58
default : 'array-simple' ,
68
59
readonly : 'array-simple'
69
- } ]
60
+ } ] ,
61
+ '@typescript-eslint/no-unnecessary-qualifier' : [ 'error' ] ,
70
62
} ,
71
63
}
0 commit comments