docs: clarify plugin path resolution for extended configs#4012
docs: clarify plugin path resolution for extended configs#4012soconnor-seeq wants to merge 1 commit intobiomejs:nextfrom
Conversation
✅ Deploy Preview for biomejs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
WalkthroughThis pull request updates documentation across four files to clarify how plugin paths are resolved in Biome's configuration system. The changes introduce and explain a key rule: when a configuration file extends another, relative paths resolve relative to the extending config, with a specific exception for plugin entries starting with Suggested reviewers
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/content/docs/linter/plugins.mdx`:
- Around line 39-41: The phrase "entry configuration file" is ambiguous in the
third bullet describing extends resolution; update that bullet to explicitly say
it means "the configuration file that contains the extends property (i.e., the
file doing the extending/declaring)", not the top-level extended config.
Concretely, change the bullet text that currently reads "Other strings are
treated as paths relative to the entry configuration file" to something like
"Other strings are treated as paths relative to the configuration file that
declares the extends value (the file doing the extending)", and ensure this
clarification sits alongside the existing mention of `extends`/scoped package
specifiers to remove ambiguity.
ℹ️ Review info
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
src/content/docs/guides/big-projects.mdxsrc/content/docs/guides/configure-biome.mdxsrc/content/docs/linter/plugins.mdxsrc/content/docs/reference/configuration.mdx
| - Scoped package specifiers (starting with `@`) are resolved via | ||
| `package.json` resolution (for example, from `node_modules` or workspaces). | ||
| - Other strings are treated as paths relative to the entry configuration file. |
There was a problem hiding this comment.
Clarify "entry configuration file" in the third bullet.
"Entry configuration file" is not a defined term in the Biome docs, and in the context of extends it's genuinely ambiguous — a reader could interpret it as either the declaring file (same as bullet 1) or the top-level extending config. Since the whole point of this section is to explain the extends behaviour, it's worth being explicit.
✏️ Suggested rewording
-- Other strings are treated as paths relative to the entry configuration file.
+- Other strings (e.g. bare package names) are resolved relative to the
+ top-level configuration file that Biome loaded — i.e. the extending config,
+ not the file where the entry is declared.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - Scoped package specifiers (starting with `@`) are resolved via | |
| `package.json` resolution (for example, from `node_modules` or workspaces). | |
| - Other strings are treated as paths relative to the entry configuration file. | |
| - Scoped package specifiers (starting with `@`) are resolved via | |
| `package.json` resolution (for example, from `node_modules` or workspaces). | |
| - Other strings (e.g. bare package names) are resolved relative to the | |
| top-level configuration file that Biome loaded — i.e. the extending config, | |
| not the file where the entry is declared. |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/content/docs/linter/plugins.mdx` around lines 39 - 41, The phrase "entry
configuration file" is ambiguous in the third bullet describing extends
resolution; update that bullet to explicitly say it means "the configuration
file that contains the extends property (i.e., the file doing the
extending/declaring)", not the top-level extended config. Concretely, change the
bullet text that currently reads "Other strings are treated as paths relative to
the entry configuration file" to something like "Other strings are treated as
paths relative to the configuration file that declares the extends value (the
file doing the extending)", and ensure this clarification sits alongside the
existing mention of `extends`/scoped package specifiers to remove ambiguity.
There was a problem hiding this comment.
I kinda agree with coderabbitai here but I don't really like how it's suggestion is phrased. I could use some help figuring out how to phrase this new behaviour of plugins using the same language that is used in the Biome docs.
There was a problem hiding this comment.
After thinking about this for a while I think this wording is better:
| - Scoped package specifiers (starting with `@`) are resolved via | |
| `package.json` resolution (for example, from `node_modules` or workspaces). | |
| - Other strings are treated as paths relative to the entry configuration file. | |
| - Scoped package specifiers (starting with `@`) are resolved via | |
| `package.json` resolution (for example, from `node_modules` or workspaces). | |
| - Other strings (e.g. bare package names) are are unchanged and will continue to be resolved relative to the | |
| top-level configuration file that Biome loaded — i.e. the same directory of the config used to power `biome lint`. |
Note
I had Codex help me understand the existing documentation and where documentation w.r..t
plugins, file path resolution, etc are.Summary
Document plugin path resolution for extended configs, including the
./and../exception.Context
Docs for biomejs/biome#9233.