Skip to content

Commit 99bdda4

Browse files
committed
chore: address review comments
1 parent b528182 commit 99bdda4

2 files changed

Lines changed: 10 additions & 27 deletions

File tree

eslint.config.mjs

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@ const compat = new FlatCompat({
1515
allConfig: js.configs.all,
1616
});
1717

18-
const recommendedTsRules = new Set(
19-
Object.keys(tsEslintPlugin.configs.recommended.rules || {}),
20-
);
21-
const noopRule = {
22-
meta: { type: 'problem', docs: {}, schema: [] },
23-
create: () => ({}),
24-
};
18+
const recommendedTsRulesConfig = tsEslintPlugin.configs.recommended;
19+
const recommendedTsRulesObject = Array.isArray(recommendedTsRulesConfig)
20+
? recommendedTsRulesConfig.reduce(
21+
(rules, config) => ({ ...rules, ...(config.rules || {}) }),
22+
{},
23+
)
24+
: recommendedTsRulesConfig?.rules || {};
25+
const recommendedTsRules = new Set(Object.keys(recommendedTsRulesObject));
2526

2627
function normalizeConfig(config) {
2728
const next = { ...config };
@@ -37,10 +38,7 @@ function normalizeConfig(config) {
3738
if (!ruleName.startsWith('@typescript-eslint/')) {
3839
return true;
3940
}
40-
return (
41-
recommendedTsRules.has(ruleName) ||
42-
ruleName === '@typescript-eslint/ban-types'
43-
);
41+
return recommendedTsRules.has(ruleName);
4442
}),
4543
);
4644
}
@@ -66,20 +64,12 @@ export default [
6664
},
6765
{
6866
plugins: {
69-
'@typescript-eslint': {
70-
...tsEslintPlugin,
71-
rules: {
72-
...tsEslintPlugin.rules,
73-
'ban-types': noopRule,
74-
'consistent-type-exports': noopRule,
75-
},
76-
},
67+
'@typescript-eslint': tsEslintPlugin,
7768
},
7869
},
7970
...compat.config(require('./.eslintrc.js')).map(normalizeConfig),
8071
{
8172
rules: {
82-
'@typescript-eslint/ban-types': 'off',
8373
'@typescript-eslint/no-empty-object-type': 'off',
8474
'@typescript-eslint/no-unsafe-function-type': 'off',
8575
'@typescript-eslint/no-unused-vars': 'off',

react-compat.d.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,3 @@ declare module 'react' {
1212
...children: React.ReactNode[]
1313
): React.ReactElement<P>;
1414
}
15-
16-
declare module 'react-dom' {
17-
function hydrate(
18-
element: React.ReactNode,
19-
container: Element | DocumentFragment,
20-
): void;
21-
}

0 commit comments

Comments
 (0)