mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user