@@ -4,11 +4,18 @@ const path = require('path');
4
4
const shared = require ( '@mongodb-js/eslint-config-devtools' ) ;
5
5
const common = require ( '@mongodb-js/eslint-config-devtools/common' ) ;
6
6
7
- const tsRules = {
8
- ...common . tsRules ,
7
+ const extraTsRules = {
9
8
// Newly converted plugins use `any` quite a lot, we can't enable the rule,
10
9
// but we can warn so we can eventually address this
11
10
'@typescript-eslint/no-unsafe-argument' : 'warn' ,
11
+ '@typescript-eslint/no-unnecessary-type-assertion' : 'warn' ,
12
+ '@typescript-eslint/restrict-template-expressions' : 'warn' ,
13
+ '@typescript-eslint/restrict-plus-operands' : 'warn' ,
14
+ } ;
15
+
16
+ const tsRules = {
17
+ ...common . tsRules ,
18
+ ...extraTsRules ,
12
19
} ;
13
20
14
21
const tsOverrides = {
@@ -18,20 +25,28 @@ const tsOverrides = {
18
25
19
26
const tsxRules = {
20
27
...common . tsxRules ,
21
- '@typescript-eslint/no-unsafe-argument' : 'warn' ,
28
+ ... extraTsRules ,
22
29
} ;
23
30
24
31
const tsxOverrides = {
25
32
...common . tsxOverrides ,
26
33
rules : { ...tsxRules } ,
27
34
} ;
28
35
29
- const testOverrides = {
36
+ const testJsOverrides = {
30
37
...common . testOverrides ,
38
+ files : [ '**/*.spec.js' , '**/*.spec.jsx' , '**/*.test.js' ] ,
39
+ rules : {
40
+ ...common . testRules ,
41
+ '@mongodb-js/compass/unique-mongodb-log-id' : 'off' ,
42
+ } ,
43
+ } ;
44
+
45
+ const testTsOverrides = {
46
+ files : [ '**/*.spec.ts' , '**/*.spec.tsx' , '**/*.test.tsx' , '**/*.test.ts' ] ,
31
47
rules : {
32
48
...common . testRules ,
33
- '@typescript-eslint/no-unsafe-argument' : 'off' ,
34
- '@typescript-eslint/restrict-template-expressions' : 'off' ,
49
+ ...extraTsRules ,
35
50
'@mongodb-js/compass/unique-mongodb-log-id' : 'off' ,
36
51
} ,
37
52
} ;
@@ -54,7 +69,8 @@ module.exports = {
54
69
common . jsxOverrides ,
55
70
tsOverrides ,
56
71
tsxOverrides ,
57
- testOverrides ,
72
+ testJsOverrides ,
73
+ testTsOverrides ,
58
74
] ,
59
75
settings : {
60
76
...shared . settings ,
0 commit comments