@@ -15,11 +15,11 @@ const compat = new FlatCompat({
1515 allConfig : js . configs . all ,
1616} ) ;
1717
18- const recommendedTsRules = new Set ( Object . keys ( tsEslintPlugin . configs . recommended . rules || { } ) ) ;
19- const noopRule = {
20- meta : { type : 'problem' , docs : { } , schema : [ ] } ,
21- create : ( ) => ( { } ) ,
22- } ;
18+ const recommendedTsRulesConfig = tsEslintPlugin . configs . recommended ;
19+ const recommendedTsRulesObject = Array . isArray ( recommendedTsRulesConfig )
20+ ? recommendedTsRulesConfig . reduce ( ( rules , config ) => ( { ... rules , ... ( config . rules || { } ) } ) , { } )
21+ : recommendedTsRulesConfig ?. rules || { } ;
22+ const recommendedTsRules = new Set ( Object . keys ( recommendedTsRulesObject ) ) ;
2323
2424function normalizeConfig ( config ) {
2525 const next = { ...config } ;
@@ -35,7 +35,7 @@ function normalizeConfig(config) {
3535 if ( ! ruleName . startsWith ( '@typescript-eslint/' ) ) {
3636 return true ;
3737 }
38- return recommendedTsRules . has ( ruleName ) || ruleName === '@typescript-eslint/ban-types' ;
38+ return recommendedTsRules . has ( ruleName ) ;
3939 } ) ,
4040 ) ;
4141 }
@@ -61,20 +61,12 @@ export default [
6161 } ,
6262 {
6363 plugins : {
64- '@typescript-eslint' : {
65- ...tsEslintPlugin ,
66- rules : {
67- ...tsEslintPlugin . rules ,
68- 'ban-types' : noopRule ,
69- 'consistent-type-exports' : noopRule ,
70- } ,
71- } ,
64+ '@typescript-eslint' : tsEslintPlugin ,
7265 } ,
7366 } ,
7467 ...compat . config ( require ( './.eslintrc.js' ) ) . map ( normalizeConfig ) ,
7568 {
7669 rules : {
77- '@typescript-eslint/ban-types' : 'off' ,
7870 '@typescript-eslint/no-empty-object-type' : 'off' ,
7971 '@typescript-eslint/no-unsafe-function-type' : 'off' ,
8072 '@typescript-eslint/no-unused-vars' : 'off' ,
0 commit comments