[eprh] Allow compiler rules to be opted-in but not in the preset (#34672)

Follow up to #34649. This adds the compiler rules back so they can be
opted-in 6.1.0, but aren't included in the presets as that would be a
breaking change.
This commit is contained in:
lauren 2025-10-01 17:05:42 -04:00 committed by GitHub
parent 861811347b
commit ae74234eae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,12 +7,16 @@
import type {Linter, Rule} from 'eslint';
import ExhaustiveDeps from './rules/ExhaustiveDeps';
import {allRules} from './shared/ReactCompiler';
import RulesOfHooks from './rules/RulesOfHooks';
// All rules
const rules = {
'exhaustive-deps': ExhaustiveDeps,
'rules-of-hooks': RulesOfHooks,
...Object.fromEntries(
Object.entries(allRules).map(([name, config]) => [name, config.rule]),
),
} satisfies Record<string, Rule.RuleModule>;
// Config rules