Skip to content

Commit 69b4e5c

Browse files
committed
chore: address review comments
1 parent 500bbc8 commit 69b4e5c

2 files changed

Lines changed: 7 additions & 19 deletions

File tree

eslint.config.mjs

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -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

2424
function 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',

react-compat.d.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,3 @@ declare module 'react' {
1010
...children: React.ReactNode[]
1111
): React.ReactElement<P>;
1212
}
13-
14-
declare module 'react-dom' {
15-
function hydrate(element: React.ReactNode, container: Element | DocumentFragment): void;
16-
}

0 commit comments

Comments
 (0)