[eprh] Add compiler rules to recommended preset

Adds back the compiler rules to the recommended preset, intended for the next release.
This commit is contained in:
Lauren Tan
2025-10-01 19:02:24 -04:00
parent 79ca5ae855
commit 7886591ccb
@@ -7,7 +7,11 @@
import type {Linter, Rule} from 'eslint';
import ExhaustiveDeps from './rules/ExhaustiveDeps';
import {allRules} from './shared/ReactCompiler';
import {
allRules,
mapErrorSeverityToESlint,
recommendedRules,
} from './shared/ReactCompiler';
import RulesOfHooks from './rules/RulesOfHooks';
// All rules
@@ -23,6 +27,15 @@ const rules = {
const ruleConfigs = {
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
// Compiler rules
...Object.fromEntries(
Object.entries(recommendedRules).map(([name, ruleConfig]) => {
return [
'react-hooks/' + name,
mapErrorSeverityToESlint(ruleConfig.severity),
];
}),
),
} satisfies Linter.RulesRecord;
const plugin = {