From 17c19dbdaa7f46fa4e9f9dc86791c72c85576fcf Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Wed, 1 Oct 2025 16:55:06 -0400 Subject: [PATCH] [eprh] Allow compiler rules to be opted-in but not in the preset 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. --- packages/eslint-plugin-react-hooks/src/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/eslint-plugin-react-hooks/src/index.ts b/packages/eslint-plugin-react-hooks/src/index.ts index 2235e8d5a6845..c01e22fb4bb8d 100644 --- a/packages/eslint-plugin-react-hooks/src/index.ts +++ b/packages/eslint-plugin-react-hooks/src/index.ts @@ -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; // Config rules