Skip to content

feat: sort interface members#7553

Closed
hamirmahal wants to merge 87 commits intobiomejs:nextfrom
hamirmahal:feat/sort-interface-members
Closed

feat: sort interface members#7553
hamirmahal wants to merge 87 commits intobiomejs:nextfrom
hamirmahal:feat/sort-interface-members

Conversation

@hamirmahal
Copy link
Contributor

Summary

This sorts interface members.

Test Plan

There are new test files and expected output.

crates/biome_js_analyze/tests/specs/source/useSortedInterfaceMembers/mixed.ts
crates/biome_js_analyze/tests/specs/source/useSortedInterfaceMembers/mixed.ts.snap
crates/biome_js_analyze/tests/specs/source/useSortedInterfaceMembers/sorted.ts
crates/biome_js_analyze/tests/specs/source/useSortedInterfaceMembers/sorted.ts.snap
crates/biome_js_analyze/tests/specs/source/useSortedInterfaceMembers/unsorted.ts
crates/biome_js_analyze/tests/specs/source/useSortedInterfaceMembers/unsorted.ts.snap

Docs

Included above pub UseSortedInterfaceMembers

@changeset-bot
Copy link

changeset-bot bot commented Sep 21, 2025

🦋 Changeset detected

Latest commit: 1eabb32

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 14 packages
Name Type
@biomejs/biome Minor
@biomejs/cli-win32-x64 Minor
@biomejs/cli-win32-arm64 Minor
@biomejs/cli-darwin-x64 Minor
@biomejs/cli-darwin-arm64 Minor
@biomejs/cli-linux-x64 Minor
@biomejs/cli-linux-arm64 Minor
@biomejs/cli-linux-x64-musl Minor
@biomejs/cli-linux-arm64-musl Minor
@biomejs/wasm-web Minor
@biomejs/wasm-bundler Minor
@biomejs/wasm-nodejs Minor
@biomejs/backend-jsonrpc Patch
@biomejs/js-api Major

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

@github-actions github-actions bot added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages A-Diagnostic Area: diagnostocis A-Project Area: project labels Sep 21, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Sep 21, 2025

CodSpeed Performance Report

Merging #7553 will improve performances by 6.49%

Comparing hamirmahal:feat/sort-interface-members (1eabb32) with next (5901d79)

Summary

⚡ 1 improvement
✅ 52 untouched
🆕 5 new
⏩ 85 skipped1

Benchmarks breakdown

Benchmark BASE HEAD Change
js_analyzer[parser_13571644119461115204.ts] 100.3 ms 94.2 ms +6.49%
🆕 class_strings[arbitrary_classes] N/A 33.2 µs N/A
🆕 class_strings[extreme_stress] N/A 152 µs N/A
🆕 class_strings[simple_classes] N/A 20.2 µs N/A
🆕 class_strings[stress] N/A 375.7 µs N/A
🆕 class_strings[variant_classes] N/A 37.5 µs N/A

Footnotes

  1. 85 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution. The groundwork of the rule is solid, however there are important things to address:

  • the documentation: it doesn't explain why some items aren't sortable, it doesn't explain the option sortOrder, it doesn't explain how multiple non-sortable items are sorted among themselves
  • Tests for the option are absent
  • The option is missing and it's not documented with docstrings
  • The action must be placed inside the nursery group

@hamirmahal
Copy link
Contributor Author

Thanks for the feedback. I usually don't have much availability during the week, so I'll try to do as much of the implementation as I can on weekends.

@hamirmahal hamirmahal force-pushed the feat/sort-interface-members branch from b009251 to 654b64b Compare September 27, 2025 01:44
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 27, 2025

Walkthrough

This pull request introduces a significant refactoring of CSS at-rule parsing and formatting to separate declarator logic from conditional/declaration block handling. It adds support for CSS at-rule declarators across multiple at-rule types (media, container, scope, etc.). Additionally, the PR migrates JSON schema implementations to use newer schemars APIs, updates various tool versions in CI workflows (Node.js to 24.11.1, Rust to 1.91.1), introduces a new useSortedInterfaceMembers assist action, and includes numerous dependency version bumps and documentation corrections.

Possibly related PRs

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 19.81% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: sort interface members' accurately reflects the main change—implementing a new assist action that sorts TypeScript interface members for readability.
Description check ✅ Passed The description is related to the changeset, mentioning the sorting functionality, test files, and documentation, though it lacks detail about the assist action implementation itself.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 (5)
crates/biome_js_analyze/tests/specs/source/useSortedInterfaceMembers/mixed.ts (1)

1-11: Broaden the test to cover sort_order and multiple non‑sortables

Please add variants asserting both natural and lexicographic orders and a case with multiple call/construct/index signatures to verify stability among non‑sortable members.

Would you like me to draft the extra test cases?

crates/biome_rule_options/src/use_sorted_interface_members.rs (1)

1-6: Add tests that exercise the option

Please add tests asserting both SortOrder::Natural and SortOrder::Lexicographic behaviours.

I can add snapshots for both orders if you confirm the desired defaults.

crates/biome_js_analyze/src/assist/source/use_sorted_interface_members.rs (3)

46-52: Use the helper and simplify control flow

Removes Result plumbing.

Apply this diff:

-    for member in list.iter() {
-        if let Ok(Some(name)) = member.name()
-            && let Some(token_text) = name.name()
-        {
-            sortable_keys.push(ComparableToken::new(token_text));
-        }
-    }
+    for member in list.iter() {
+        if let Some(name) = type_member_name(&member)
+            && let Some(token_text) = name.name()
+        {
+            sortable_keys.push(ComparableToken::new(token_text));
+        }
+    }

99-107: Clarify docs: explicitly list sortable vs non‑sortable, no parentheses

Small wording tweak helps users understand what moves and what doesn’t.

Apply this diff:

-    /// This rule sorts all sortable members (properties, methods, getters, setters)
-    /// and groups them at the beginning of the interface. Non-sortable members
-    /// (call signatures, construct signatures, and index signatures) are grouped
-    /// at the end of the interface.
+    /// This rule sorts only:
+    /// - properties
+    /// - methods
+    /// - getters
+    /// - setters
+    ///
+    /// It does not sort:
+    /// - call signatures
+    /// - construct signatures
+    /// - index signatures
+    ///
+    /// Non‑sortable members are not re‑ordered and keep their original positions.

If you keep trailing non‑sortables, adjust the last sentence accordingly.


154-157: DRY the comparator mapping (optional)

The SortOrder→comparator mapping is duplicated; consider a small helper to return the comparator.

Example:

fn cmp_for(order: SortOrder) -> fn(&ComparableToken, &ComparableToken) -> std::cmp::Ordering {
    match order {
        SortOrder::Natural => ComparableToken::ascii_nat_cmp,
        SortOrder::Lexicographic => ComparableToken::lexicographic_cmp,
    }
}

Then use cmp_for(options.sort_order) in both places.

Also applies to: 186-189

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c294644 and 654b64b.

⛔ Files ignored due to path filters (6)
  • crates/biome_diagnostics_categories/src/categories.rs is excluded by !**/categories.rs and included by **
  • crates/biome_js_analyze/tests/specs/source/useSortedInterfaceMembers/mixed.ts.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/source/useSortedInterfaceMembers/sorted.ts.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/source/useSortedInterfaceMembers/unsorted.ts.snap is excluded by !**/*.snap and included by **
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts is excluded by !**/backend-jsonrpc/src/workspace.ts and included by **
  • packages/@biomejs/biome/configuration_schema.json is excluded by !**/configuration_schema.json and included by **
📒 Files selected for processing (9)
  • crates/biome_configuration/src/analyzer/assist/actions.rs (9 hunks)
  • crates/biome_js_analyze/src/assist/source.rs (1 hunks)
  • crates/biome_js_analyze/src/assist/source/use_sorted_interface_members.rs (1 hunks)
  • crates/biome_js_analyze/src/options.rs (1 hunks)
  • crates/biome_js_analyze/tests/specs/source/useSortedInterfaceMembers/mixed.ts (1 hunks)
  • crates/biome_js_analyze/tests/specs/source/useSortedInterfaceMembers/sorted.ts (1 hunks)
  • crates/biome_js_analyze/tests/specs/source/useSortedInterfaceMembers/unsorted.ts (1 hunks)
  • crates/biome_rule_options/src/lib.rs (1 hunks)
  • crates/biome_rule_options/src/use_sorted_interface_members.rs (1 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
crates/biome_*_{syntax,parser,formatter,analyze,factory,semantic}/**

📄 CodeRabbit inference engine (CLAUDE.md)

Maintain the per-language crate structure: biome_{lang}_{syntax,parser,formatter,analyze,factory,semantic}

Files:

  • crates/biome_js_analyze/tests/specs/source/useSortedInterfaceMembers/unsorted.ts
  • crates/biome_js_analyze/src/options.rs
  • crates/biome_js_analyze/src/assist/source.rs
  • crates/biome_js_analyze/tests/specs/source/useSortedInterfaceMembers/sorted.ts
  • crates/biome_js_analyze/tests/specs/source/useSortedInterfaceMembers/mixed.ts
  • crates/biome_js_analyze/src/assist/source/use_sorted_interface_members.rs
crates/biome_*/**

📄 CodeRabbit inference engine (CLAUDE.md)

Place core crates under /crates/biome_*/

Files:

  • crates/biome_js_analyze/tests/specs/source/useSortedInterfaceMembers/unsorted.ts
  • crates/biome_js_analyze/src/options.rs
  • crates/biome_rule_options/src/use_sorted_interface_members.rs
  • crates/biome_js_analyze/src/assist/source.rs
  • crates/biome_rule_options/src/lib.rs
  • crates/biome_js_analyze/tests/specs/source/useSortedInterfaceMembers/sorted.ts
  • crates/biome_js_analyze/tests/specs/source/useSortedInterfaceMembers/mixed.ts
  • crates/biome_configuration/src/analyzer/assist/actions.rs
  • crates/biome_js_analyze/src/assist/source/use_sorted_interface_members.rs
**/tests/**

📄 CodeRabbit inference engine (CLAUDE.md)

Place test files under a tests/ directory in each crate

Files:

  • crates/biome_js_analyze/tests/specs/source/useSortedInterfaceMembers/unsorted.ts
  • crates/biome_js_analyze/tests/specs/source/useSortedInterfaceMembers/sorted.ts
  • crates/biome_js_analyze/tests/specs/source/useSortedInterfaceMembers/mixed.ts
**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Format all Rust source files before committing (just f)

Files:

  • crates/biome_js_analyze/src/options.rs
  • crates/biome_rule_options/src/use_sorted_interface_members.rs
  • crates/biome_js_analyze/src/assist/source.rs
  • crates/biome_rule_options/src/lib.rs
  • crates/biome_configuration/src/analyzer/assist/actions.rs
  • crates/biome_js_analyze/src/assist/source/use_sorted_interface_members.rs
crates/biome_configuration/src/**

📄 CodeRabbit inference engine (CLAUDE.md)

Keep configuration sources under biome_configuration/src/

Files:

  • crates/biome_configuration/src/analyzer/assist/actions.rs
🧠 Learnings (14)
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/crates/biome_rule_options/lib/**/*.rs : Define per-rule options types in `biome_rule_options` crate (one file per rule, e.g., `lib/use_my_rule.rs`)

Applied to files:

  • crates/biome_js_analyze/src/options.rs
  • crates/biome_rule_options/src/use_sorted_interface_members.rs
  • crates/biome_js_analyze/src/assist/source.rs
  • crates/biome_rule_options/src/lib.rs
  • crates/biome_configuration/src/analyzer/assist/actions.rs
  • crates/biome_js_analyze/src/assist/source/use_sorted_interface_members.rs
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/crates/biome_rule_options/lib/**/*.rs : Options types must implement serialization/deserialization and schema support using derives: `Serialize`, `Deserialize`, `Deserializable`, and `#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]`

Applied to files:

  • crates/biome_js_analyze/src/options.rs
  • crates/biome_rule_options/src/use_sorted_interface_members.rs
📚 Learning: 2025-08-11T11:50:12.090Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:50:12.090Z
Learning: Applies to crates/biome_js_type_info/src/**/*.rs : Represent links between types using TypeReference (not Arc) to avoid cross-module retention and recursive structures; store type data in linear vectors

Applied to files:

  • crates/biome_js_analyze/src/options.rs
📚 Learning: 2025-08-11T11:50:12.090Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:50:12.090Z
Learning: Applies to crates/biome_js_type_info/src/**/*.rs : Use TypeData::Unknown for unimplemented inference and TypeData::UnknownKeyword for the explicit TypeScript unknown keyword; treat them semantically the same but keep them distinct for measurement

Applied to files:

  • crates/biome_js_analyze/src/options.rs
📚 Learning: 2025-08-11T11:46:05.836Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:46:05.836Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : Use helper advice types from biome_diagnostics::v2 (CodeFrameAdvice, CommandAdvice, DiffAdvice, LogAdvice) when suitable

Applied to files:

  • crates/biome_js_analyze/src/options.rs
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/**/src/{lint,assist}/**/*.rs : Follow rule naming conventions: use `no<Concept>` to forbid and `use<Concept>` to mandate; prefer consistent prefixes (e.g., `noDuplicate<Concept>`, `useConsistent<Concept>`)

Applied to files:

  • crates/biome_js_analyze/src/options.rs
  • crates/biome_js_analyze/src/assist/source.rs
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/**/src/{lint,assist}/**/*.rs : Recommended rules with domains are enabled only when users enable the matching domains; use `domains` metadata judiciously

Applied to files:

  • crates/biome_js_analyze/src/options.rs
  • crates/biome_js_analyze/src/assist/source.rs
  • crates/biome_configuration/src/analyzer/assist/actions.rs
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/**/src/{lint,assist}/**/*.rs : In declare_lint_rule! macros, set `version: "next"` for new or updated rules

Applied to files:

  • crates/biome_js_analyze/src/assist/source.rs
  • crates/biome_js_analyze/src/assist/source/use_sorted_interface_members.rs
📚 Learning: 2025-09-07T17:35:00.517Z
Learnt from: CR
PR: biomejs/biome#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-09-07T17:35:00.517Z
Learning: Update documentation when features change; for rules/assists/options, use inline Rust rustdoc

Applied to files:

  • crates/biome_js_analyze/src/assist/source.rs
  • crates/biome_configuration/src/analyzer/assist/actions.rs
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/**/src/{lint,assist}/**/*.rs : Avoid deep indentation and panics; prefer `?`, `ok()?`, and combinators (`map`, `and_then`, `filter`) over nested `if let`/`unwrap`/`expect`

Applied to files:

  • crates/biome_js_analyze/src/assist/source.rs
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/**/src/{lint,assist}/**/*.rs : When deprecating a rule, add `deprecated: "<reason>"` to `declare_lint_rule!`

Applied to files:

  • crates/biome_js_analyze/src/assist/source.rs
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/**/src/{lint,assist}/**/*.rs : Code blocks in rule docs must specify language; invalid snippets require `expect_diagnostic`; use `options`/`full_options`/`use_options` markers as appropriate

Applied to files:

  • crates/biome_js_analyze/src/assist/source.rs
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/**/src/**/nursery/**/*.rs : Place all new rules in the nursery group (implement rule files under a `.../src/*/nursery/` directory)

Applied to files:

  • crates/biome_js_analyze/src/assist/source.rs
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/**/src/{lint,assist}/**/*.rs : If a rule returns a code action (implements `action`), add `fix_kind` in `declare_lint_rule!` and use `ctx.metadata().applicability()` when building the action

Applied to files:

  • crates/biome_js_analyze/src/assist/source.rs
  • crates/biome_configuration/src/analyzer/assist/actions.rs
  • crates/biome_js_analyze/src/assist/source/use_sorted_interface_members.rs
🧬 Code graph analysis (1)
crates/biome_js_analyze/src/assist/source.rs (1)
crates/biome_js_analyze/src/assist/source/use_sorted_interface_members.rs (2)
  • name (21-21)
  • name (24-37)
⏰ 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). (25)
  • GitHub Check: Bench (biome_package)
  • GitHub Check: Bench (biome_configuration)
  • GitHub Check: Check JS Files
  • GitHub Check: autofix
  • GitHub Check: Bench (biome_html_formatter)
  • GitHub Check: Bench (biome_css_formatter)
  • GitHub Check: Bench (biome_html_parser)
  • GitHub Check: Bench (biome_graphql_formatter)
  • GitHub Check: Bench (biome_module_graph)
  • GitHub Check: Bench (biome_json_parser)
  • GitHub Check: Bench (biome_json_analyze)
  • GitHub Check: Bench (biome_graphql_parser)
  • GitHub Check: Bench (biome_json_formatter)
  • GitHub Check: Bench (biome_css_analyze)
  • GitHub Check: Bench (biome_css_parser)
  • GitHub Check: Bench (biome_js_parser)
  • GitHub Check: Bench (biome_js_analyze)
  • GitHub Check: Bench (biome_js_formatter)
  • GitHub Check: Test Node.js API
  • GitHub Check: Documentation
  • GitHub Check: Check Dependencies
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
🔇 Additional comments (6)
crates/biome_js_analyze/src/options.rs (1)

