fix: allow nested biome.json without explicit root field#8520
fix: allow nested biome.json without explicit root field#8520qychen2001 wants to merge 1 commit intobiomejs:mainfrom
Conversation
|
WalkthroughThis PR modifies the nested configuration handling logic in the workspace server. It now tracks whether root and extends fields were explicitly provided in the configuration payload, uses these flags to determine merge behaviour, and narrows the root-in-root error reporting to only trigger when root is explicitly set to true. When root is not explicitly provided, nested configurations are forced to non-root semantics. An implicit extends-root condition is introduced for configurations with neither root nor extends explicitly set. Possibly related PRs
Suggested labels
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (4 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Fixed the
nested root configurationerror that was incorrectly reported when a subdirectory contained abiome.jsonfile without an explicitroot: truefield.When a project had a
biome.jsonin a subdirectory (e.g.,web/biome.json) with just partial configuration, Biome would report:✖ Found a nested root configuration, but there's already a root configuration.
This PR fixes the behavior by:
root: truewas explicitly set in the source file (beforeapply_extendstransforms the config)root: falsefor nested configs without explicitrootfield to prevent them from being treated as root configurationsrootnorextendsis setFixes #7942
Test Plan
Existing tests pass:
should_fail_for_nested_roots- no longer errorserrors_on_ignored_nested_biome_json- no longer errors