@@ -4,11 +4,18 @@ const path = require('path');
44const shared = require ( '@mongodb-js/eslint-config-devtools' ) ;
55const common = require ( '@mongodb-js/eslint-config-devtools/common' ) ;
66
7- const tsRules = {
8- ...common . tsRules ,
7+ const extraTsRules = {
98 // Newly converted plugins use `any` quite a lot, we can't enable the rule,
109 // but we can warn so we can eventually address this
1110 '@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 ,
1219} ;
1320
1421const tsOverrides = {
@@ -18,20 +25,28 @@ const tsOverrides = {
1825
1926const tsxRules = {
2027 ...common . tsxRules ,
21- '@typescript-eslint/no-unsafe-argument' : 'warn' ,
28+ ... extraTsRules ,
2229} ;
2330
2431const tsxOverrides = {
2532 ...common . tsxOverrides ,
2633 rules : { ...tsxRules } ,
2734} ;
2835
29- const testOverrides = {
36+ const testJsOverrides = {
3037 ...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' ] ,
3147 rules : {
3248 ...common . testRules ,
33- '@typescript-eslint/no-unsafe-argument' : 'off' ,
34- '@typescript-eslint/restrict-template-expressions' : 'off' ,
49+ ...extraTsRules ,
3550 '@mongodb-js/compass/unique-mongodb-log-id' : 'off' ,
3651 } ,
3752} ;
@@ -54,7 +69,8 @@ module.exports = {
5469 common . jsxOverrides ,
5570 tsOverrides ,
5671 tsxOverrides ,
57- testOverrides ,
72+ testJsOverrides ,
73+ testTsOverrides ,
5874 ] ,
5975 settings : {
6076 ...shared . settings ,
0 commit comments