453-454: Alias slots in nicely.
Thanks for threading the new assist into the generated aliases without rocking the alphabetical boat.

crates/biome_js_analyze/src/assist/source/use_sorted_interface_members.rs (3)

20-38: Replace single‑use trait with a simple helper that returns Option<_>

A trait implemented for a single type adds indirection. A small function with .ok() is clearer.

Apply this diff:

-trait TsTypeMemberName {
-    fn name(&self) -> SyntaxResult<Option<AnyJsObjectMemberName>>;
-}
-impl TsTypeMemberName for AnyTsTypeMember {
-    fn name(&self) -> SyntaxResult<Option<AnyJsObjectMemberName>> {
-        match self {
-            // Property signatures have names
-            Self::TsPropertySignatureTypeMember(prop) => prop.name().map(Some),
-            // Method signatures have names
-            Self::TsMethodSignatureTypeMember(method) => method.name().map(Some),
-            // Getter signatures have names
-            Self::TsGetterSignatureTypeMember(getter) => getter.name().map(Some),
-            // Setter signatures have names
-            Self::TsSetterSignatureTypeMember(setter) => setter.name().map(Some),
-            // Call signatures, construct signatures, and index signatures don't have sortable names
-            _ => Ok(None),
-        }
-    }
-}
+fn type_member_name(member: &AnyTsTypeMember) -> Option<AnyJsObjectMemberName> {
+    match member {
+        AnyTsTypeMember::TsPropertySignatureTypeMember(prop) => prop.name().ok(),
+        AnyTsTypeMember::TsMethodSignatureTypeMember(method) => method.name().ok(),
+        AnyTsTypeMember::TsGetterSignatureTypeMember(getter) => getter.name().ok(),
+        AnyTsTypeMember::TsSetterSignatureTypeMember(setter) => setter.name().ok(),
+        // Call, construct, and index signatures have no sortable name
+        _ => None,
+    }
+}

70-97: Don’t move non‑sortable members; perform an in‑place stable reorder

Current fix moves non‑sortable members to the end, contradicting the intent that they’re “non‑sortable”, and mismatches detection (which ignores their positions). Keep them in place and only reorder sortable slots.

Apply this diff:

-    let mut sortable_members = Vec::new();
-    let mut non_sortable_members = Vec::new();
-
-    // Separate sortable from non-sortable members
-    for member in list.iter() {
-        if let Ok(Some(name)) = member.name() {
-            if let Some(token_text) = name.name() {
-                sortable_members.push((member, ComparableToken::new(token_text)));
-            } else {
-                // Name exists but is not sortable (computed/dynamic)
-                non_sortable_members.push(member);
-            }
-        } else {
-            // No name (call signatures, construct signatures, index signatures)
-            non_sortable_members.push(member);
-        }
-    }
-
-    // Sort the sortable members
-    sortable_members.sort_by(|(_, a), (_, b)| comparator(a, b));
-
-    // Combine: all sortable members first, then all non-sortable members
-    let mut new_members: Vec<AnyTsTypeMember> = sortable_members
-        .into_iter()
-        .map(|(member, _)| member)
-        .collect();
-
-    new_members.extend(non_sortable_members);
-
-    make::ts_type_member_list(new_members)
+    // Collect sortable members and mark which positions are sortable
+    let mut sortable: Vec<(AnyTsTypeMember, ComparableToken)> = Vec::new();
+    let mut is_sortable: Vec<bool> = Vec::new();
+    for member in list.iter() {
+        if let Some(name) = type_member_name(&member)
+            && let Some(token) = name.name()
+        {
+            is_sortable.push(true);
+            sortable.push((member, ComparableToken::new(token)));
+        } else {
+            is_sortable.push(false);
+        }
+    }
+
+    // Sort only the sortable members by the chosen comparator
+    sortable.sort_by(|(_, a), (_, b)| comparator(a, b));
+    let mut sorted_iter = sortable.into_iter().map(|(m, _)| m);
+
+    // Rebuild the list: keep non-sortables in place, fill sortable slots with the next sorted member
+    let new_members: Vec<AnyTsTypeMember> = list
+        .iter()
+        .enumerate()
+        .map(|(idx, member)| if is_sortable[idx] {
+            sorted_iter.next().expect("sorted members length should match")
+        } else {
+            member
+        })
+        .collect();
+
+    make::ts_type_member_list(new_members)

If you prefer grouping non‑sortables at the end, then update the detection to also assert “non‑sortables are trailing”, so run() and the fix stay consistent.


135-135: Set version: "next" for new rules

New or updated rules should use version: "next".

Apply this diff:

-        version: "2.0.0",
+        version: "next",

As per coding guidelines

crates/biome_rule_options/src/use_sorted_interface_members.rs (1)

1-6: Add the missing sort_order option (and wire it into the rule)

The options struct is empty but the rule reads options.sort_order via UseSortedKeysOptions. Either alias to that type or add the field here and update the rule to use this options type. Below adds the field and keeps derives consistent.

Apply this diff:

 use biome_deserialize_macros::Deserializable;
 use serde::{Deserialize, Serialize};
+use crate::use_sorted_keys::SortOrder;
 #[derive(Default, Clone, Debug, Deserialize, Deserializable, Eq, PartialEq, Serialize)]
 #[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
 #[serde(rename_all = "camelCase", deny_unknown_fields, default)]
-pub struct UseSortedInterfaceMembersOptions {}
+pub struct UseSortedInterfaceMembersOptions {
+    pub sort_order: SortOrder,
+}

As per coding guidelines

crates/biome_configuration/src/analyzer/assist/actions.rs (1)

200-206: Looks consistent with the other assists.

Nice to see the new rule documented and threaded through the config in one sweep.

@hamirmahal hamirmahal force-pushed the feat/sort-interface-members branch from 654b64b to befa13a Compare September 27, 2025 05:18
@github-actions github-actions bot removed the A-Project Area: project label Sep 27, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 654b64b and befa13a.

⛔ Files ignored due to path filters (4)
  • crates/biome_diagnostics_categories/src/categories.rs is excluded by !**/categories.rs and included by **
  • crates/biome_js_analyze/tests/specs/source/useSortedInterfaceMembers/multiple_non_sortable.ts.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/source/useSortedInterfaceMembers/sorted.ts.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/source/useSortedInterfaceMembers/unsorted.ts.snap is excluded by !**/*.snap and included by **
📒 Files selected for processing (6)
  • crates/biome_js_analyze/src/assist/source.rs (1 hunks)
  • crates/biome_js_analyze/src/assist/source/use_sorted_interface_members.rs (1 hunks)
  • crates/biome_js_analyze/src/options.rs (1 hunks)
  • crates/biome_js_analyze/tests/specs/source/useSortedInterfaceMembers/multiple_non_sortable.ts (1 hunks)
  • crates/biome_js_analyze/tests/specs/source/useSortedInterfaceMembers/sorted.ts (1 hunks)
  • crates/biome_js_analyze/tests/specs/source/useSortedInterfaceMembers/unsorted.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • crates/biome_js_analyze/src/assist/source.rs
  • crates/biome_js_analyze/tests/specs/source/useSortedInterfaceMembers/sorted.ts
  • crates/biome_js_analyze/src/options.rs
🧰 Additional context used
📓 Path-based instructions (4)
crates/biome_*_{syntax,parser,formatter,analyze,factory,semantic}/**

📄 CodeRabbit inference engine (CLAUDE.md)

Maintain the per-language crate structure: biome_{lang}_{syntax,parser,formatter,analyze,factory,semantic}

Files:

  • crates/biome_js_analyze/tests/specs/source/useSortedInterfaceMembers/unsorted.ts
  • crates/biome_js_analyze/src/assist/source/use_sorted_interface_members.rs
  • crates/biome_js_analyze/tests/specs/source/useSortedInterfaceMembers/multiple_non_sortable.ts
crates/biome_*/**

📄 CodeRabbit inference engine (CLAUDE.md)

Place core crates under /crates/biome_*/

Files:

  • crates/biome_js_analyze/tests/specs/source/useSortedInterfaceMembers/unsorted.ts
  • crates/biome_js_analyze/src/assist/source/use_sorted_interface_members.rs
  • crates/biome_js_analyze/tests/specs/source/useSortedInterfaceMembers/multiple_non_sortable.ts
**/tests/**

📄 CodeRabbit inference engine (CLAUDE.md)

Place test files under a tests/ directory in each crate

Files:

  • crates/biome_js_analyze/tests/specs/source/useSortedInterfaceMembers/unsorted.ts
  • crates/biome_js_analyze/tests/specs/source/useSortedInterfaceMembers/multiple_non_sortable.ts
**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Format all Rust source files before committing (just f)

Files:

  • crates/biome_js_analyze/src/assist/source/use_sorted_interface_members.rs
🧠 Learnings (12)
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/crates/biome_rule_options/lib/**/*.rs : Define per-rule options types in `biome_rule_options` crate (one file per rule, e.g., `lib/use_my_rule.rs`)

Applied to files:

  • crates/biome_js_analyze/src/assist/source/use_sorted_interface_members.rs
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/**/src/{lint,assist}/**/*.rs : If a rule returns a code action (implements `action`), add `fix_kind` in `declare_lint_rule!` and use `ctx.metadata().applicability()` when building the action

Applied to files:

  • crates/biome_js_analyze/src/assist/source/use_sorted_interface_members.rs
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/**/src/{lint,assist}/**/*.rs : In declare_lint_rule! macros, set `version: "next"` for new or updated rules

Applied to files:

  • crates/biome_js_analyze/src/assist/source/use_sorted_interface_members.rs
📚 Learning: 2025-08-11T11:46:05.836Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:46:05.836Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : Use helper advice types from biome_diagnostics::v2 (CodeFrameAdvice, CommandAdvice, DiffAdvice, LogAdvice) when suitable

Applied to files:

  • crates/biome_js_analyze/src/assist/source/use_sorted_interface_members.rs
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/**/src/{lint,assist}/**/*.rs : Avoid avoidable string allocations: prefer comparing `&str` or using `TokenText` over calling `to_string()`

Applied to files:

  • crates/biome_js_analyze/src/assist/source/use_sorted_interface_members.rs
📚 Learning: 2025-08-11T11:50:12.090Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:50:12.090Z
Learning: Applies to crates/biome_js_type_info/{src,biome_module_graph/src}/**/*.rs : When pattern-matching on ResolvedTypeData via as_raw_data(), ensure any nested TypeReferences are subsequently resolved using the correct ResolverId; never use the raw data with a resolver without applying the right ResolverId to avoid panics

Applied to files:

  • crates/biome_js_analyze/src/assist/source/use_sorted_interface_members.rs
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/**/src/{lint,assist}/**/*.rs : Code blocks in rule docs must specify language; invalid snippets require `expect_diagnostic`; use `options`/`full_options`/`use_options` markers as appropriate

Applied to files:

  • crates/biome_js_analyze/src/assist/source/use_sorted_interface_members.rs
📚 Learning: 2025-08-11T11:50:12.090Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:50:12.090Z
Learning: Applies to crates/biome_js_type_info/src/**/*.rs : Use TypeData::Unknown for unimplemented inference and TypeData::UnknownKeyword for the explicit TypeScript unknown keyword; treat them semantically the same but keep them distinct for measurement

Applied to files:

  • crates/biome_js_analyze/src/assist/source/use_sorted_interface_members.rs
📚 Learning: 2025-08-11T11:50:12.090Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:50:12.090Z
Learning: Applies to crates/biome_js_type_info/src/**/*.rs : Represent links between types using TypeReference (not Arc) to avoid cross-module retention and recursive structures; store type data in linear vectors

Applied to files:

  • crates/biome_js_analyze/src/assist/source/use_sorted_interface_members.rs
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/**/src/{lint,assist}/**/*.rs : Follow rule naming conventions: use `no<Concept>` to forbid and `use<Concept>` to mandate; prefer consistent prefixes (e.g., `noDuplicate<Concept>`, `useConsistent<Concept>`)

Applied to files:

  • crates/biome_js_analyze/src/assist/source/use_sorted_interface_members.rs
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/crates/biome_rule_options/lib/**/*.rs : Options types must implement serialization/deserialization and schema support using derives: `Serialize`, `Deserialize`, `Deserializable`, and `#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]`

Applied to files:

  • crates/biome_js_analyze/src/assist/source/use_sorted_interface_members.rs
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/**/src/{lint,assist}/**/*.rs : Recommended rules with domains are enabled only when users enable the matching domains; use `domains` metadata judiciously

Applied to files:

  • crates/biome_js_analyze/src/assist/source/use_sorted_interface_members.rs
