-
-
Notifications
You must be signed in to change notification settings - Fork 780
chore: merge next into main
#8275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Naoki Ikeguchi <[email protected]> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Emanuele Stoppa <[email protected]>
Co-authored-by: Emanuele Stoppa <[email protected]>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: arendjr <[email protected]>
Co-authored-by: Hamir Mahal <[email protected]>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Carson McManus <[email protected]>
🦋 Changeset detectedLatest commit: 789b0e7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 14 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughThis PR introduces multiple enhancements across Biome: new HTML accessibility lint rules (noAccessKey, useButtonType, useHtmlLang), a TypeScript interface member sorting assist, JSX factory configuration support from tsconfig.json, improvements to the useHookAtTopLevel rule for detecting module-level hook usage, custom extension mappings for useImportExtensions, configurable file watcher options, standardised logging configuration via LogOptions, LSP project-scanning progress reporting with UUID tokens, and a complete new YAML formatter crate. Additionally, KeyValuePair's API shifts from tuple-like construction to an explicit Possibly related PRs
Suggested labels
Pre-merge checks and finishing touches✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (4)
📒 Files selected for processing (6)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
🧰 Additional context used📓 Path-based instructions (1)**/*.rs📄 CodeRabbit inference engine (CONTRIBUTING.md)
Files:
🧠 Learnings (35)📓 Common learnings📚 Learning: 2025-11-24T18:04:42.146ZApplied to files:
📚 Learning: 2025-11-24T18:04:42.146ZApplied to files:
📚 Learning: 2025-11-24T18:04:42.146ZApplied to files:
📚 Learning: 2025-11-24T18:04:42.146ZApplied to files:
📚 Learning: 2025-11-24T18:04:42.146ZApplied to files:
📚 Learning: 2025-11-24T18:04:42.146ZApplied to files:
📚 Learning: 2025-11-24T18:04:42.146ZApplied to files:
📚 Learning: 2025-11-24T18:04:42.146ZApplied to files:
📚 Learning: 2025-11-24T18:04:42.146ZApplied to files:
📚 Learning: 2025-11-24T18:04:42.146ZApplied to files:
📚 Learning: 2025-11-24T18:04:42.146ZApplied to files:
📚 Learning: 2025-11-24T18:04:42.146ZApplied to files:
📚 Learning: 2025-11-24T18:04:42.146ZApplied to files:
📚 Learning: 2025-11-24T18:04:42.146ZApplied to files:
📚 Learning: 2025-11-24T18:04:42.146ZApplied to files:
📚 Learning: 2025-11-24T18:06:03.536ZApplied to files:
📚 Learning: 2025-11-24T18:04:42.146ZApplied to files:
📚 Learning: 2025-11-24T18:04:42.146ZApplied to files:
📚 Learning: 2025-11-24T18:04:42.146ZApplied to files:
📚 Learning: 2025-11-24T18:04:42.146ZApplied to files:
📚 Learning: 2025-11-24T18:04:42.146ZApplied to files:
📚 Learning: 2025-11-24T18:04:57.290ZApplied to files:
📚 Learning: 2025-11-24T18:06:12.017ZApplied to files:
📚 Learning: 2025-11-24T18:06:12.017ZApplied to files:
📚 Learning: 2025-11-24T18:03:52.014ZApplied to files:
📚 Learning: 2025-11-24T18:06:12.017ZApplied to files:
📚 Learning: 2025-11-24T18:06:12.017ZApplied to files:
📚 Learning: 2025-11-24T18:06:12.017ZApplied to files:
📚 Learning: 2025-11-24T18:06:12.017ZApplied to files:
📚 Learning: 2025-11-24T18:04:42.146ZApplied to files:
📚 Learning: 2025-11-24T18:04:42.146ZApplied to files:
📚 Learning: 2025-11-24T18:04:57.290ZApplied to files:
📚 Learning: 2025-11-24T18:04:57.290ZApplied to files:
📚 Learning: 2025-11-24T18:04:42.146ZApplied to files:
🧬 Code graph analysis (2)crates/biome_configuration/src/analyzer/assist/actions.rs (2)
crates/biome_cli/src/commands/mod.rs (3)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (43)
🔇 Additional comments (10)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Nitpick comments (12)
crates/biome_yaml_formatter/src/verbatim.rs (1)
97-106: Consider using.find()instead of.take_while().next().The current chain achieves the same result as
.find(), but the latter expresses intent more directly.let start_source = self .node .first_leading_trivia() .into_iter() .flat_map(|trivia| trivia.pieces()) .filter(|trivia| trivia.is_skipped()) .map(|trivia| source_range(f, trivia.text_range()).start()) - .take_while(|start| *start < trimmed_source_range.start()) - .next() + .find(|start| *start < trimmed_source_range.start()) .unwrap_or_else(|| trimmed_source_range.start());.changeset/witty-ears-hammer.md (1)
1-22: Good, rule-focused changeset with examplesNice user-facing summary: past tense for the addition, present tense for behaviour, plus clear invalid/valid examples. If there’s a public rule doc URL handy, you could optionally link it here for quicker discoverability, but it’s not required.
crates/biome_cli/tests/snap_test.rs (1)
271-303: Be careful:trim()here may eat newlines/indentationUsing
before.trim()normalises all surrounding whitespace, including leading newlines/indentation, then forces a single space before<BIOME_DIR>. That can join the placeholder onto the previous line rather than keeping it on its own/indented line.If the goal is just to avoid duplicated spaces before the placeholder while preserving line breaks and leading indentation, consider something like:
- result.push_str(before.trim()); - result.push(' '); + result.push_str(before.trim_end()); + if !before.ends_with(char::is_whitespace) { + result.push(' '); + }Or a similar
trim_end‑based approach, depending on exactly how you want the snapshots to look.crates/biome_flags/src/lib.rs (1)
104-223: Consider extracting the repetitive Display logic.The match-based formatting for each env variable is quite repetitive. A helper method on
BiomeEnvVariablecould reduce boilerplate:impl BiomeEnvVariable { fn fmt_with_padding(&self, fmt: &mut Formatter, padding: usize) -> std::io::Result<()> { match self.value() { None => KeyValuePair::new(self.name, markup! { <Dim>"unset"</Dim> }) .with_padding(padding) .fmt(fmt), Some(value) => KeyValuePair::new(self.name, markup! {{DebugDisplay(value)}}) .with_padding(padding) .fmt(fmt), } } }Then the Display impl becomes a series of
self.biome_*.fmt_with_padding(fmt, padding)?;calls..changeset/six-plants-lie.md (1)
9-17: Minor: Trailing comma in example.The JSON example has a trailing comma on line 13 that makes it invalid JSON. Consider removing it for clarity, though users will understand the intent.
Apply this diff:
"extensionMappings": { - "ts": "js", + "ts": "js" }.changeset/every-beers-sleep.md (1)
1-24: Minor wording polish for watcher option descriptionThe description is clear, but you could make it read a touch more naturally with tiny edits like:
- The option accepts the current values: + The option accepts the following values: @@ -- `none`: it doesn't enable the watcher. When the watcher is disabled, changes to files aren't recorded anymore by Biome. This might have - repercussions on some lint rules that might rely on updated types or updated paths. +- `none`: it doesn't enable the watcher. When the watcher is disabled, changes to files are no longer recorded by Biome. This might have + repercussions for some lint rules that rely on updated types or paths.Purely optional, the existing text is already understandable.
crates/biome_js_analyze/src/lint/correctness/use_import_extensions.rs (1)
80-105:extensionMappingsbehaviour matches docs; consider clarifying precedence withforceJsExtensionsThe new
extensionMappingsoption and its use inget_extensionless_importlook sound: when a mapping exists for the resolved extension, that mapped extension is suggested; otherwise you fall back to the resolved extension, preserving the existing.d.tsand sub‑extension handling.Note that
forceJsExtensionsis evaluated first, so if bothforceJsExtensions: trueandextensionMappingsare set,forceJsExtensionsalways wins and mappings are effectively ignored. If you intend mappings to be the more specific override, it might be worth either swapping the order or explicitly documenting thatforceJsExtensionstakes precedence.Also applies to: 286-295
crates/biome_js_analyze/tests/specs/correctness/useHookAtTopLevel/hookLocations.js (1)
1-48: Nice coverage of hook locations across contextsThis fixture exercises a good spread of cases for
useHookAtTopLevel(module scope, non‑components, components/hooks by naming convention, object/class methods, and varioustestcallback shapes includingrenderHook). The mixed valid/invalid examples in a single file are fine here; just be aware it diverges from thevalid/invalidfile‑prefix convention if you ever rely on that mechanically.crates/biome_cli/src/logging.rs (1)
1-3: Avoid drifting defaults betweenbpaffallbacks andLogOptions::default
LogOptionsnicely centralises logging configuration, but the default values are now encoded twice: once via the#[bpaf(fallback(...))]attributes and again in the manualDefaultimpl. If one side changes (e.g. log path or prefix) it’s easy for the two to diverge.Consider factoring the defaults into associated constants or a
fn default_log_options() -> LogOptionsused both by bpaf (viafallback) and by theDefaultimpl, so there’s a single source of truth.Also applies to: 15-83
crates/biome_js_analyze/src/lint/style/use_import_type.rs (1)
1-4: JSX factory detection inuseImportTypecorrectly avoids flagging runtime-only importsThe new
is_jsx_factory_bindinghelper and its use at the various import sites mean:
Under
JsxRuntime::ReactClassic, default/namespace bindings that are either:
- the standard React global, or
- match configured
jsxFactory/jsxFragmentFactoryare treated as value imports and exempt from the “only used as a type” checks.
That should eliminate spurious
import typesuggestions for React or custom JSX factory imports that are only referenced via JSX. The helper being gated onReactClassicalso matches how custom factories are used today; if you later support custom factories under other runtimes, this will be the natural place to extend.Also applies to: 195-201, 251-268, 277-282, 343-349, 1100-1129
crates/biome_html_analyze/src/lint/a11y/use_button_type.rs (1)
111-115: Minor inconsistency with sibling rule helper.The
is_button_elementhelper usesname.text()whilstis_html_elementinuse_html_lang.rsusestoken_text. Both operate onAnyHtmlElement::name(). Consider aligning the approach for consistency across the a11y rules.fn is_button_element(element: &AnyHtmlElement) -> bool { element .name() - .is_some_and(|name| name.text().eq_ignore_ascii_case("button")) + .is_some_and(|token_text| token_text.eq_ignore_ascii_case("button")) }crates/biome_cli/src/service/unix.rs (1)
56-84: LGTM! Clean consolidation of daemon spawn arguments.The refactor from individual parameters to structured
WatcherOptionsandLogOptionsimproves maintainability. The command-line argument construction properly forwards all relevant configuration.One minor observation: the parameter is named
watcher_configurationhere (line 58) butwatcher_optionsin the Windows counterpart (crates/biome_cli/src/service/windows.rs, line 190). Consider aligning the naming for consistency across platforms.fn spawn_daemon( stop_on_disconnect: bool, - watcher_configuration: WatcherOptions, + watcher_options: WatcherOptions, log_options: LogOptions, ) -> io::Result<Child> {
| "@biomejs/biome": minor | ||
| --- | ||
|
|
||
| Added support for `jsxFactory` and `jsxFragmentFactory`.Biome now respects `jsxFactory` and `jsxFragmentFactory` settings from `tsconfig.json` when using the classic JSX runtime, preventing false positive [noUnusedImports](https://biomejs.dev/linter/rules/no-unused-imports/) errors for custom JSX libraries like Preact. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix spacing in description text.
Line 5 has a missing space after the closing backtick. Should be:
-Added support for `jsxFactory` and `jsxFragmentFactory`.Biome now respects...
+Added support for `jsxFactory` and `jsxFragmentFactory`. Biome now respects...Otherwise, the changeset is well-structured with good examples and a helpful rule link. Nice work! ✓
📝 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.
| Added support for `jsxFactory` and `jsxFragmentFactory`.Biome now respects `jsxFactory` and `jsxFragmentFactory` settings from `tsconfig.json` when using the classic JSX runtime, preventing false positive [noUnusedImports](https://biomejs.dev/linter/rules/no-unused-imports/) errors for custom JSX libraries like Preact. | |
| Added support for `jsxFactory` and `jsxFragmentFactory`. Biome now respects `jsxFactory` and `jsxFragmentFactory` settings from `tsconfig.json` when using the classic JSX runtime, preventing false positive [noUnusedImports](https://biomejs.dev/linter/rules/no-unused-imports/) errors for custom JSX libraries like Preact. |
🤖 Prompt for AI Agents
In .changeset/eight-eels-pull.md around line 5, the sentence "Added support for
`jsxFactory` and `jsxFragmentFactory`.Biome now respects..." is missing a space
after the closing backtick; edit that line to insert a space after the backtick
so it reads "...`jsxFragmentFactory`. Biome now respects..." to fix the spacing.
| fn source_map(&self) -> Option<&TransformSourceMap> { | ||
| None | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: source_map() always returns None despite the field being set.
The with_source_map method on line 32 sets self.source_map, but this accessor ignores it and always returns None. This breaks source map functionality used in verbatim.rs (lines 60-63, 108-116).
fn source_map(&self) -> Option<&TransformSourceMap> {
- None
+ self.source_map.as_ref()
}📝 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.
| fn source_map(&self) -> Option<&TransformSourceMap> { | |
| None | |
| } | |
| fn source_map(&self) -> Option<&TransformSourceMap> { | |
| self.source_map.as_ref() | |
| } |
🤖 Prompt for AI Agents
In crates/biome_yaml_formatter/src/context.rs around lines 45-47, the
source_map() accessor currently always returns None even though with_source_map
sets self.source_map; change the method to return a reference to the stored
Option by returning self.source_map.as_ref() (or Some(&self.source_map) if the
field is not an Option) so callers receive the actual TransformSourceMap; ensure
the function signature remains fn source_map(&self) ->
Option<&TransformSourceMap> and compile.
| /// Rule for formatting an bogus nodes. | ||
| pub(crate) trait FormatBogusNodeRule<N> | ||
| where | ||
| N: AstNode<Language = YamlLanguage>, | ||
| { | ||
| fn fmt(&self, node: &N, f: &mut YamlFormatter) -> FormatResult<()> { | ||
| format_bogus_node(node.syntax()).fmt(f) | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor typo in doc comment.
"an bogus nodes" → "a bogus node" or "bogus nodes".
-/// Rule for formatting an bogus nodes.
+/// Rule for formatting bogus nodes.
pub(crate) trait FormatBogusNodeRule<N>📝 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.
| /// Rule for formatting an bogus nodes. | |
| pub(crate) trait FormatBogusNodeRule<N> | |
| where | |
| N: AstNode<Language = YamlLanguage>, | |
| { | |
| fn fmt(&self, node: &N, f: &mut YamlFormatter) -> FormatResult<()> { | |
| format_bogus_node(node.syntax()).fmt(f) | |
| } | |
| } | |
| /// Rule for formatting bogus nodes. | |
| pub(crate) trait FormatBogusNodeRule<N> | |
| where | |
| N: AstNode<Language = YamlLanguage>, | |
| { | |
| fn fmt(&self, node: &N, f: &mut YamlFormatter) -> FormatResult<()> { | |
| format_bogus_node(node.syntax()).fmt(f) | |
| } | |
| } |
🤖 Prompt for AI Agents
In crates/biome_yaml_formatter/src/lib.rs around lines 234 to 242, the doc
comment for the trait reads "Rule for formatting an bogus nodes" which contains
a typo and grammatical error; update the comment to use correct article and
number, e.g. "Rule for formatting a bogus node" or "Rule for formatting bogus
nodes" to match intended meaning and keep it consistent with surrounding docs.
commit: |
CodSpeed Performance ReportMerging #8275 will not alter performanceComparing Summary
Footnotes
|
Parser conformance results onjs/262
jsx/babel
symbols/microsoft
ts/babel
ts/microsoft
|
Co-authored-by: Emanuele Stoppa <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Summary
Caution
main->next.Test Plan
Docs