@samitouri / QOS-React / commits / ae74234eae

[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.

lauren committed Oct 1, 2025 at 17:05 UTC ae74234eae6ebd62f19190731278e20bc1c37d51
1 file changed +4
packages/eslint-plugin-react-hooks/src/index.ts
+4
@@ -7,12 +7,16 @@
7 import type {Linter, Rule} from 'eslint';
8
9 import ExhaustiveDeps from './rules/ExhaustiveDeps';
10 +import {allRules} from './shared/ReactCompiler';
11 import RulesOfHooks from './rules/RulesOfHooks';
12
13 // All rules
14 const rules = {
15 'exhaustive-deps': ExhaustiveDeps,
16 'rules-of-hooks': RulesOfHooks,
17 + ...Object.fromEntries(
18 + Object.entries(allRules).map(([name, config]) => [name, config.rule]),
19 + ),
20 } satisfies Record<string, Rule.RuleModule>;
21
22 // Config rules