⏰ 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). (24)
  • GitHub Check: Documentation
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Check Dependencies
  • GitHub Check: Bench (biome_package)
  • GitHub Check: Bench (biome_configuration)
  • GitHub Check: Bench (biome_graphql_formatter)
  • GitHub Check: Bench (biome_module_graph)
  • GitHub Check: Bench (biome_json_analyze)
  • GitHub Check: Bench (biome_html_formatter)
  • GitHub Check: Bench (biome_html_parser)
  • GitHub Check: Bench (biome_graphql_parser)
  • GitHub Check: Bench (biome_js_formatter)
  • GitHub Check: Bench (biome_js_analyze)
  • GitHub Check: Test Node.js API
  • GitHub Check: Bench (biome_css_analyze)
  • GitHub Check: Bench (biome_css_formatter)
  • GitHub Check: Bench (biome_json_formatter)
  • GitHub Check: Bench (biome_js_parser)
  • GitHub Check: Bench (biome_json_parser)
  • GitHub Check: Bench (biome_css_parser)
  • GitHub Check: autofix
🔇 Additional comments (4)
crates/biome_js_analyze/src/assist/source/use_sorted_interface_members.rs (2)

7-8: Fix the TextRange import

TextRange lives in biome_rowan; the current import won’t compile. Let’s pull it from the existing biome_rowan import bundle so the build stays happy.

-use biome_deserialize::TextRange;
-use biome_rowan::{AstNode, AstNodeList, BatchMutationExt};
+use biome_rowan::{AstNode, AstNodeList, BatchMutationExt, TextRange};

Also applies to: 15-15


116-121: Respect ctx.metadata().applicability()

Assists are expected to honour the analyser metadata, otherwise global applicability tweaks are ignored. Swapping out the hard-coded Applicability::Always keeps us in line with the other rules. Based on learnings

-            rule_action_category!(),
-            Applicability::Always,
+            rule_action_category!(),
+            ctx.metadata().applicability(),
crates/biome_js_analyze/tests/specs/source/useSortedInterfaceMembers/unsorted.ts (1)

1-5: LGTM: Unsorted fixture gives the rule something to chew on.

Leaving zebra ahead of apple nails the detection path—nicely done.

crates/biome_js_analyze/tests/specs/source/useSortedInterfaceMembers/multiple_non_sortable.ts (1)

1-11: LGTM: Mixed members thoroughly exercise the tricky cases.

This line-up keeps sortable bits and the call/construct/index signatures distinct, which is exactly what the fixer needs.

@github-actions github-actions bot added the A-Project Area: project label Sep 27, 2025
@hamirmahal hamirmahal force-pushed the feat/sort-interface-members branch from a837aed to 192a896 Compare September 27, 2025 23:00
@github-actions github-actions bot added the A-CLI Area: CLI label Sep 27, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs (1)

185-194: Sanity-check trivia/comment preservation in the fix

Rebuilding the list via make::ts_type_member_list and replace_node_discard_trivia may drop list-level trivia. Likely fine since member nodes are reused, but please verify comments between members survive the reordering; switch to replace_node if needed.

You can add a test with comments between members to ensure they’re preserved after applying the fix.

Also applies to: 109-113

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a837aed and 192a896.

⛔ Files ignored due to path filters (9)
  • crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs is excluded by !**/migrate/eslint_any_rule_to_biome.rs and included by **
  • crates/biome_configuration/src/analyzer/linter/rules.rs is excluded by !**/rules.rs and included by **
  • crates/biome_diagnostics_categories/src/categories.rs is excluded by !**/categories.rs and included by **
  • crates/biome_js_analyze/src/lint/nursery.rs is excluded by !**/nursery.rs and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/multiple_non_sortable.ts.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/sorted.ts.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/unsorted.ts.snap is excluded by !**/*.snap and included by **
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts is excluded by !**/backend-jsonrpc/src/workspace.ts and included by **
  • packages/@biomejs/biome/configuration_schema.json is excluded by !**/configuration_schema.json and included by **
