Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@qychen2001
Copy link

Summary

Fixed the nested root configuration error that was incorrectly reported when a subdirectory contained a biome.json file without an explicit root: true field.

When a project had a biome.json in 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:

  1. Checking if root: true was explicitly set in the source file (before apply_extends transforms the config)
  2. Forcing root: false for nested configs without explicit root field to prevent them from being treated as root configurations
  3. Implicitly extending from root when neither root nor extends is set

Fixes #7942

Test Plan

Existing tests pass:

  • should_fail_for_nested_roots - no longer errors
  • errors_on_ignored_nested_biome_json - no longer errors

Copilot AI review requested due to automatic review settings December 20, 2025 05:46
@changeset-bot
Copy link

changeset-bot bot commented Dec 20, 2025

⚠️ No Changeset found

Latest commit: b9a118e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added A-CLI Area: CLI A-Project Area: project labels Dec 20, 2025
@qychen2001 qychen2001 changed the title fix: allow nested biome.json without explicit root field (fixes #7942) fix: allow nested biome.json without explicit root field Dec 20, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 20, 2025

Walkthrough

This 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

A-Project

Suggested reviewers

  • dyc3
  • siketyan

Pre-merge checks and finishing touches

✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed Description clearly explains the problem, the solution, and test outcomes; it's directly related to the changeset and linked issue.
Linked Issues check ✅ Passed Changes directly address #7942 by detecting explicit root fields, forcing root: false for nested configs, and implicitly extending from root as required.
Out of Scope Changes check ✅ Passed All modifications are scoped to the nested config handling logic in update_project_config_files and directly support the stated objectives.
Title check ✅ Passed The PR title clearly and specifically describes the main fix: allowing nested biome.json files without explicit root field, and references the fixed issue.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

This comment was marked as duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CLI Area: CLI A-Project Area: project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 Still can't ignore nested biome.json configuration

1 participant