Question
ESLint v9 Flat Config: Unresolved Rule Merging with Shareable Configs
Tasadduq BurneyownerOwner · Founder
26.5K reputation · 29 Aug 2020, 02:47 UTC
53.2K views0
Goal
Determine how rules are applied when a rule appears in both a root eslint.config.js and an imported shareable config under ESLint v9’s flat configuration system.
Constraints & Uncertainty
- ESLint v9 defaults to flat config and no longer loads legacy
.eslintrc.*files automatically. - Flat config requires explicit imports for plugins, parsers, and shareable configs.
- Rule merging semantics differ from the cascading overrides of the legacy
.eslintrcformat. - The documentation does not clearly state whether the root config overrides the shareable config or vice versa when the same rule is defined in both.
Specific Questions
- When a rule is defined in both the root flat config and an imported shareable config, which definition takes precedence?
- If both definitions use different rule options, how are those options combined or overridden?
- Does the order of imports in the flat config array affect rule precedence relative to the root config?