📒 Files selected for processing (8)
  • biome.json (1 hunks)
  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs (1 hunks)
  • crates/biome_js_analyze/src/options.rs (1 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/multiple_non_sortable.ts (1 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/sorted.ts (1 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/unsorted.ts (1 hunks)
  • crates/biome_rule_options/src/lib.rs (1 hunks)
  • crates/biome_rule_options/src/use_sorted_interface_members.rs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • crates/biome_rule_options/src/lib.rs
  • crates/biome_rule_options/src/use_sorted_interface_members.rs
🧰 Additional context used
📓 Path-based instructions (4)
crates/biome_*_{syntax,parser,formatter,analyze,factory,semantic}/**

📄 CodeRabbit inference engine (CLAUDE.md)

Maintain the per-language crate structure: biome_{lang}_{syntax,parser,formatter,analyze,factory,semantic}

Files:

  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/sorted.ts
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/multiple_non_sortable.ts
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/unsorted.ts
  • crates/biome_js_analyze/src/options.rs
  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs
crates/biome_*/**

📄 CodeRabbit inference engine (CLAUDE.md)

Place core crates under /crates/biome_*/

Files:

  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/sorted.ts
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/multiple_non_sortable.ts
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/unsorted.ts
  • crates/biome_js_analyze/src/options.rs
  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs
**/tests/**

📄 CodeRabbit inference engine (CLAUDE.md)

Place test files under a tests/ directory in each crate

Files:

  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/sorted.ts
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/multiple_non_sortable.ts
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/unsorted.ts
**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Format all Rust source files before committing (just f)

Files:

  • crates/biome_js_analyze/src/options.rs
  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs
🧠 Learnings (12)
📓 Common learnings
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/crates/biome_rule_options/lib/**/*.rs : Define per-rule options types in `biome_rule_options` crate (one file per rule, e.g., `lib/use_my_rule.rs`)
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/**/src/**/nursery/**/*.rs : Place all new rules in the nursery group (implement rule files under a `.../src/*/nursery/` directory)
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/crates/biome_rule_options/lib/**/*.rs : Options types must implement serialization/deserialization and schema support using derives: `Serialize`, `Deserialize`, `Deserializable`, and `#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]`
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/**/src/**/nursery/**/*.rs : Place all new rules in the nursery group (implement rule files under a `.../src/*/nursery/` directory)

Applied to files:

  • biome.json
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/crates/biome_rule_options/lib/**/*.rs : Define per-rule options types in `biome_rule_options` crate (one file per rule, e.g., `lib/use_my_rule.rs`)

Applied to files:

  • crates/biome_js_analyze/src/options.rs
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/crates/biome_rule_options/lib/**/*.rs : Options types must implement serialization/deserialization and schema support using derives: `Serialize`, `Deserialize`, `Deserializable`, and `#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]`

Applied to files:

  • crates/biome_js_analyze/src/options.rs
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/**/src/{lint,assist}/**/*.rs : In declare_lint_rule! macros, set `version: "next"` for new or updated rules

Applied to files:

  • crates/biome_js_analyze/src/options.rs
  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs
📚 Learning: 2025-08-11T11:50:12.090Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:50:12.090Z
Learning: Applies to crates/biome_js_type_info/src/**/*.rs : Represent links between types using TypeReference (not Arc) to avoid cross-module retention and recursive structures; store type data in linear vectors

Applied to files:

  • crates/biome_js_analyze/src/options.rs
  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/**/src/{lint,assist}/**/*.rs : If a rule returns a code action (implements `action`), add `fix_kind` in `declare_lint_rule!` and use `ctx.metadata().applicability()` when building the action

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/**/src/{lint,assist}/**/*.rs : Avoid avoidable string allocations: prefer comparing `&str` or using `TokenText` over calling `to_string()`

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs
📚 Learning: 2025-08-11T11:46:05.836Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:46:05.836Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : Use helper advice types from biome_diagnostics::v2 (CodeFrameAdvice, CommandAdvice, DiffAdvice, LogAdvice) when suitable

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs
📚 Learning: 2025-08-11T11:50:12.090Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:50:12.090Z
Learning: Applies to crates/biome_js_type_info/{src,biome_module_graph/src}/**/*.rs : When pattern-matching on ResolvedTypeData via as_raw_data(), ensure any nested TypeReferences are subsequently resolved using the correct ResolverId; never use the raw data with a resolver without applying the right ResolverId to avoid panics

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/**/src/{lint,assist}/**/*.rs : Code blocks in rule docs must specify language; invalid snippets require `expect_diagnostic`; use `options`/`full_options`/`use_options` markers as appropriate

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs
📚 Learning: 2025-08-11T11:50:12.090Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:50:12.090Z
Learning: Applies to crates/biome_js_type_info/src/**/*.rs : Use TypeData::Unknown for unimplemented inference and TypeData::UnknownKeyword for the explicit TypeScript unknown keyword; treat them semantically the same but keep them distinct for measurement

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs
🧬 Code graph analysis (1)
crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs (1)
crates/biome_analyze/src/rule.rs (3)
  • recommended (554-557)
  • sources (569-572)
  • inspired (249-254)
⏰ 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). (25)
  • GitHub Check: Bench (biome_json_parser)
  • GitHub Check: Bench (biome_html_formatter)
  • GitHub Check: Bench (biome_configuration)
  • GitHub Check: Bench (biome_html_parser)
  • GitHub Check: Bench (biome_module_graph)
  • GitHub Check: Bench (biome_package)
  • GitHub Check: Bench (biome_css_analyze)
  • GitHub Check: Bench (biome_json_formatter)
  • GitHub Check: Bench (biome_graphql_formatter)
  • GitHub Check: Bench (biome_graphql_parser)
  • GitHub Check: Bench (biome_json_analyze)
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Bench (biome_css_parser)
  • GitHub Check: Bench (biome_css_formatter)
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: autofix
  • GitHub Check: Bench (biome_js_analyze)
  • GitHub Check: Bench (biome_js_formatter)
  • GitHub Check: Documentation
  • GitHub Check: Bench (biome_js_parser)
  • GitHub Check: Check Dependencies
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Test Node.js API
  • GitHub Check: Check JS Files
🔇 Additional comments (3)
crates/biome_js_analyze/src/options.rs (1)

453-454: LGTM: options alias wiring looks correct

Alias points to the rule’s Options and follows the established pattern.

crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs (1)

7-7: Fix incorrect TextRange import (compile error)

Import TextRange from biome_rowan, not biome_deserialize.

Apply this diff:

- use biome_deserialize::TextRange;
+ use biome_rowan::TextRange;
biome.json (1)

79-82: Approve rule registration: useSortedInterfaceMembers correctly referenced
Config in biome.json contains a single reference matching the declare_lint_rule! name in use_sorted_interface_members.rs.

@hamirmahal hamirmahal force-pushed the feat/sort-interface-members branch 2 times, most recently from b554dd0 to 33c7e4d Compare September 27, 2025 23:51
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs (1)

78-82: Let the rule use its options struct

We just added UseSortedInterfaceMembersOptions, yet the rule still advertises () as its options. Wiring the rule to the struct keeps the schema tooling honest and avoids leaving that new type as a wallflower. Based on learnings

+use biome_rule_options::use_sorted_interface_members::UseSortedInterfaceMembersOptions;
@@
-    type Options = ();
+    type Options = UseSortedInterfaceMembersOptions;
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b554dd0 and 33c7e4d.

⛔ Files ignored due to path filters (11)
  • crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs is excluded by !**/migrate/eslint_any_rule_to_biome.rs and included by **
  • crates/biome_configuration/src/analyzer/linter/rules.rs is excluded by !**/rules.rs and included by **
  • crates/biome_diagnostics_categories/src/categories.rs is excluded by !**/categories.rs and included by **
  • crates/biome_js_analyze/src/lint/nursery.rs is excluded by !**/nursery.rs and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/multiple_non_sortable.ts.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/sortable_after_non_sortable.ts.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/sorted.ts.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/unsorted.ts.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/with_comments.ts.snap is excluded by !**/*.snap and included by **
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts is excluded by !**/backend-jsonrpc/src/workspace.ts and included by **
  • packages/@biomejs/biome/configuration_schema.json is excluded by !**/configuration_schema.json and included by **
📒 Files selected for processing (10)
  • biome.json (1 hunks)
  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs (1 hunks)
  • crates/biome_js_analyze/src/options.rs (1 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/multiple_non_sortable.ts (1 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/sortable_after_non_sortable.ts (1 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/sorted.ts (1 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/unsorted.ts (1 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/with_comments.ts (1 hunks)
  • crates/biome_rule_options/src/lib.rs (1 hunks)
  • crates/biome_rule_options/src/use_sorted_interface_members.rs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
  • crates/biome_js_analyze/src/options.rs
  • biome.json
  • crates/biome_rule_options/src/lib.rs
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/sorted.ts
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/unsorted.ts
🧰 Additional context used
📓 Path-based instructions (4)
crates/biome_*/**

📄 CodeRabbit inference engine (CLAUDE.md)

Place core crates under /crates/biome_*/

Files:

  • crates/biome_rule_options/src/use_sorted_interface_members.rs
  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/multiple_non_sortable.ts
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/sortable_after_non_sortable.ts
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/with_comments.ts
**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Format all Rust source files before committing (just f)

Files:

  • crates/biome_rule_options/src/use_sorted_interface_members.rs
  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs
crates/biome_*_{syntax,parser,formatter,analyze,factory,semantic}/**

📄 CodeRabbit inference engine (CLAUDE.md)

Maintain the per-language crate structure: biome_{lang}_{syntax,parser,formatter,analyze,factory,semantic}

Files:

  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/multiple_non_sortable.ts
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/sortable_after_non_sortable.ts
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/with_comments.ts
**/tests/**

📄 CodeRabbit inference engine (CLAUDE.md)

Place test files under a tests/ directory in each crate

Files:

  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/multiple_non_sortable.ts
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/sortable_after_non_sortable.ts
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/with_comments.ts
🧠 Learnings (15)
📓 Common learnings
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/crates/biome_rule_options/lib/**/*.rs : Define per-rule options types in `biome_rule_options` crate (one file per rule, e.g., `lib/use_my_rule.rs`)
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/**/src/**/nursery/**/*.rs : Place all new rules in the nursery group (implement rule files under a `.../src/*/nursery/` directory)
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/crates/biome_rule_options/lib/**/*.rs : Options types must implement serialization/deserialization and schema support using derives: `Serialize`, `Deserialize`, `Deserializable`, and `#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]`
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/crates/biome_rule_options/lib/**/*.rs : Options types must implement serialization/deserialization and schema support using derives: `Serialize`, `Deserialize`, `Deserializable`, and `#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]`

Applied to files:

  • crates/biome_rule_options/src/use_sorted_interface_members.rs
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/crates/biome_rule_options/lib/**/*.rs : Define per-rule options types in `biome_rule_options` crate (one file per rule, e.g., `lib/use_my_rule.rs`)

Applied to files:

  • crates/biome_rule_options/src/use_sorted_interface_members.rs
  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/**/src/{lint,assist}/**/*.rs : If a rule returns a code action (implements `action`), add `fix_kind` in `declare_lint_rule!` and use `ctx.metadata().applicability()` when building the action

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/**/src/{lint,assist}/**/*.rs : In declare_lint_rule! macros, set `version: "next"` for new or updated rules

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/**/src/{lint,assist}/**/*.rs : Avoid avoidable string allocations: prefer comparing `&str` or using `TokenText` over calling `to_string()`

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs
📚 Learning: 2025-08-11T11:46:05.836Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:46:05.836Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : Use helper advice types from biome_diagnostics::v2 (CodeFrameAdvice, CommandAdvice, DiffAdvice, LogAdvice) when suitable

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs
📚 Learning: 2025-08-11T11:50:12.090Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:50:12.090Z
Learning: Applies to crates/biome_js_type_info/{src,biome_module_graph/src}/**/*.rs : When pattern-matching on ResolvedTypeData via as_raw_data(), ensure any nested TypeReferences are subsequently resolved using the correct ResolverId; never use the raw data with a resolver without applying the right ResolverId to avoid panics

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/**/src/{lint,assist}/**/*.rs : Code blocks in rule docs must specify language; invalid snippets require `expect_diagnostic`; use `options`/`full_options`/`use_options` markers as appropriate

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs
📚 Learning: 2025-08-11T11:50:12.090Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:50:12.090Z
Learning: Applies to crates/biome_js_type_info/src/**/*.rs : Use TypeData::Unknown for unimplemented inference and TypeData::UnknownKeyword for the explicit TypeScript unknown keyword; treat them semantically the same but keep them distinct for measurement

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs
📚 Learning: 2025-08-11T11:50:12.090Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:50:12.090Z
Learning: Applies to crates/biome_js_type_info/src/**/*.rs : Represent links between types using TypeReference (not Arc) to avoid cross-module retention and recursive structures; store type data in linear vectors

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/**/src/{lint,assist}/**/*.rs : Recommended rules with domains are enabled only when users enable the matching domains; use `domains` metadata judiciously

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/**/src/{lint,assist}/**/*.rs : Follow rule naming conventions: use `no<Concept>` to forbid and `use<Concept>` to mandate; prefer consistent prefixes (e.g., `noDuplicate<Concept>`, `useConsistent<Concept>`)

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/**/src/**/nursery/**/*.rs : Place all new rules in the nursery group (implement rule files under a `.../src/*/nursery/` directory)

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs
📚 Learning: 2025-09-10T08:05:22.867Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-09-10T08:05:22.867Z
Learning: Applies to crates/biome_analyze/**/src/{lint,assist}/**/*.rs : When deprecating a rule, add `deprecated: "<reason>"` to `declare_lint_rule!`

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs
🧬 Code graph analysis (1)
crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs (1)
crates/biome_analyze/src/rule.rs (3)
  • recommended (554-557)
  • sources (569-572)
  • inspired (249-254)
⏰ 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). (26)
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: End-to-end tests
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Check Dependencies
  • GitHub Check: Documentation
  • GitHub Check: Check JS Files
  • GitHub Check: Bench (biome_configuration)
  • GitHub Check: Test Node.js API
  • GitHub Check: Bench (biome_json_analyze)
  • GitHub Check: Bench (biome_graphql_formatter)
  • GitHub Check: Bench (biome_json_formatter)
  • GitHub Check: Bench (biome_html_formatter)
  • GitHub Check: Bench (biome_module_graph)
  • GitHub Check: autofix
  • GitHub Check: Bench (biome_html_parser)
  • GitHub Check: Bench (biome_package)
  • GitHub Check: Bench (biome_json_parser)
  • GitHub Check: Bench (biome_graphql_parser)
  • GitHub Check: Bench (biome_css_parser)
  • GitHub Check: Bench (biome_css_analyze)
  • GitHub Check: Bench (biome_css_formatter)
  • GitHub Check: Bench (biome_js_formatter)
  • GitHub Check: Bench (biome_js_analyze)
  • GitHub Check: Bench (biome_js_parser)
🔇 Additional comments (1)
crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs (1)

8-15: Import TextRange from biome_rowan

Line 8 grabs TextRange from biome_deserialize, but that crate doesn’t export it—cargo will sulk at compile time. Bring it in from biome_rowan alongside the other rowan imports so the build stays happy.

-use biome_deserialize::TextRange;
-use biome_rowan::{AstNode, AstNodeList, BatchMutationExt};
+use biome_rowan::{AstNode, AstNodeList, BatchMutationExt, TextRange};

@hamirmahal hamirmahal force-pushed the feat/sort-interface-members branch from 3cbb585 to 4a2ab26 Compare October 11, 2025 16:58
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

♻️ Duplicate comments (1)
crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs (1)

7-7: Critical: Wrong crate for TextRange import.

TextRange should be imported from biome_rowan, not biome_deserialize. This will cause a compile error.

Apply this diff:

-use biome_deserialize::TextRange;
+use biome_rowan::TextRange;

Note: This was previously flagged and may have been addressed in a later commit not shown here.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3cbb585 and 4a2ab26.

⛔ Files ignored due to path filters (11)
  • crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs is excluded by !**/migrate/eslint_any_rule_to_biome.rs and included by **
  • crates/biome_configuration/src/analyzer/linter/rules.rs is excluded by !**/rules.rs and included by **
  • crates/biome_diagnostics_categories/src/categories.rs is excluded by !**/categories.rs and included by **
  • crates/biome_js_analyze/src/lint/nursery.rs is excluded by !**/nursery.rs and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/multiple_non_sortable.ts.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/sortable_after_non_sortable.ts.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/sorted.ts.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/unsorted.ts.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/with_comments.ts.snap is excluded by !**/*.snap and included by **
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts is excluded by !**/backend-jsonrpc/src/workspace.ts and included by **
  • packages/@biomejs/biome/configuration_schema.json is excluded by !**/configuration_schema.json and included by **
📒 Files selected for processing (13)
  • biome.json (1 hunks)
  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs (1 hunks)
  • crates/biome_js_analyze/src/options.rs (1 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/multiple_non_sortable.ts (1 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/sortable_after_non_sortable.ts (1 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/sorted.ts (1 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/unsorted.ts (1 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/with_comments.ts (1 hunks)
  • crates/biome_rule_options/src/lib.rs (1 hunks)
  • crates/biome_rule_options/src/use_sorted_interface_members.rs (1 hunks)
  • packages/@biomejs/backend-jsonrpc/src/transport.ts (3 hunks)
  • packages/@biomejs/js-api/src/wasm.ts (1 hunks)
  • scripts/version-check.ts (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
  • crates/biome_rule_options/src/use_sorted_interface_members.rs
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/unsorted.ts
  • biome.json
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/with_comments.ts
  • crates/biome_js_analyze/src/options.rs
🧰 Additional context used
📓 Path-based instructions (5)
crates/biome_*_{syntax,parser,formatter,analyze,factory,semantic}/**

📄 CodeRabbit inference engine (CLAUDE.md)

Maintain the per-language crate structure: biome_{lang}_{syntax,parser,formatter,analyze,factory,semantic}

Files:

  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/multiple_non_sortable.ts
  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/sorted.ts
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/sortable_after_non_sortable.ts
crates/biome_*/**

📄 CodeRabbit inference engine (CLAUDE.md)

Place core crates under /crates/biome_*/

Files:

  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/multiple_non_sortable.ts
  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/sorted.ts
  • crates/biome_rule_options/src/lib.rs
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/sortable_after_non_sortable.ts
**/tests/**

📄 CodeRabbit inference engine (CLAUDE.md)

Place test files under a tests/ directory in each crate

Files:

  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/multiple_non_sortable.ts
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/sorted.ts
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/sortable_after_non_sortable.ts
**/*.{rs,toml}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Before committing, format Rust and TOML files (e.g., via just f/just format)

Files:

  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs
  • crates/biome_rule_options/src/lib.rs
**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Document rules, assists, and options via inline rustdoc in Rust source

Files:

  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs
  • crates/biome_rule_options/src/lib.rs
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:57:33.228Z
Learning: Applies to crates/biome_analyze/crates/biome_js_analyze/lib/src/lint/nursery/*.rs : Place all new JavaScript lint rules in the nursery group under biome_js_analyze/lib/src/lint/nursery/<rule_name>.rs
📚 Learning: 2025-10-02T12:57:33.228Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:57:33.228Z
Learning: Applies to crates/biome_analyze/crates/biome_js_analyze/lib/src/lint/nursery/*.rs : Place all new JavaScript lint rules in the nursery group under biome_js_analyze/lib/src/lint/nursery/<rule_name>.rs

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs
📚 Learning: 2025-10-02T12:57:33.228Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:57:33.228Z
Learning: Applies to crates/biome_analyze/crates/**/src/**/lint/**/*.rs : If a rule returns a code action, add fix_kind in declare_lint_rule! and ensure action uses ctx.action_category(ctx.category(), ctx.group()) and ctx.metadata().applicability()

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs
🧬 Code graph analysis (2)
packages/@biomejs/js-api/src/wasm.ts (1)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (15)
  • Diagnostic (8818-8828)
  • Workspace (9828-9861)
  • Configuration (30-95)
  • CloseFileParams (9519-9522)
  • FixFileParams (9742-9755)
  • FixFileResult (9763-9780)
  • FormatFileParams (9709-9712)
  • FormatRangeParams (9732-9736)
  • GetFormatterIRParams (9575-9578)
  • OpenFileParams (9420-9431)
  • OpenProjectParams (9351-9360)
  • OpenProjectResult (9361-9366)
  • PullDiagnosticsParams (9621-9635)
  • PullDiagnosticsResult (9639-9643)
  • UpdateSettingsParams (22-26)
crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs (2)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (2)
  • FixKind (7941-7941)
  • TextRange (9288-9288)
crates/biome_js_factory/src/generated/node_factory.rs (1)
  • ts_type_member_list (7360-7371)
⏰ 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). (13)
  • GitHub Check: Test Node.js API
  • GitHub Check: Bench (biome_js_parser)
  • GitHub Check: Bench (biome_js_analyze)
  • GitHub Check: Bench (biome_js_formatter)
  • GitHub Check: autofix
  • GitHub Check: Bench (biome_configuration)
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Documentation
  • GitHub Check: Check Dependencies
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Check JS Files
  • GitHub Check: Lint project (depot-windows-2022)
🔇 Additional comments (18)
packages/@biomejs/js-api/src/wasm.ts (1)

87-117: LGTM! Alphabetical ordering applied correctly.

All three interfaces (DiagnosticPrinter, Workspace, and Module) now follow alphabetical member ordering, consistent with the new useSortedInterfaceMembers rule being introduced in this PR.

crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/sortable_after_non_sortable.ts (1)

1-7: LGTM!

The test fixture correctly exercises the sortable-after-non-sortable constraint. The interface design is spot-on for validating the rule's behaviour.

packages/@biomejs/backend-jsonrpc/src/transport.ts (4)

2-2: Verify this change belongs in this PR.

The addition of destroy(): void to the Socket interface appears unrelated to sorting interface members. Is this intended to be part of this PR?


15-15: Kind discriminants added for tagged unions.

Adding readonly kind fields establishes proper discriminated unions for ReaderState, which is good practice. However, this appears orthogonal to the UseSortedInterfaceMembers rule.

Are these changes intended for this PR or should they be in a separate PR?

Also applies to: 21-21


28-28: Verify jsonrpc version field belongs in this PR.

Explicit jsonrpc: "2.0" field added. This change appears unrelated to sorting interface members.


95-96: Method reordering demonstrates the lint rule in action.

The PendingRequest interface now has reject before resolve, which is alphabetically correct. If intentional, this nicely demonstrates the rule's behaviour. However, verify this reordering is intentional and won't break existing code that depends on member order (though TypeScript interfaces shouldn't be order-dependent at runtime).

crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/sorted.ts (1)

1-6: LGTM!

Clean test fixture for the already-sorted case. All members are sortable and correctly ordered alphabetically.

crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/multiple_non_sortable.ts (1)

1-11: LGTM!

Excellent test fixture exercising multiple non-sortable member types interleaved with sortable ones. This covers the complex scenario comprehensively.

crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs (7)

16-76: Rule declaration and documentation are clear.

The declare_lint_rule! macro is properly structured with comprehensive documentation explaining sortable vs non-sortable members and expected behaviour.


77-92: Detection logic delegates to helper.

The run method correctly uses is_interface_members_sorted with the ASCII natural comparator.


93-103: Diagnostic message is clear.

Simple, direct message about unsorted members.


105-119: Fix generation uses correct applicability.

The action method now correctly uses ctx.metadata().applicability() rather than hard-coded Applicability::Always. Well done addressing the previous review comment.


124-134: Member name extraction handles all sortable types.

The get_type_member_name function correctly identifies sortable members (property, method, getter, setter) and returns None for non-sortable members (call, construct, index signatures).


135-169: Detection correctly enforces sortable-first constraint.

The is_interface_members_sorted function now properly tracks whether a non-sortable member has been seen and returns false if any sortable member appears after a non-sortable one. This addresses the previous detection gap. The logic is sound:

  1. Maintains previous key for order checking
  2. Flags sortable-after-non-sortable as unsorted
  3. Checks alphabetical order among sortable members
  4. Marks non-sortable members seen

170-204: Sorting implementation separates and orders correctly.

The sort_interface_members function:

  1. Separates sortable from non-sortable members
  2. Sorts sortable members alphabetically
  3. Concatenates sorted sortable members first, then non-sortable in original order

This matches the documented behaviour perfectly.

crates/biome_rule_options/src/lib.rs (1)

347-347: Manual codegen verification required. The sandbox couldn’t run xtask codegen. Please run locally in crates/biome_rule_options:

cargo run --bin xtask codegen
git diff --exit-code src/lib.rs

and confirm src/use_sorted_interface_members.rs exists.

scripts/version-check.ts (2)

239-241: Field reordering looks fine.

The alphabetical ordering of interface members is consistent with the PR's goal to sort interface members.


336-337: Field reordering is appropriate.

The repositioning of these fields aligns with the interface member sorting objective.

Also applies to: 342-342, 348-348

@hamirmahal
Copy link
Contributor Author

@ematipico I fixed merge conflicts. Are there other changes you'd like me to make here?

@hamirmahal
Copy link
Contributor Author

@ematipico Are there any updates you want me to make here, other than fixing merge conflicts again?

Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would appreciate it if we could revert all the changes unrelated to the PR e.g. TypeScript files are the repository

@ematipico
Copy link
Member

Plus the changeset is missing. The bot says it, as well as the contribution guide that we link in the template. Please read it ☺️

@hamirmahal hamirmahal force-pushed the feat/sort-interface-members branch from 347ebc6 to 16c4aad Compare November 8, 2025 20:02
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs (1)

170-204: LGTM!

Clean sorting logic: separates sortable from non-sortable members, sorts the former, then places sortable members first followed by non-sortable members in their original order.

At lines 183-184, when name.name() returns None, consider adding a brief comment explaining this handles computed/dynamic property names (e.g., [Symbol.iterator] or ["computed"]) to improve readability.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4a2ab26 and 16c4aad.

⛔ Files ignored due to path filters (11)
  • crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs is excluded by !**/migrate/eslint_any_rule_to_biome.rs and included by **
  • crates/biome_configuration/src/analyzer/linter/rules.rs is excluded by !**/rules.rs and included by **
  • crates/biome_diagnostics_categories/src/categories.rs is excluded by !**/categories.rs and included by **
  • crates/biome_js_analyze/src/lint/nursery.rs is excluded by !**/nursery.rs and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/multiple_non_sortable.ts.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/sortable_after_non_sortable.ts.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/sorted.ts.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/unsorted.ts.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/with_comments.ts.snap is excluded by !**/*.snap and included by **
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts is excluded by !**/backend-jsonrpc/src/workspace.ts and included by **
  • packages/@biomejs/biome/configuration_schema.json is excluded by !**/configuration_schema.json and included by **
📒 Files selected for processing (9)
  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs (1 hunks)
  • crates/biome_js_analyze/src/options.rs (1 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/multiple_non_sortable.ts (1 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/sortable_after_non_sortable.ts (1 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/sorted.ts (1 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/unsorted.ts (1 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/with_comments.ts (1 hunks)
  • crates/biome_rule_options/src/lib.rs (1 hunks)
  • crates/biome_rule_options/src/use_sorted_interface_members.rs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/multiple_non_sortable.ts
  • crates/biome_rule_options/src/lib.rs
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/with_comments.ts
  • crates/biome_rule_options/src/use_sorted_interface_members.rs
  • crates/biome_js_analyze/src/options.rs
🧰 Additional context used
🧠 Learnings (9)
📚 Learning: 2025-10-15T09:23:33.055Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:23:33.055Z
Learning: Applies to crates/biome_js_type_info/src/type_info.rs : Add new TypeScript type support by extending the TypeData enum rather than introducing parallel structures.

Applied to files:

  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/sorted.ts
  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs
  • crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/unsorted.ts
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/**/*.rs : After generation, remove usages of `format_verbatim_node` and implement real formatting with biome_formatter utilities

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs
📚 Learning: 2025-10-15T09:22:46.002Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:46.002Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Do not attempt to fix code; if a mandatory token/node is missing, return `None` instead

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs
📚 Learning: 2025-10-15T09:23:33.055Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:23:33.055Z
Learning: Applies to crates/biome_js_type_info/src/{type_info,local_inference,resolver,flattening}.rs : Avoid recursive type structures and cross-module Arcs; represent links between types using TypeReference and TypeData::Reference.

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs
📚 Learning: 2025-10-15T09:22:46.002Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:46.002Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Import and use the `FormatNode` trait for AST nodes

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs
📚 Learning: 2025-10-15T09:23:33.055Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:23:33.055Z
Learning: Applies to crates/biome_js_type_info/biome_module_graph/src/**/*.rs : Do not copy or clone data between module graph entries (including behind Arc). Each module must avoid holding duplicated data from another module to enable simple invalidation.

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs
📚 Learning: 2025-10-15T09:23:33.055Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:23:33.055Z
Learning: Applies to crates/biome_js_type_info/biome_module_graph/src/js_module_info/scoped_resolver.rs : Full inference must resolve TypeReference::Import across modules to TypeReference::Resolved when the target is available in the module graph.

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs
📚 Learning: 2025-10-15T09:25:05.698Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:25:05.698Z
Learning: Applies to crates/biome_service/../biome_lsp/src/server.tests.rs : Keep end-to-end LSP tests in ../biome_lsp/src/server.tests.rs

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs
📚 Learning: 2025-10-15T09:23:33.055Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:23:33.055Z
Learning: Applies to crates/biome_js_type_info/biome_module_graph/src/js_module_info/collector.rs : Thin (module-level) inference should resolve local and global bindings to TypeReference::Resolved, mark imported bindings as TypeReference::Import, and fall back to TypeReference::Unknown if unresolved.

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs
🧬 Code graph analysis (1)
crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs (3)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (2)
  • FixKind (7941-7941)
  • TextRange (9288-9288)
crates/biome_analyze/src/rule.rs (1)
  • inspired (252-257)
crates/biome_js_factory/src/generated/node_factory.rs (1)
  • ts_type_member_list (7360-7371)
🔇 Additional comments (8)
crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/unsorted.ts (1)

1-5: LGTM!

Clean test fixture with intentionally unsorted properties to validate the lint rule behaviour.

crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/sortable_after_non_sortable.ts (1)

1-7: LGTM!

Excellent edge-case test fixture. The inline comments clearly document the expected diagnostic behaviour when sortable members follow non-sortable ones.

crates/biome_js_analyze/tests/specs/nursery/useSortedInterfaceMembers/sorted.ts (1)

1-6: LGTM!

Solid negative test case with properly sorted members covering different signature types.

crates/biome_js_analyze/src/lint/nursery/use_sorted_interface_members.rs (5)

16-76: LGTM!

Excellent documentation with clear explanations of sortable vs non-sortable members and helpful examples. Metadata is appropriate.


93-103: Consider range consistency.

The diagnostic highlights body.range() (line 99) which is just the member list, whilst text_range at line 121 returns ctx.query().range() which is the entire interface declaration. These should typically be consistent. Consider whether text_range should also return body.range() to match the diagnostic range.


124-134: LGTM!

Correctly identifies sortable members (property, method, getter, setter signatures) and returns None for non-sortable members (call, construct, index signatures).


135-169: LGTM!

Solid implementation. The function correctly enforces that all sortable members must appear before non-sortable members and be in sorted order.


7-7: No issues found; import is correct.

The TextRange import from biome_deserialize is accurate. biome_deserialize re-exports TextRange from biome_rowan, which in turn re-exports it from biome_text_size. The function's return type Option<TextRange> matches the Rule trait signature, and ctx.query().range() returns the same TextRange type. This is idiomatic Biome code.

renovate bot and others added 14 commits November 19, 2025 09:39
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
@ematipico ematipico force-pushed the feat/sort-interface-members branch from 6e77ea9 to 1eabb32 Compare November 19, 2025 09:45
@github-actions github-actions bot added A-Core Area: core A-Parser Area: parser A-Formatter Area: formatter A-Tooling Area: internal tools A-LSP Area: language server protocol L-CSS Language: CSS L-JSON Language: JSON and super languages L-HTML Language: HTML and super languages L-Grit Language: GritQL A-Type-Inference Area: type inference L-Tailwind Language: Tailwind CSS labels Nov 19, 2025
@ematipico
Copy link
Member

Hey @hamirmahal, apologies for the mess. I will have to close this PR and open a new one. Don't worry, I will cherry-pick your commits so the credits will still go to you.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

♻️ Duplicate comments (1)
.changeset/chilly-jokes-decide.md (1)

2-2: Version bump level should be patch, not minor.

Based on past review guidance that "nursery rules can land in patches", this entry should use patch instead of minor. Additionally, ensure @biomejs/backend-jsonrpc is not included in this changeset.

Apply this correction:

---
-"@biomejs/biome": minor
+"@biomejs/biome": patch
---
🧹 Nitpick comments (12)
crates/biome_configuration/src/analyzer/mod.rs (1)

649-657: Selector and SeverityOrGroup schemas are simple and sensible (one small nit only)

  • AnalyzerSelector and RuleSelector being modelled as plain strings is consistent with their serialisation and user‑facing syntax.
  • SeverityOrGroup<G> using an anyOf between GroupPlainConfiguration and G matches the untagged enum and keeps the generic name unique via SeverityOrGroup_for_*.

Only tiny nit: some impls in this file use schemars::generate::SchemaGenerator while others elsewhere use schemars::SchemaGenerator. It’s purely stylistic, but standardising on one form later would make grepping and refactors a bit easier.

If you do decide to normalise the SchemaGenerator path, please confirm against the schemars docs for the exact re‑export you want to standardise on.

Also applies to: 857-865, 974-996

crates/biome_aria_metadata/build.rs (1)

33-50: ISO_LANGUAGES / ISO_SCRIPTS data look fine but are duplicated

The updated language list and new script list are consistent with the pattern already used for countries. The only downside is that ISO_LANGUAGES and ISO_SCRIPTS are now duplicated between build.rs and src/lib.rs, which makes future updates a bit drift‑prone. If this keeps growing, it might be worth centralising these tables (e.g. a shared JSON or generated Rust module) so build and runtime code share a single source of truth.

crates/biome_aria_metadata/src/lib.rs (1)

23-40: Public ISO_LANGUAGES / ISO_SCRIPTS constants match build script

The public ISO_LANGUAGES and new ISO_SCRIPTS arrays line up with the values used in build.rs, which keeps validation and the scripts()/languages() helpers coherent. As with countries, this does mean the data live in two places now; if these lists change often, consider a single generated source that both build.rs and this module include to avoid drift, but the current change itself is sound.

crates/biome_cli/src/logging.rs (2)

86-126: Writer composition and span config look good; consider non‑panicking file handling

The new fmt_span selection and optional().or_else(std::io::stdout) make the CLI wiring clearer and nicely centralise the writer setup.

One thing to consider: File::create(...).transpose().expect("Failed to create log file") will panic on any I/O error. For a CLI, you might prefer logging a warning and falling back to stdout instead of aborting the process, especially when the log file path comes from user input or env.


364-441: Tests nicely exercise optional writer fallback; could extend to make_writer_for later

The MockWriter + optional_writer_or_else_test setup is a good, focused check that:

  • Some(...).optional().or_else(...) picks the primary writer.
  • None.optional().or_else(...) correctly falls back to the secondary writer.

If you ever touch this again, you might also want a quick assertion using make_writer_for(meta) to guard against regressions in the metadata‑aware path, but that’s strictly extra credit.

crates/biome_css_parser/src/parser.rs (1)

4-4: Neat From<CssFileSource> mapper; consider using the builder helpers

The mapping from CssFileSource to CssParserOptions is clear and keeps defaults sane. To centralise option toggling, you could lean on the existing helper methods instead of setting fields directly:

 impl From<&CssFileSource> for CssParserOptions {
     fn from(file_source: &CssFileSource) -> Self {
-        let mut options = Self::default();
-        if file_source.is_css_modules() {
-            options.css_modules = true;
-        }
-        if file_source.is_tailwind_css() {
-            options.tailwind_directives = true;
-        }
-
-        options
+        let mut options = Self::default();
+
+        if file_source.is_css_modules() {
+            options = options.allow_css_modules();
+        }
+
+        if file_source.is_tailwind_css() {
+            options = options.allow_tailwind_directives();
+        }
+
+        options
     }
 }

Purely stylistic, so feel free to ignore if you prefer the current direct field writes.

Also applies to: 174-186

crates/biome_css_parser/src/syntax/at_rule/mod.rs (1)

192-233: New at-rule declarator parsing looks good; please double‑check media’s end token and diagnostics

The split into parse_at_rule_declarator and parse_any_at_rule_declarator mirrors the existing rule parsing nicely, and the bogus branch ensures the wrapper node can always complete, which is great for recovery.

Two small things to sanity‑check:

  • parse_media_at_rule_declarator is called here with T![')'], whereas the full parse_media_at_rule path uses T!['{']. If this declarator entry is ever used for top‑level @media (or other contexts that still end at {), it would be good to confirm that ')' is the intended sentinel for all current call sites.
  • Since both the wrapper and the bogus branch use expected_any_at_rule, it might be worth ensuring the diagnostic’s expected‑names list in parse_error.rs stays in sync with the tokens you now handle here (e.g. newer at‑rules), so the error messages don’t lag behind future extensions.

Functionally this all looks solid; just worth that extra verification pass.

crates/biome_css_parser/src/syntax/at_rule/font_palette_values.rs (1)

29-59: Declarator split and recovery look solid

Pulling the @font-palette-values header into parse_font_palette_values_at_rule_declarator with {/line‑break recovery and a CSS_FONT_PALETTE_VALUES_AT_RULE_DECLARATOR child keeps the outer CSS_FONT_PALETTE_VALUES_AT_RULE intact and matches the other at‑rules nicely.

If you ever fancy a tiny polish, _ = parse_font_palette_values_at_rule_declarator(p); reads a touch clearer than .ok();, but it is purely cosmetic.

crates/biome_css_formatter/src/css/auxiliary/container_at_rule_declarator.rs (1)

5-27: Declarator formatting matches the expected @container header

Printing container + space, optional name + space, then the query is exactly what we want here, and the name.is_some() guard neatly avoids extra whitespace.

If you prefer more idiomatic Rust, you could write if let Some(name) = name { … }, but the current form is perfectly serviceable.

crates/biome_css_parser/src/syntax/at_rule/property.rs (1)

28-58: Sound declarator handling for @property with sensible recovery

The new parse_property_at_rule_declarator cleanly builds a CSS_PROPERTY_AT_RULE_DECLARATOR child and falls back to CSS_BOGUS using a {‑anchored, line‑break‑aware recovery set, while the outer node remains CSS_PROPERTY_AT_RULE as before.

As with the other helpers, _ = parse_property_at_rule_declarator(p); would make the “call and ignore result” intent a bit clearer than .ok();, but it is strictly optional.

crates/biome_css_parser/src/syntax/at_rule/position_try.rs (1)

29-59: Consistent declarator parsing for @position-try

This mirrors the other dashed‑identifier at‑rules nicely: a dedicated CSS_POSITION_TRY_AT_RULE_DECLARATOR node, {‑based recovery to CSS_BOGUS, and the outer CSS_POSITION_TRY_AT_RULE wrapper left unchanged.

Same tiny nit as elsewhere: _ = parse_position_try_at_rule_declarator(p); would slightly clarify that the result is intentionally ignored, but the current form is absolutely fine.

RELEASES.md (1)

9-11: Standardise "pre-release" vs "prerelease" terminology.

The document mixes both forms: the section header is "Prerelease" (line 9) but the body uses "pre-releases" (line 11). Pick one form consistently across the file.

Recommendation: use "prerelease" (single word) throughout for consistency with common npm terminology.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6e77ea9 and 1eabb32.

⛔ Files ignored due to path filters (104)
  • Cargo.lock is excluded by !**/*.lock and included by **
  • crates/biome_analyze/src/categories.rs is excluded by !**/categories.rs and included by **
  • crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs is excluded by !**/migrate/eslint_any_rule_to_biome.rs and included by **
  • crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/dont_indent_frontmatter.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/format_astro_with_typescript_script_tag.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/full_support.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_handle_vue_files/full_support_jsx.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_handle_vue_files/full_support_tsx.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_linter_domains/does_enable_test_rules.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_linter_domains/does_enable_test_rules_when_recommended_rules_are_disabled_but_domain_is_enabled.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_linter_domains/should_enable_domain_via_cli.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_reporter_gitlab/reports_diagnostics_gitlab_check_command.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_reporter_gitlab/reports_diagnostics_gitlab_ci_command.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_reporter_gitlab/reports_diagnostics_gitlab_format_command.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_rules_via_dependencies/enables_test_globals_via_dependencies.snap is excluded by !**/*.snap and included by **
  • crates/biome_configuration/src/analyzer/linter/rules.rs is excluded by !**/rules.rs and included by **
  • crates/biome_configuration/src/generated/domain_selector.rs is excluded by !**/generated/**, !**/generated/** and included by **
  • crates/biome_css_factory/src/generated/node_factory.rs is excluded by !**/generated/**, !**/generated/** and included by **
  • crates/biome_css_factory/src/generated/syntax_factory.rs is excluded by !**/generated/**, !**/generated/** and included by **
  • crates/biome_css_formatter/tests/specs/prettier/css/comments/at-rules.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_color_profile_error.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_container/at_rule_container_and_query_error.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_container/at_rule_container_error.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_container/at_rule_container_or_query_error.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_container/at_rule_container_style_not_query.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_container/at_rule_container_style_query_error.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_counter_style_error.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_font_face_error.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_font_palette_values_error.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_layer_error.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_media_error.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_property_error.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_scope_error.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_supports/at_rule_supports_and_condition_error.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_supports/at_rule_supports_invalid_after_support_error.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_supports/at_rule_supports_not_condition_error.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_supports/at_rule_supports_or_condition_error.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/error/at_rule/conditional_at_rule_error.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/error/property/unicode_range_error.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_color_profile.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_container.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_container_complex.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_counter_style.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_document.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_font_face.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_font_palette_values.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_layer.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_media.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_media_complex.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_page_complex.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_position_try.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_property.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_scope.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_starting_style.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_supports.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_supports_complex.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/at_rule/at_rule_view_transition.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/grit_metavariable/metavar.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/nesting/conditional_at_rule.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/nesting/nesting.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/property/unicode_range.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/tailwind/custom-variants/dark.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/tailwind/custom-variants/shorthand-at-rules-simple.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/tailwind/custom-variants/shorthand-at-rules.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/tailwind/custom-variants/shorthand-media.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/tailwind/custom-variants/shorthand-multiple-selectors.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/tailwind/custom-variants/shorthand.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/tailwind/shadcn-default.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_syntax/src/generated/kind.rs is excluded by !**/generated/**, !**/generated/** and included by **
  • crates/biome_css_syntax/src/generated/macros.rs is excluded by !**/generated/**, !**/generated/** and included by **
  • crates/biome_css_syntax/src/generated/nodes.rs is excluded by !**/generated/**, !**/generated/** and included by **
  • crates/biome_css_syntax/src/generated/nodes_mut.rs is excluded by !**/generated/**, !**/generated/** and included by **
  • crates/biome_diagnostics_categories/src/categories.rs is excluded by !**/categories.rs and included by **
  • crates/biome_graphql_analyze/src/lint/nursery.rs is excluded by !**/nursery.rs and included by **
  • crates/biome_graphql_analyze/tests/specs/nursery/useConsistentGraphqlDescriptions/block/invalid.graphql.snap is excluded by !**/*.snap and included by **
  • crates/biome_graphql_analyze/tests/specs/nursery/useConsistentGraphqlDescriptions/block/valid.graphql.snap is excluded by !**/*.snap and included by **
  • crates/biome_graphql_analyze/tests/specs/nursery/useConsistentGraphqlDescriptions/inline/invalid.graphql.snap is excluded by !**/*.snap and included by **
  • crates/biome_graphql_analyze/tests/specs/nursery/useConsistentGraphqlDescriptions/inline/valid.graphql.snap is excluded by !**/*.snap and included by **
  • crates/biome_graphql_analyze/tests/specs/nursery/useUniqueGraphqlOperationName/invalid.graphql.snap is excluded by !**/*.snap and included by **
  • crates/biome_graphql_analyze/tests/specs/nursery/useUniqueGraphqlOperationName/valid.graphql.snap is excluded by !**/*.snap and included by **
  • crates/biome_graphql_syntax/src/generated/nodes.rs is excluded by !**/generated/**, !**/generated/** and included by **
  • crates/biome_grit_syntax/src/generated/nodes.rs is excluded by !**/generated/**, !**/generated/** and included by **
  • crates/biome_html_analyze/src/lint/nursery.rs is excluded by !**/nursery.rs and included by **
  • crates/biome_html_analyze/tests/specs/nursery/noSyncScripts/invalid.html.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_analyze/tests/specs/nursery/noSyncScripts/valid.html.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_analyze/tests/specs/nursery/noVueVIfWithVFor/invalid.vue.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_analyze/tests/specs/nursery/noVueVIfWithVFor/valid.vue.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_analyze/tests/specs/nursery/useVueHyphenatedAttributes/ignore/valid-ignored.vue.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_analyze/tests/specs/nursery/useVueHyphenatedAttributes/invalid.vue.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_analyze/tests/specs/nursery/useVueHyphenatedAttributes/valid.vue.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_analyze/tests/specs/nursery/useVueValidVBind/invalid.vue.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_analyze/tests/specs/nursery/useVueValidVBind/valid.vue.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_analyze/tests/specs/nursery/useVueValidVElse/invalid.vue.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_analyze/tests/specs/nursery/useVueValidVElse/valid.vue.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_analyze/tests/specs/nursery/useVueValidVElseIf/invalid.html.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_analyze/tests/specs/nursery/useVueValidVElseIf/invalid.vue.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_analyze/tests/specs/nursery/useVueValidVElseIf/valid.html.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_analyze/tests/specs/nursery/useVueValidVElseIf/valid.vue.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_analyze/tests/specs/nursery/useVueValidVHtml/invalid.vue.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_analyze/tests/specs/nursery/useVueValidVHtml/valid.vue.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_analyze/tests/specs/nursery/useVueValidVIf/invalid.vue.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_analyze/tests/specs/nursery/useVueValidVIf/valid.vue.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_analyze/tests/specs/nursery/useVueValidVOn/invalid.vue.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_analyze/tests/specs/nursery/useVueValidVOn/valid.vue.snap is excluded by !**/*.snap and included by **
📒 Files selected for processing (91)
  • .changeset/bright-tires-report.md (1 hunks)
  • .changeset/chilly-jokes-decide.md (1 hunks)
  • .changeset/lemon-planes-knock.md (0 hunks)
  • .changeset/mighty-bats-grow.md (0 hunks)
  • .changeset/nine-bottles-float.md (0 hunks)
  • .changeset/ten-ears-stand.md (0 hunks)
  • .changeset/yellow-crews-guess.md (0 hunks)
  • .coderabbit.yaml (1 hunks)
  • .github/workflows/benchmark_css.yml (2 hunks)
  • .github/workflows/benchmark_graphql.yml (2 hunks)
  • .github/workflows/benchmark_js.yml (2 hunks)
  • .github/workflows/benchmark_json.yml (2 hunks)
  • .github/workflows/benchmark_tailwind.yml (1 hunks)
  • .github/workflows/beta.yml (4 hunks)
  • .github/workflows/beta_js_api.yml (2 hunks)
  • .github/workflows/close-issue.yml (1 hunks)
  • .github/workflows/needs-repro.yml (2 hunks)
  • .github/workflows/preview.yml (3 hunks)
  • .github/workflows/pull_request_markdown.yml (1 hunks)
  • .github/workflows/pull_request_node.yml (1 hunks)
  • .github/workflows/release.yml (9 hunks)
  • .github/workflows/release_cli.yml (3 hunks)
  • .github/workflows/release_js_api.yml (2 hunks)
  • .github/workflows/repository_dispatch.yml (1 hunks)
  • Cargo.toml (6 hunks)
  • Dockerfile.benchmark (1 hunks)
  • RELEASES.md (3 hunks)
  • ROME_CHANGELOG.md (11 hunks)
  • benchmark/package.json (1 hunks)
  • crates/biome_analyze/src/rule.rs (5 hunks)
  • crates/biome_aria_metadata/build.rs (2 hunks)
  • crates/biome_aria_metadata/src/lib.rs (3 hunks)
  • crates/biome_cli/Cargo.toml (1 hunks)
  • crates/biome_cli/src/logging.rs (3 hunks)
  • crates/biome_cli/src/reporter/gitlab.rs (2 hunks)
  • crates/biome_cli/tests/cases/handle_astro_files.rs (2 hunks)
  • crates/biome_cli/tests/cases/handle_vue_files.rs (1 hunks)
  • crates/biome_configuration/src/analyzer/assist/actions.rs (9 hunks)
  • crates/biome_configuration/src/analyzer/linter/mod.rs (1 hunks)
  • crates/biome_configuration/src/analyzer/mod.rs (9 hunks)
  • crates/biome_configuration/src/bool.rs (1 hunks)
  • crates/biome_configuration/src/extends.rs (1 hunks)
  • crates/biome_configuration/src/lib.rs (1 hunks)
  • crates/biome_configuration/src/overrides.rs (1 hunks)
  • crates/biome_console/Cargo.toml (1 hunks)
  • crates/biome_css_formatter/src/css/any/at_rule_declarator.rs (1 hunks)
  • crates/biome_css_formatter/src/css/any/mod.rs (1 hunks)
  • crates/biome_css_formatter/src/css/auxiliary/at_rule_declarator.rs (1 hunks)
  • crates/biome_css_formatter/src/css/auxiliary/color_profile_at_rule_declarator.rs (1 hunks)
  • crates/biome_css_formatter/src/css/auxiliary/container_at_rule_declarator.rs (1 hunks)
  • crates/biome_css_formatter/src/css/auxiliary/counter_style_at_rule_declarator.rs (1 hunks)
  • crates/biome_css_formatter/src/css/auxiliary/font_face_at_rule_declarator.rs (1 hunks)
  • crates/biome_css_formatter/src/css/auxiliary/font_palette_values_at_rule_declarator.rs (1 hunks)
  • crates/biome_css_formatter/src/css/auxiliary/media_at_rule_declarator.rs (1 hunks)
  • crates/biome_css_formatter/src/css/auxiliary/mod.rs (7 hunks)
  • crates/biome_css_formatter/src/css/auxiliary/position_try_at_rule_declarator.rs (1 hunks)
  • crates/biome_css_formatter/src/css/auxiliary/property_at_rule_declarator.rs (1 hunks)
  • crates/biome_css_formatter/src/css/auxiliary/scope_at_rule_declarator.rs (1 hunks)
  • crates/biome_css_formatter/src/css/auxiliary/starting_style_at_rule_declarator.rs (1 hunks)
  • crates/biome_css_formatter/src/css/auxiliary/supports_at_rule_declarator.rs (1 hunks)
  • crates/biome_css_formatter/src/css/auxiliary/view_transition_at_rule_declarator.rs (1 hunks)
  • crates/biome_css_formatter/src/css/statements/color_profile_at_rule.rs (1 hunks)
  • crates/biome_css_formatter/src/css/statements/container_at_rule.rs (1 hunks)
  • crates/biome_css_formatter/src/css/statements/counter_style_at_rule.rs (1 hunks)
  • crates/biome_css_formatter/src/css/statements/font_face_at_rule.rs (1 hunks)
  • crates/biome_css_formatter/src/css/statements/font_palette_values_at_rule.rs (1 hunks)
  • crates/biome_css_formatter/src/css/statements/media_at_rule.rs (1 hunks)
  • crates/biome_css_formatter/src/css/statements/position_try_at_rule.rs (1 hunks)
  • crates/biome_css_formatter/src/css/statements/property_at_rule.rs (1 hunks)
  • crates/biome_css_formatter/src/css/statements/scope_at_rule.rs (1 hunks)
  • crates/biome_css_formatter/src/css/statements/starting_style_at_rule.rs (1 hunks)
  • crates/biome_css_formatter/src/css/statements/supports_at_rule.rs (1 hunks)
  • crates/biome_css_formatter/src/css/statements/view_transition_at_rule.rs (1 hunks)
  • crates/biome_css_formatter/src/generated.rs (15 hunks)
  • crates/biome_css_formatter/src/tailwind/any/custom_variant_shorthand.rs (1 hunks)
  • crates/biome_css_formatter/src/tailwind/any/mod.rs (1 hunks)
  • crates/biome_css_parser/src/parser.rs (2 hunks)
  • crates/biome_css_parser/src/syntax/at_rule/color_profile.rs (2 hunks)
  • crates/biome_css_parser/src/syntax/at_rule/container/mod.rs (2 hunks)
  • crates/biome_css_parser/src/syntax/at_rule/counter_style.rs (2 hunks)
  • crates/biome_css_parser/src/syntax/at_rule/font_face.rs (1 hunks)
  • crates/biome_css_parser/src/syntax/at_rule/font_palette_values.rs (2 hunks)
  • crates/biome_css_parser/src/syntax/at_rule/media.rs (1 hunks)
  • crates/biome_css_parser/src/syntax/at_rule/mod.rs (2 hunks)
  • crates/biome_css_parser/src/syntax/at_rule/position_try.rs (2 hunks)
  • crates/biome_css_parser/src/syntax/at_rule/property.rs (2 hunks)
  • crates/biome_css_parser/src/syntax/at_rule/scope.rs (1 hunks)
  • crates/biome_css_parser/src/syntax/at_rule/starting_style.rs (1 hunks)
  • crates/biome_css_parser/src/syntax/at_rule/supports/mod.rs (2 hunks)
  • crates/biome_css_parser/src/syntax/at_rule/tailwind.rs (2 hunks)
  • crates/biome_css_parser/src/syntax/at_rule/view_transition.rs (1 hunks)
💤 Files with no reviewable changes (5)
  • .changeset/ten-ears-stand.md
  • .changeset/yellow-crews-guess.md
  • .changeset/lemon-planes-knock.md
  • .changeset/mighty-bats-grow.md
  • .changeset/nine-bottles-float.md
✅ Files skipped from review due to trivial changes (2)
  • benchmark/package.json
  • .github/workflows/repository_dispatch.yml
🧰 Additional context used
🧠 Learnings (5)
📚 Learning: 2025-08-20T16:24:59.781Z
Learnt from: arendjr
Repo: biomejs/biome PR: 7266
File: crates/biome_js_type_info/src/type.rs:94-102
Timestamp: 2025-08-20T16:24:59.781Z
Learning: In crates/biome_js_type_info/src/type.rs, the flattened_union_variants() method returns TypeReference instances that already have the correct module IDs applied to them. These references should be used directly with resolver.resolve_reference() without applying additional module ID transformations, as variant references may originate from nested unions in different modules.

Applied to files:

  • crates/biome_css_formatter/src/tailwind/any/mod.rs
📚 Learning: 2025-08-05T14:43:29.581Z
Learnt from: dyc3
Repo: biomejs/biome PR: 7081
File: packages/@biomejs/biome/configuration_schema.json:7765-7781
Timestamp: 2025-08-05T14:43:29.581Z
Learning: The file `packages/biomejs/biome/configuration_schema.json` is auto-generated and should not be manually edited or reviewed for schema issues; any changes should be made at the code generation source.

Applied to files:

  • .changeset/chilly-jokes-decide.md
  • crates/biome_configuration/src/overrides.rs
📚 Learning: 2025-09-23T21:33:00.843Z
Learnt from: arendjr
Repo: biomejs/biome PR: 7571
File: crates/biome_service/src/file_handlers/html.rs:360-368
Timestamp: 2025-09-23T21:33:00.843Z
Learning: Don't flag potential move/borrow issues in Rust code reviews since the Rust compiler catches these at compile time. Focus on logic, design, and issues that the toolchain doesn't automatically detect.

Applied to files:

  • Cargo.toml
📚 Learning: 2025-11-09T12:47:46.298Z
Learnt from: ematipico
Repo: biomejs/biome PR: 8031
File: crates/biome_html_parser/src/syntax/svelte.rs:140-147
Timestamp: 2025-11-09T12:47:46.298Z
Learning: In the Biome HTML parser, `expect` and `expect_with_context` consume the current token and then lex the next token. The context parameter in `expect_with_context` controls how the next token (after the consumed one) is lexed, not the current token being consumed. For example, in Svelte parsing, after `bump_with_context(T!["{:"], HtmlLexContext::Svelte)`, the next token is already lexed in the Svelte context, so `expect(T![else])` is sufficient unless the token after `else` also needs to be lexed in a specific context.

Applied to files:

  • crates/biome_css_parser/src/parser.rs
📚 Learning: 2025-10-25T07:22:18.540Z
Learnt from: ematipico
Repo: biomejs/biome PR: 7852
File: crates/biome_css_parser/src/syntax/property/mod.rs:161-168
Timestamp: 2025-10-25T07:22:18.540Z
Learning: In the Biome CSS parser, lexer token emission should not be gated behind parser options like `is_tailwind_directives_enabled()`. The lexer must emit correct tokens regardless of parser options to enable accurate diagnostics and error messages when the syntax is used incorrectly.

Applied to files:

  • crates/biome_css_parser/src/parser.rs
🧬 Code graph analysis (40)
crates/biome_css_formatter/src/tailwind/any/mod.rs (1)
crates/biome_css_formatter/src/tailwind/auxiliary/mod.rs (1)
  • custom_variant_shorthand (3-3)
crates/biome_css_formatter/src/css/statements/counter_style_at_rule.rs (1)
crates/biome_formatter/src/builders.rs (1)
  • space (606-608)
crates/biome_cli/src/reporter/gitlab.rs (2)
crates/biome_analyze/src/rule.rs (1)
  • span (1477-1479)
crates/biome_configuration/src/diagnostics.rs (1)
  • location (377-379)
crates/biome_css_formatter/src/css/statements/position_try_at_rule.rs (1)
crates/biome_formatter/src/builders.rs (1)
  • space (606-608)
crates/biome_css_formatter/src/css/statements/property_at_rule.rs (1)
crates/biome_formatter/src/builders.rs (1)
  • space (606-608)
crates/biome_configuration/src/extends.rs (3)
crates/biome_configuration/src/analyzer/linter/mod.rs (4)
  • schema_name (67-69)
  • json_schema (71-83)
  • generator (72-72)
  • generator (73-73)
crates/biome_service/src/workspace.rs (6)
  • schema_name (425-427)
  • schema_name (672-674)
  • json_schema (429-443)
  • json_schema (676-678)
  • generator (431-431)
  • generator (432-432)
crates/biome_configuration/src/bool.rs (2)
  • schema_name (105-107)
  • json_schema (109-111)
crates/biome_css_formatter/src/css/auxiliary/font_palette_values_at_rule_declarator.rs (1)
crates/biome_formatter/src/builders.rs (1)
  • space (606-608)
crates/biome_css_parser/src/syntax/at_rule/tailwind.rs (3)
crates/biome_css_parser/src/syntax/at_rule/mod.rs (1)
  • parse_at_rule_declarator (193-204)
crates/biome_css_parser/src/syntax/parse_error.rs (3)
  • expected_identifier (9-11)
  • expected_string (50-52)
  • expected_tw_source (243-245)
crates/biome_css_parser/src/syntax/mod.rs (1)
  • parse_regular_identifier (433-435)
crates/biome_css_formatter/src/css/auxiliary/counter_style_at_rule_declarator.rs (1)
crates/biome_formatter/src/builders.rs (1)
  • space (606-608)
crates/biome_css_formatter/src/css/auxiliary/property_at_rule_declarator.rs (1)
crates/biome_formatter/src/builders.rs (1)
  • space (606-608)
crates/biome_css_formatter/src/css/auxiliary/supports_at_rule_declarator.rs (1)
crates/biome_formatter/src/builders.rs (1)
  • space (606-608)
crates/biome_css_formatter/src/css/auxiliary/media_at_rule_declarator.rs (1)
crates/biome_formatter/src/builders.rs (1)
  • space (606-608)
crates/biome_css_formatter/src/css/statements/font_face_at_rule.rs (1)
crates/biome_formatter/src/builders.rs (1)
  • space (606-608)
crates/biome_css_formatter/src/css/statements/view_transition_at_rule.rs (1)
crates/biome_formatter/src/builders.rs (1)
  • space (606-608)
crates/biome_css_formatter/src/css/auxiliary/container_at_rule_declarator.rs (1)
crates/biome_formatter/src/builders.rs (1)
  • space (606-608)
crates/biome_css_formatter/src/css/auxiliary/color_profile_at_rule_declarator.rs (1)
crates/biome_formatter/src/builders.rs (1)
  • space (606-608)
crates/biome_css_formatter/src/css/statements/font_palette_values_at_rule.rs (1)
crates/biome_formatter/src/builders.rs (1)
  • space (606-608)
crates/biome_configuration/src/lib.rs (5)
crates/biome_configuration/src/analyzer/linter/mod.rs (3)
  • schema_name (67-69)
  • json_schema (71-83)
  • generator (72-72)
crates/biome_configuration/src/analyzer/mod.rs (33)
  • schema_name (106-108)
  • schema_name (212-214)
  • schema_name (373-375)
  • schema_name (448-450)
  • schema_name (491-493)
  • schema_name (541-543)
  • schema_name (651-653)
  • schema_name (859-861)
  • schema_name (979-981)
  • json_schema (110-122)
  • json_schema (216-228)
  • json_schema (377-387)
  • json_schema (452-464)
  • json_schema (495-510)
  • json_schema (545-562)
  • json_schema (654-656)
  • json_schema (862-864)
  • json_schema (983-995)
  • generator (112-112)
  • generator (113-113)
  • generator (218-218)
  • generator (219-219)
  • generator (378-378)
  • generator (379-379)
  • generator (453-453)
  • generator (454-454)
  • generator (497-497)
  • generator (498-498)
  • generator (547-547)
  • generator (548-548)
  • generator (549-549)
  • generator (985-985)
  • generator (986-986)
crates/biome_configuration/src/overrides.rs (2)
  • schema_name (104-106)
  • json_schema (107-109)
crates/biome_fs/src/path.rs (2)
  • schema_name (246-248)
  • json_schema (250-252)
crates/biome_glob/src/lib.rs (2)
  • schema_name (382-384)
  • json_schema (386-388)
crates/biome_configuration/src/analyzer/linter/mod.rs (1)
crates/biome_service/src/workspace.rs (6)
  • schema_name (425-427)
  • schema_name (672-674)
  • json_schema (429-443)
  • json_schema (676-678)
  • generator (431-431)
  • generator (432-432)
crates/biome_css_parser/src/syntax/at_rule/font_palette_values.rs (1)
crates/biome_css_parser/src/syntax/mod.rs (1)
  • parse_dashed_identifier (507-515)
crates/biome_css_formatter/src/css/statements/container_at_rule.rs (1)
crates/biome_formatter/src/builders.rs (1)
  • space (606-608)
crates/biome_configuration/src/overrides.rs (3)
crates/biome_configuration/src/analyzer/linter/mod.rs (4)
  • schema_name (67-69)
  • json_schema (71-83)
  • generator (72-72)
  • generator (73-73)
crates/biome_service/src/workspace.rs (6)
  • schema_name (425-427)
  • schema_name (672-674)
  • json_schema (429-443)
  • json_schema (676-678)
  • generator (431-431)
  • generator (432-432)
crates/biome_configuration/src/analyzer/mod.rs (30)
  • schema_name (106-108)
  • schema_name (212-214)
  • schema_name (373-375)
  • schema_name (448-450)
  • schema_name (491-493)
  • schema_name (541-543)
  • schema_name (651-653)
  • schema_name (859-861)
  • schema_name (979-981)
  • json_schema (110-122)
  • json_schema (216-228)
  • json_schema (377-387)
  • json_schema (452-464)
  • json_schema (495-510)
  • json_schema (545-562)
  • json_schema (654-656)
  • json_schema (862-864)
  • json_schema (983-995)
  • generator (112-112)
  • generator (113-113)
  • generator (218-218)
  • generator (219-219)
  • generator (378-378)
  • generator (379-379)
  • generator (453-453)
  • generator (454-454)
  • generator (497-497)
  • generator (498-498)
  • generator (547-547)
  • generator (548-548)
crates/biome_css_formatter/src/css/auxiliary/position_try_at_rule_declarator.rs (1)
crates/biome_formatter/src/builders.rs (1)
  • space (606-608)
crates/biome_css_parser/src/syntax/at_rule/counter_style.rs (1)
crates/biome_css_parser/src/syntax/mod.rs (1)
  • parse_custom_identifier (471-473)
crates/biome_css_formatter/src/css/statements/supports_at_rule.rs (1)
crates/biome_formatter/src/builders.rs (1)
  • space (606-608)
crates/biome_css_parser/src/syntax/at_rule/property.rs (1)
crates/biome_css_parser/src/syntax/mod.rs (1)
  • parse_dashed_identifier (507-515)
crates/biome_css_formatter/src/css/auxiliary/scope_at_rule_declarator.rs (1)
crates/biome_formatter/src/builders.rs (1)
  • space (606-608)
crates/biome_css_parser/src/syntax/at_rule/mod.rs (13)
crates/biome_css_parser/src/syntax/at_rule/color_profile.rs (2)
  • parse_color_profile_at_rule (19-30)
  • parse_color_profile_at_rule_declarator (33-59)
crates/biome_css_parser/src/syntax/at_rule/container/mod.rs (2)
  • parse_container_at_rule (68-79)
  • parse_container_at_rule_declarator (82-108)
crates/biome_css_parser/src/syntax/at_rule/counter_style.rs (2)
  • parse_counter_style_at_rule (19-30)
  • parse_counter_style_at_rule_declarator (33-56)
crates/biome_css_parser/src/syntax/at_rule/font_face.rs (2)
  • parse_font_face_at_rule (15-26)
  • parse_font_face_at_rule_declarator (29-38)
crates/biome_css_parser/src/syntax/at_rule/font_palette_values.rs (2)
  • parse_font_palette_values_at_rule (22-33)
  • parse_font_palette_values_at_rule_declarator (36-59)
crates/biome_css_parser/src/syntax/at_rule/media.rs (2)
  • parse_media_at_rule (23-34)
  • parse_media_at_rule_declarator (37-51)
crates/biome_css_parser/src/syntax/at_rule/position_try.rs (2)
  • parse_position_try_at_rule (22-33)
  • parse_position_try_at_rule_declarator (36-59)
crates/biome_css_parser/src/syntax/at_rule/property.rs (2)
  • parse_property_at_rule (21-32)
  • parse_property_at_rule_declarator (35-58)
crates/biome_css_parser/src/syntax/at_rule/scope.rs (2)
  • parse_scope_at_rule (19-30)
  • parse_scope_at_rule_declarator (33-45)
crates/biome_css_parser/src/syntax/at_rule/starting_style.rs (2)
  • parse_starting_style_at_rule (43-54)
  • parse_starting_style_at_rule_declarator (57-66)
crates/biome_css_parser/src/syntax/at_rule/supports/mod.rs (2)
  • parse_supports_at_rule (61-72)
  • parse_supports_at_rule_declarator (75-92)
crates/biome_css_parser/src/syntax/at_rule/view_transition.rs (2)
  • parse_view_transition_at_rule (16-27)
  • parse_view_transition_at_rule_declarator (30-39)
crates/biome_css_parser/src/syntax/parse_error.rs (1)
  • expected_any_at_rule (185-210)
crates/biome_css_formatter/src/css/statements/color_profile_at_rule.rs (1)
crates/biome_formatter/src/builders.rs (1)
  • space (606-608)
crates/biome_configuration/src/bool.rs (5)
crates/biome_configuration/src/analyzer/linter/mod.rs (4)
  • schema_name (67-69)
  • json_schema (71-83)
  • generator (72-72)
  • generator (73-73)
crates/biome_service/src/workspace.rs (6)
  • schema_name (425-427)
  • schema_name (672-674)
  • json_schema (429-443)
  • json_schema (676-678)
  • generator (431-431)
  • generator (432-432)
crates/biome_configuration/src/analyzer/mod.rs (30)
  • schema_name (106-108)
  • schema_name (212-214)
  • schema_name (373-375)
  • schema_name (448-450)
  • schema_name (491-493)
  • schema_name (541-543)
  • schema_name (651-653)
  • schema_name (859-861)
  • schema_name (979-981)
  • json_schema (110-122)
  • json_schema (216-228)
  • json_schema (377-387)
  • json_schema (452-464)
  • json_schema (495-510)
  • json_schema (545-562)
  • json_schema (654-656)
  • json_schema (862-864)
  • json_schema (983-995)
  • generator (112-112)
  • generator (113-113)
  • generator (218-218)
  • generator (219-219)
  • generator (378-378)
  • generator (379-379)
  • generator (453-453)
  • generator (454-454)
  • generator (497-497)
  • generator (498-498)
  • generator (547-547)
  • generator (548-548)
crates/biome_configuration/src/extends.rs (2)
  • schema_name (65-67)
  • json_schema (69-78)
crates/biome_configuration/src/lib.rs (2)
  • schema_name (430-432)
  • json_schema (434-436)
crates/biome_css_formatter/src/css/statements/scope_at_rule.rs (1)
crates/biome_formatter/src/builders.rs (1)
  • space (606-608)
crates/biome_configuration/src/analyzer/mod.rs (3)
crates/biome_configuration/src/analyzer/linter/mod.rs (4)
  • schema_name (67-69)
  • json_schema (71-83)
  • generator (72-72)
  • generator (73-73)
crates/biome_service/src/workspace.rs (6)
  • schema_name (425-427)
  • schema_name (672-674)
  • json_schema (429-443)
  • json_schema (676-678)
  • generator (431-431)
  • generator (432-432)
crates/biome_configuration/src/bool.rs (2)
  • schema_name (105-107)
  • json_schema (109-111)
crates/biome_cli/tests/cases/handle_astro_files.rs (2)
crates/biome_service/src/file_handlers/html.rs (4)
  • from (62-66)
  • from (85-98)
  • from (108-112)
  • from (122-126)
crates/biome_cli/tests/snap_test.rs (1)
  • assert_cli_snapshot (408-410)
crates/biome_css_parser/src/syntax/at_rule/color_profile.rs (1)
crates/biome_css_parser/src/syntax/mod.rs (1)
  • parse_custom_identifier (471-473)
crates/biome_css_formatter/src/css/statements/starting_style_at_rule.rs (1)
crates/biome_formatter/src/builders.rs (1)
  • space (606-608)
crates/biome_css_formatter/src/css/statements/media_at_rule.rs (1)
crates/biome_formatter/src/builders.rs (1)
  • space (606-608)
crates/biome_cli/tests/cases/handle_vue_files.rs (1)
crates/biome_formatter_test/src/spec.rs (1)
  • test (240-315)
crates/biome_analyze/src/rule.rs (1)
crates/biome_analyze/src/matcher.rs (1)
  • rule_name (121-123)
crates/biome_css_parser/src/syntax/at_rule/position_try.rs (1)
crates/biome_css_parser/src/syntax/mod.rs (1)
  • parse_dashed_identifier (507-515)
crates/biome_css_formatter/src/generated.rs (1)
crates/biome_css_formatter/src/css/any/at_rule.rs (1)
  • fmt (9-46)
🪛 actionlint (1.7.8)
.github/workflows/benchmark_tailwind.yml

36-36: label "depot-ubuntu-24.04-arm-16" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2025", "windows-2022", "windows-11-arm", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-24.04-arm", "ubuntu-22.04", "ubuntu-22.04-arm", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-26-xlarge", "macos-26", "macos-15-intel", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file

(runner-label)

🪛 LanguageTool
RELEASES.md

[style] ~5-~5: To make your writing clearer, consider a shorter, more direct phrase.
Context: ...olunteers is counterproductive, and can have negative effects on people. ## npm packages ### Prerele...

(ADVERSE_EFFECT_ON)


[uncategorized] ~11-~11: Do not mix variants of the same word (‘pre-release’ and ‘prerelease’) within a single text.
Context: ...mpackages ### Prerelease We publish pre-releases of the main@biomejs/biome` package tw...

(EN_WORD_COHERENCY)

ROME_CHANGELOG.md

[style] ~93-~93: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ckto control the formatter via CLI. - Add the argument--linter-enabled` to the ...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~94-~94: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...checkto control the linter via CLI. - Add the argument--organize-imports-enable...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~95-~95: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...o control the import sorting via CLI. - Add a new command rome migrate the transf...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~244-~244: As a shorter alternative for ‘able to’, consider using “can”.
Context: ...sing rome check --apply-unsafe - Rome is able to auto discover the configuration file. I...

(BE_ABLE_TO)


[uncategorized] ~244-~244: It appears that a hyphen is missing (if ‘auto’ is not used in the context of ‘cars’).
Context: ...check --apply-unsafe` - Rome is able to auto discover the configuration file. If Rome doesn't...

(AUTO_HYPHEN)

⏰ 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). (22)
  • GitHub Check: Bench (biome_js_analyze)
  • GitHub Check: Bench (biome_js_formatter)
  • GitHub Check: Bench (biome_js_parser)
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Documentation
  • GitHub Check: Check Dependencies
  • GitHub Check: Bench (biome_css_formatter)
  • GitHub Check: Bench (biome_css_analyze)
  • GitHub Check: Bench (biome_css_parser)
  • GitHub Check: Bench (biome_module_graph)
  • GitHub Check: Bench (biome_graphql_parser)
  • GitHub Check: Bench (biome_json_parser)
  • GitHub Check: Bench (biome_configuration)
  • GitHub Check: Bench (biome_json_analyze)
  • GitHub Check: Bench (biome_graphql_formatter)
  • GitHub Check: Bench (biome_json_formatter)
  • GitHub Check: Bench (biome_package)
  • GitHub Check: autofix
  • GitHub Check: Bench (biome_tailwind_parser)

Comment on lines +5 to +7
Added a new assist action `useSortedInterfaceMembers` that sorts TypeScript interface members, for readability.

It includes an autofix.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

Improve changeset description for end-user clarity.

The current description is vague. Per past feedback, add the rule/assist name and brief explanation so end users understand what changed. Include a code example showing the behaviour.

Reference the .changeset/bright-tires-report.md format as a good example.

🤖 Prompt for AI Agents
.changeset/chilly-jokes-decide.md around lines 5-7: the changeset message is too
vague for end users; update it to explicitly name the new assist
`useSortedInterfaceMembers`, add a short one-line explanation that it sorts
TypeScript interface members for readability and has an autofix, and include a
small before/after code example showing an unsorted interface and the sorted
result (use fenced examples like "before:" and "after:"), following the style of
.changeset/bright-tires-report.md so the changeset clearly communicates the
change to users.

Comment on lines +316 to +362
/// A wrapper type for one of three possible values.
///
/// Implements [Layer] if `First`, `Second`, and `Third` all implement [Layer].
pub(super) enum OrderedVariants<First, Second, Third> {
First(First),
Second(Second),
Third(Third),
}

impl<First, Second, Third, S> Layer<S> for OrderedVariants<First, Second, Third>
where
First: Layer<S>,
Second: Layer<S>,
Third: Layer<S>,
S: Subscriber,
{
}

/// Extension trait for creating [OrderedVariants].
pub(super) trait OrderedVariantsExt {
/// Wraps `self` in the [OrderedVariants::First] variant.
fn first<Second, Third>(self) -> OrderedVariants<Self, Second, Third>
where
Self: Sized,
{
OrderedVariants::First(self)
}

/// Wraps `self` in the [OrderedVariants::Second] variant.
fn second<First, Third>(self) -> OrderedVariants<First, Self, Third>
where
Self: Sized,
{
OrderedVariants::Second(self)
}

/// Wraps `self` in the [OrderedVariants::Third] variant.
fn third<First, Second>(self) -> OrderedVariants<First, Second, Self>
where
Self: Sized,
{
OrderedVariants::Third(self)
}
}

impl<T> OrderedVariantsExt for T {}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

OrderedVariants currently drops all logging by not delegating Layer methods

OrderedVariants<First, Second, Third> implements Layer<S> with an empty impl block, so it relies entirely on Layer’s default methods. Those defaults are no‑ops and do not forward to the inner First/Second/Third values.

Because setup_cli_subscriber now does:

  • build a fmt::Layer builder,
  • call .pretty().first() / .compact().second() / .json().third(),
  • pass the resulting OrderedVariants into registry().with(layer).init(),

the actual fmt layer’s behaviour is never invoked. The end result is effectively a layer that filters but does not log.

You’ll need to either:

  • Implement Layer<S> for OrderedVariants by delegating each relevant method (enabled, on_event, span hooks, max_level_hint, etc.) to the active variant, or
  • Drop OrderedVariants and keep the match on LoggingKind building and attaching the concrete fmt layer type directly in each branch (slightly more duplication, but much less subtle).

As it stands, this is likely to break CLI logging entirely once this path is exercised.


🏁 Script executed:

#!/bin/bash
# Quick grep to show how OrderedVariants is used across the repo.
rg -n "OrderedVariants<" -C3

Length of output: 2361


I need to inspect the complete implementation and usage context.

I need to see the complete Layer implementation and how OrderedVariants is used in setup_cli_subscriber.


🏁 Script executed:

#!/bin/bash
# View the OrderedVariants Layer impl block completely
sed -n '325,333p' crates/biome_cli/src/logging.rs

# Find setup_cli_subscriber and show context
rg -n "setup_cli_subscriber" -A 50 -B 5

Length of output: 17361


I need to see the complete implementation of the Layer block for OrderedVariants.

#!/bin/bash
# View OrderedVariants Layer impl block in full (accounting for git/ prefix)
cat git/crates/biome_cli/src/logging.rs | sed -n '325,333p'

# Also view a few more lines to see if impl body exists
cat git/crates/biome_cli/src/logging.rs | sed -n '325,340p'

---

```bash
#!/bin/bash
# View the OrderedVariants Layer impl block in full
sed -n '325,332p' git/crates/biome_cli/src/logging.rs

---



</details>

**Confirm: OrderedVariants Layer implementation is empty and logging delegation is missing**

The code snippet you provided shows the `Layer<S>` impl block for `OrderedVariants` is indeed empty (`{}`). Combined with the `setup_cli_subscriber` flow (lines 118–125) that wraps the fmt layer and immediately attaches it to the registry, this confirms the issue: the inner layer's behaviour is never invoked.

Per tracing-subscriber documentation, wrapper Layer types must delegate method calls (`on_event`, `on_enter`, `on_exit`, span hooks, etc.) to their inner variants. An empty impl block uses only trait defaults, which are no-ops. The result is a functioning filter with no actual logging output.

The fix requires either:

- Implementing delegation in `OrderedVariants`—dispatching each Layer method to the active variant, or  
- Removing the enum wrapper and attaching the concrete fmt layer type directly in each `LoggingKind` branch (more boilerplate, less subtle).

As written, this breaks logging once the code path is exercised.

<!-- fingerprinting:phantom:poseidon:olive -->

<!-- This is an auto-generated comment by CodeRabbit -->

Comment on lines +368 to +388
#[cfg(feature = "schema")]
impl<T: Default> schemars::JsonSchema for RuleAssistConfiguration<T>
where
T: schemars::JsonSchema,
{
fn schema_name() -> std::borrow::Cow<'static, str> {
std::borrow::Cow::Owned(format!("RuleAssistConfiguration_for_{}", T::schema_name()))
}

fn json_schema(generator: &mut schemars::generate::SchemaGenerator) -> schemars::Schema {
let plain_schema = generator.subschema_for::<RuleAssistPlainConfiguration>();
let with_options_schema = generator.subschema_for::<RuleAssistWithOptions<T>>();

schemars::json_schema!({
"oneOf": [
plain_schema,
with_options_schema,
]
})
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

RuleAssistConfiguration is correct, but RuleAssistWithOptions is missing additionalProperties: false

The RuleAssistConfiguration<T> oneOf is spot‑on. For RuleAssistWithOptions<T>, the required ["level", "options"] matches serde, but the struct has deny_unknown_fields while the schema omits "additionalProperties": false, unlike the linter equivalents.

To keep schema validation aligned with deserialisation, you probably want to disallow extra keys in the JSON Schema as well. Suggested tweak:

     fn json_schema(generator: &mut schemars::generate::SchemaGenerator) -> schemars::Schema {
         let level_schema = generator.subschema_for::<RuleAssistPlainConfiguration>();
         let options_schema = generator.subschema_for::<T>();

         schemars::json_schema!({
             "type": "object",
-            "required": ["level", "options"],
-            "properties": {
-                "level": level_schema,
-                "options": options_schema,
-            }
+            "required": ["level", "options"],
+            "properties": {
+                "level": level_schema,
+                "options": options_schema,
+            },
+            "additionalProperties": false,
         })
     }

This would bring it in line with RuleWithOptions<T>/RuleWithFixOptions<T> and with the deny_unknown_fields attribute.

Also applies to: 443-465



---

🏁 Script executed:

```shell
#!/bin/bash
# Find the RuleAssistWithOptions struct definition and its JsonSchema impl
rg -n "struct RuleAssistWithOptions" crates/biome_configuration/src/analyzer/mod.rs -A 10

Length of output: 416


🏁 Script executed:

#!/bin/bash
# Find JsonSchema impl for RuleAssistWithOptions
rg -n "impl.*JsonSchema.*RuleAssistWithOptions" crates/biome_configuration/src/analyzer/mod.rs -A 25

Length of output: 966


🏁 Script executed:

#!/bin/bash
# Find RuleWithOptions and RuleWithFixOptions JsonSchema implementations for comparison
rg -n "impl.*JsonSchema.*RuleWithOptions|impl.*JsonSchema.*RuleWithFixOptions" crates/biome_configuration/src/analyzer/mod.rs -A 20

Length of output: 1900


🏁 Script executed:

#!/bin/bash
# Check lines around 443-465 to see what else applies
sed -n '440,470p' crates/biome_configuration/src/analyzer/mod.rs

Length of output: 954



---

🏁 Script executed:

```shell
#!/bin/bash
# Get full RuleWithOptions JsonSchema impl
sed -n '487,525p' crates/biome_configuration/src/analyzer/mod.rs

Length of output: 1415


🏁 Script executed:

#!/bin/bash
# Get full RuleWithFixOptions JsonSchema impl
sed -n '537,575p' crates/biome_configuration/src/analyzer/mod.rs

Length of output: 1235


🏁 Script executed:

#!/bin/bash
# Check RuleAssistWithOptions struct for deny_unknown_fields and nearby context
sed -n '425,436p' crates/biome_configuration/src/analyzer/mod.rs

Length of output: 416


🏁 Script executed:

#!/bin/bash
# Check the struct definition right after line 465 to see what has deny_unknown_fields
sed -n '467,480p' crates/biome_configuration/src/analyzer/mod.rs

Length of output: 480


Add additionalProperties: false to RuleAssistWithOptions JsonSchema (lines 456-462)

Your analysis is spot-on. RuleAssistWithOptions<T> has deny_unknown_fields in its serde attributes but the generated JSON schema omits "additionalProperties": false—unlike its cousins RuleWithOptions<T> and RuleWithFixOptions<T>, which both include it. This creates a schema/deserialisation mismatch.

The fix should add "additionalProperties": false, after the properties object in the json_schema! macro at lines 456-462, exactly as suggested in your diff. This brings consistency across all three types and ensures schema validation aligns with your runtime constraints.

🤖 Prompt for AI Agents
In crates/biome_configuration/src/analyzer/mod.rs around lines 368 to 388, the
JSON Schema generated for RuleAssistWithOptions<T> omits "additionalProperties":
false despite the type having serde(deny_unknown_fields); update the
json_schema! invocation for RuleAssistWithOptions<T> to insert
"additionalProperties": false immediately after the "properties" object
(matching RuleWithOptions<T> and RuleWithFixOptions<T>) so the schema disallows
unknown fields and matches runtime deserialization.

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

Labels

A-CLI Area: CLI A-Core Area: core A-Diagnostic Area: diagnostocis A-Formatter Area: formatter A-Linter Area: linter A-LSP Area: language server protocol A-Parser Area: parser A-Project Area: project A-Tooling Area: internal tools A-Type-Inference Area: type inference L-CSS Language: CSS L-Grit Language: GritQL L-HTML Language: HTML and super languages L-JavaScript Language: JavaScript and super languages L-JSON Language: JSON and super languages L-Tailwind Language: Tailwind CSS

Projects

None yet

Development

Successfully merging this pull request may close these issues.