[eprh] Type `configs.flat` more strictly (#34950)
Addresses #34801 where `configs.flat` is possibly undefined as it was typed as a record of arbitrary string keys. <img width="990" height="125" alt="Screenshot 2025-10-22 at 1 16 44 PM" src="https://github.com/user-attachments/assets/8b0d37b9-d7b0-4fc0-aa62-1b0968dae75f" />
lauren committed
Oct 22, 2025 at 13:18 UTC
bbb7a1fdf741eed6b7adcd48a441259819d664cc
1 file changed
+4
-1
packages/eslint-plugin-react-hooks/src/index.ts
+4
-1
@@ -71,7 +71,10 @@ const configs = {
71
plugins,
72
rules: recommendedLatestRuleConfigs,
73
},
74
- flat: {} as Record<string, ReactHooksFlatConfig>,
74
+ flat: {} as {
75
+ recommended: ReactHooksFlatConfig;
76
+ 'recommended-latest': ReactHooksFlatConfig;
77
+ },
78
};
79
80
const plugin = {