@@ -15,7 +15,9 @@ const compat = new FlatCompat({
1515 allConfig : js . configs . all ,
1616} ) ;
1717
18- const recommendedTsRules = new Set ( Object . keys ( tsEslintPlugin . configs . recommended . rules || { } ) ) ;
18+ const recommendedTsRules = new Set (
19+ Object . keys ( tsEslintPlugin . configs . recommended . rules || { } ) ,
20+ ) ;
1921const noopRule = {
2022 meta : { type : 'problem' , docs : { } , schema : [ ] } ,
2123 create : ( ) => ( { } ) ,
@@ -25,16 +27,8 @@ function normalizeConfig(config) {
2527 const next = { ...config } ;
2628
2729 if ( next . plugins ?. [ '@typescript-eslint' ] ) {
28- next . plugins = {
29- ...next . plugins ,
30- '@typescript-eslint' : {
31- ...next . plugins [ '@typescript-eslint' ] ,
32- rules : {
33- ...next . plugins [ '@typescript-eslint' ] . rules ,
34- 'ban-types' : noopRule ,
35- } ,
36- } ,
37- } ;
30+ next . plugins = { ...next . plugins } ;
31+ delete next . plugins [ '@typescript-eslint' ] ;
3832 }
3933
4034 if ( next . rules ) {
@@ -43,7 +37,10 @@ function normalizeConfig(config) {
4337 if ( ! ruleName . startsWith ( '@typescript-eslint/' ) ) {
4438 return true ;
4539 }
46- return recommendedTsRules . has ( ruleName ) || ruleName === '@typescript-eslint/ban-types' ;
40+ return (
41+ recommendedTsRules . has ( ruleName ) ||
42+ ruleName === '@typescript-eslint/ban-types'
43+ ) ;
4744 } ) ,
4845 ) ;
4946 }
@@ -67,6 +64,18 @@ export default [
6764 'src/index.d.ts' ,
6865 ] ,
6966 } ,
67+ {
68+ plugins : {
69+ '@typescript-eslint' : {
70+ ...tsEslintPlugin ,
71+ rules : {
72+ ...tsEslintPlugin . rules ,
73+ 'ban-types' : noopRule ,
74+ 'consistent-type-exports' : noopRule ,
75+ } ,
76+ } ,
77+ } ,
78+ } ,
7079 ...compat . config ( require ( './.eslintrc.js' ) ) . map ( normalizeConfig ) ,
7180 {
7281 rules : {
0 commit comments