Skip to content

Conversation

@ematipico
Copy link
Member

Summary

Follow up of #8327

This PR piggy-backs the new document service refactor, and adds CSS to the module graph.

I refactored the module graph this way:

  • Storing and deleting of paths now happen in two different functions. Like this, it's more flexible and we aren't bound to have different roots
  • The new function update_graph_for_css_paths how accepts a service that is pulled from the document services (see related PR)
  • Updated the current data structure to fit the new generic design

Test Plan

Added a new test, updated the existing tests.

Docs

No changeset needed, the new functionality isn't exposed yet to the users.

@changeset-bot
Copy link

changeset-bot bot commented Dec 1, 2025

⚠️ No Changeset found

Latest commit: ddcdc2f

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

This PR includes no changesets

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

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

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

@github-actions github-actions bot added A-Core Area: core A-Project Area: project A-Linter Area: linter A-Parser Area: parser A-LSP Area: language server protocol L-JavaScript Language: JavaScript and super languages L-CSS Language: CSS labels Dec 1, 2025
@ematipico ematipico force-pushed the refactor/document-services branch from 5c447eb to 65bff06 Compare December 1, 2025 09:45
@ematipico ematipico changed the title refactor: document services feat(graph): support CSS files Dec 1, 2025
Base automatically changed from refactor/document-services to main December 4, 2025 08:19
@ematipico ematipico force-pushed the feat/css-module-graph branch from 6cc0fdb to e743ec3 Compare December 4, 2025 08:58
@codspeed-hq
Copy link

codspeed-hq bot commented Dec 4, 2025

CodSpeed Performance Report

Merging #8329 will not alter performance

Comparing feat/css-module-graph (ddcdc2f) with main (16a9036)

Summary

✅ 58 untouched
⏩ 95 skipped1

Footnotes

  1. 95 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.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 4, 2025

Parser conformance results on

js/262

Test result main count This PR count Difference
Total 52650 52650 0
Passed 51437 51437 0
Failed 1171 1171 0
Panics 42 42 0
Coverage 97.70% 97.70% 0.00%

jsx/babel

Test result main count This PR count Difference
Total 38 38 0
Passed 37 37 0
Failed 1 1 0
Panics 0 0 0
Coverage 97.37% 97.37% 0.00%

symbols/microsoft

Test result main count This PR count Difference
Total 6339 6339 0
Passed 2110 2110 0
Failed 4229 4229 0
Panics 0 0 0
Coverage 33.29% 33.29% 0.00%

ts/babel

Test result main count This PR count Difference
Total 626 626 0
Passed 561 561 0
Failed 65 65 0
Panics 0 0 0
Coverage 89.62% 89.62% 0.00%

ts/microsoft

Test result main count This PR count Difference
Total 18846 18846 0
Passed 14090 14090 0
Failed 4755 4755 0
Panics 1 1 0
Coverage 74.76% 74.76% 0.00%

@ematipico ematipico force-pushed the feat/css-module-graph branch from e743ec3 to 15916d5 Compare December 4, 2025 09:04
@ematipico ematipico marked this pull request as ready for review December 4, 2025 10:05
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 4, 2025

Walkthrough

Reworks ModuleGraph to support mixed module types by introducing a ModuleInfo enum (Js | Css) and SerializedModuleInfo, adds CSS-specific types (CssModuleInfo, CssImports, CssImport) and a CssModuleVisitor to collect and resolve CSS @import URLs, and exposes js_module_info_for_path alongside ModuleGraph.data. Adds update_graph_for_css_paths and adjusts update_graph_for_js_paths signature. Propagates these API and type changes across many crates and tests, and extends workspace/workflow types (notably UpdateKind) to thread per-language services.

Suggested reviewers

  • arendjr
  • dyc3
  • siketyan

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat(graph): support CSS files' directly and concisely summarises the main change: adding CSS support to the module graph system.
Description check ✅ Passed The description is related to the changeset, explaining the motivation (follow-up to PR #8327), implementation approach (refactoring module graph, new update_graph_for_css_paths function), and testing updates.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/css-module-graph

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: 4

♻️ Duplicate comments (1)
crates/biome_service/src/scanner/workspace_watcher_bridge.tests.rs (1)

115-119: Same ModuleInfo access pattern as above

This block mirrors the earlier assertion; comments about as_js_module_info().unwrap() and the expected JS-only path apply here too.

🧹 Nitpick comments (11)
crates/biome_ruledoc_utils/src/lib.rs (1)

82-85: Call updated to new update_graph_for_js_paths signature

Adjusting to module_graph.update_graph_for_js_paths(&fs, &layout, &added_paths); matches the new API and keeps the ruledoc builder JS-focused. When/if you start documenting CSS rules via this path, you can mirror this with update_graph_for_css_paths as well, but that’s strictly a future enhancement.

crates/biome_js_analyze/src/services/module_graph.rs (1)

19-21: Service now uses JS-specific graph accessor

module_info_for_path delegating to js_module_info_for_path is consistent with this being a JS-only service wrapper around the shared graph. You might eventually consider renaming the method to js_module_info_for_path for clarity, but that’s purely cosmetic.

crates/biome_module_graph/src/js_module_info.rs (1)

60-66: API rename clarifies JS scope; consider a deprecated alias

Renaming to find_js_exported_symbol matches the JS-only nature of this API and the surrounding naming, while keeping the behaviour identical. If you expect external crates to depend on biome_module_graph, a thin #[deprecated] alias under the old name could smooth over any semver bumps.

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

236-256: New get_css_added_paths helper mirrors the JS version

The CSS helper cleanly parallels get_added_paths: it reads from the abstract FileSystem, parses CSS, asserts no diagnostics, and returns (BiomePath, CssRoot) pairs, which is exactly what the new CSS graph tests need. If duplication with the JS helper ever gets annoying, a tiny generic “parse with diagnostics assert” helper could deduplicate the pattern, but it’s fine as-is.

crates/biome_lsp/src/server.tests.rs (1)

3841-3845: Consider adding an assertion before the unwrap.

Whilst panics are acceptable in tests, you could make failures clearer:

.map(|module_info| {
    let js_info = module_info.as_js_module_info()
        .expect("Expected JS module info for .js file");
    js_info.static_import_paths.clone()
})

This provides better context if the test fails unexpectedly.

Also applies to: 3872-3876

crates/biome_css_syntax/src/import_ext.rs (1)

5-12: Complete the documentation example.

The doc comment includes an empty example block. Either provide a meaningful example or remove the section:

/// Returns the inner text of the import specifier.
///
/// # Examples
///
/// ```
/// use biome_css_parser::parse_css;
/// use biome_css_syntax::CssFileSource;
/// // Example: "@import 'style.css';" -> "style.css"
/// ```

Or simply remove the empty ## Examples section if examples aren't needed yet.

crates/biome_service/src/workspace/server.rs (1)

544-564: New helper get_parse_and_services looks good.

Clean extraction of parse and services from the document. One minor note: on line 560, you're cloning syntax and services even though you already have ownership after the .cloned() on line 554. The second .clone() calls are redundant.

             Ok(syntax) => match syntax {
                 None => Err(WorkspaceError::not_found()),
-                Some(syntax) => Ok((syntax.clone(), services.clone())),
+                Some(syntax) => Ok((syntax, services)),
             },
crates/biome_module_graph/src/css_module_info/visitor.rs (2)

7-7: Unused import.

std::ops::DerefMut is imported but not directly used. The DerefMut trait is auto-imported when you call .deref_mut() on a type that implements it.

-use std::ops::DerefMut;

54-61: Simplify insertion.

Since CssImports implements DerefMut, you can call insert directly without the explicit .deref_mut().

-        imports.deref_mut().insert(
+        imports.insert(
             text.clone(),
             CssImport {
                 specifier: text,
                 resolved_path,
             },
         );
crates/biome_module_graph/src/module_graph.rs (2)

163-176: Consider adding an accessor method for CSS imports.

Accessing module.0.imports directly exposes the internal structure. Adding an imports() accessor to CssModuleInfo (similar to how JsModuleInfo exposes its data) would improve encapsulation.

-            for (_, path) in module.0.imports.deref() {
+            for (_, path) in module.imports() {

This would require adding an imports() method to CssModuleInfo:

pub fn imports(&self) -> &CssImports {
    &self.0.imports
}

281-295: Consider explicit pattern matching for future-proofing.

Using _ => None works but explicit matching would catch any future enum variants at compile time.

     pub fn as_js_module_info(&self) -> Option<&SerializedJsModuleInfo> {
         match self {
             Self::Js(module) => Some(module),
-            _ => None,
+            Self::Css(_) => None,
         }
     }

     pub fn as_css_module_info(&self) -> Option<&SerializedCssModuleInfo> {
         match self {
             Self::Css(module) => Some(module),
-            _ => None,
+            Self::Js(_) => None,
         }
     }
📜 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 b988274 and 4709448.

⛔ Files ignored due to path filters (3)
  • Cargo.lock is excluded by !**/*.lock and included by **
  • crates/biome_service/src/snapshots/biome_service__workspace__tests__debug_module_graph.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 **
📒 Files selected for processing (28)
  • crates/biome_css_syntax/src/import_ext.rs (1 hunks)
  • crates/biome_css_syntax/src/lib.rs (1 hunks)
  • crates/biome_js_analyze/src/lib.rs (1 hunks)
  • crates/biome_js_analyze/src/lint/nursery/no_deprecated_imports.rs (1 hunks)
  • crates/biome_js_analyze/src/lint/nursery/no_unresolved_imports.rs (1 hunks)
  • crates/biome_js_analyze/src/services/module_graph.rs (1 hunks)
  • crates/biome_lsp/src/server.tests.rs (2 hunks)
  • crates/biome_module_graph/Cargo.toml (1 hunks)
  • crates/biome_module_graph/benches/module_graph.rs (0 hunks)
  • crates/biome_module_graph/src/css_module_info.rs (1 hunks)
  • crates/biome_module_graph/src/css_module_info/visitor.rs (1 hunks)
  • crates/biome_module_graph/src/js_module_info.rs (1 hunks)
  • crates/biome_module_graph/src/js_module_info/module_resolver.rs (1 hunks)
  • crates/biome_module_graph/src/lib.rs (2 hunks)
  • crates/biome_module_graph/src/module_graph.rs (7 hunks)
  • crates/biome_module_graph/tests/fixtures/css/index.css (1 hunks)
  • crates/biome_module_graph/tests/fixtures/css/package.json (1 hunks)
  • crates/biome_module_graph/tests/snap/mod.rs (2 hunks)
  • crates/biome_module_graph/tests/spec_tests.rs (41 hunks)
  • crates/biome_rowan/src/syntax/node.rs (1 hunks)
  • crates/biome_ruledoc_utils/src/lib.rs (1 hunks)
  • crates/biome_service/src/file_handlers/javascript.rs (1 hunks)
  • crates/biome_service/src/scanner/workspace_watcher_bridge.tests.rs (2 hunks)
  • crates/biome_service/src/workspace.rs (2 hunks)
  • crates/biome_service/src/workspace.tests.rs (1 hunks)
  • crates/biome_service/src/workspace/server.rs (12 hunks)
  • crates/biome_test_utils/Cargo.toml (1 hunks)
  • crates/biome_test_utils/src/lib.rs (3 hunks)
💤 Files with no reviewable changes (1)
  • crates/biome_module_graph/benches/module_graph.rs
🧰 Additional context used
📓 Path-based instructions (4)
**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.rs: Use the dbg!() macro for debugging output during testing, and pass the --show-output flag to cargo to view debug output
Use cargo t or cargo test to run tests; for a single test, pass the test name after the test command
Use snapshot testing with the insta crate; run cargo insta accept, cargo insta reject, or cargo insta review to manage snapshot changes
Write doctests as doc comments with code blocks; the code inside code blocks will be run during the testing phase
Use just f (alias for just format) to format Rust and TOML files before committing

Files:

  • crates/biome_css_syntax/src/lib.rs
  • crates/biome_js_analyze/src/lint/nursery/no_deprecated_imports.rs
  • crates/biome_service/src/scanner/workspace_watcher_bridge.tests.rs
  • crates/biome_service/src/workspace.rs
  • crates/biome_service/src/file_handlers/javascript.rs
  • crates/biome_ruledoc_utils/src/lib.rs
  • crates/biome_module_graph/src/js_module_info.rs
  • crates/biome_css_syntax/src/import_ext.rs
  • crates/biome_js_analyze/src/services/module_graph.rs
  • crates/biome_js_analyze/src/lint/nursery/no_unresolved_imports.rs
  • crates/biome_rowan/src/syntax/node.rs
  • crates/biome_lsp/src/server.tests.rs
  • crates/biome_js_analyze/src/lib.rs
  • crates/biome_module_graph/src/css_module_info.rs
  • crates/biome_service/src/workspace/server.rs
  • crates/biome_module_graph/src/css_module_info/visitor.rs
  • crates/biome_module_graph/tests/snap/mod.rs
  • crates/biome_module_graph/src/lib.rs
  • crates/biome_test_utils/src/lib.rs
  • crates/biome_module_graph/src/js_module_info/module_resolver.rs
  • crates/biome_service/src/workspace.tests.rs
  • crates/biome_module_graph/tests/spec_tests.rs
  • crates/biome_module_graph/src/module_graph.rs
crates/biome_service/src/workspace*.rs

📄 CodeRabbit inference engine (crates/biome_service/CONTRIBUTING.md)

Implement the Workspace trait in the Biome Service to manage internal state of projects, including open documents, project layout instances, and module graph instances

Files:

  • crates/biome_service/src/workspace.rs
  • crates/biome_service/src/workspace.tests.rs
crates/biome_service/src/workspace/server.rs

📄 CodeRabbit inference engine (crates/biome_service/CONTRIBUTING.md)

Use WorkspaceServer implementation for maintaining workspace state in daemon mode and CLI daemonless mode

Files:

  • crates/biome_service/src/workspace/server.rs
**/*.toml

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Use just f (alias for just format) to format TOML files before committing

Files:

  • crates/biome_test_utils/Cargo.toml
  • crates/biome_module_graph/Cargo.toml
🧠 Learnings (59)
📓 Common learnings
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/scoped_resolver.rs : Implement full inference to resolve `TypeReference::Import` variants across the entire module graph
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/js_module_info/collector.rs : Implement module-level (thin) inference to resolve `TypeReference::Qualifier` variants by looking up declarations in module scopes and handling import statements
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/Cargo.toml : Include development dependencies in `Cargo.toml` for formatter tests: `biome_formatter_test`, `biome_<language>_factory`, `biome_<language>_parser`, `biome_parser`, `biome_service`, `countme`, `iai`, `quickcheck`, `quickcheck_macros`, and `tests_macros`

Applied to files:

  • crates/biome_css_syntax/src/lib.rs
  • crates/biome_test_utils/Cargo.toml
  • crates/biome_test_utils/src/lib.rs
  • crates/biome_module_graph/Cargo.toml
  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Create two new crates `biome_{language}_syntax` and `biome_{language}_factory` using `cargo new --lib` for new language parsers

Applied to files:

  • crates/biome_css_syntax/src/lib.rs
  • crates/biome_test_utils/Cargo.toml
  • crates/biome_module_graph/Cargo.toml
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/scoped_resolver.rs : Implement full inference to resolve `TypeReference::Import` variants across the entire module graph

Applied to files:

  • crates/biome_css_syntax/src/lib.rs
  • crates/biome_js_analyze/src/lint/nursery/no_deprecated_imports.rs
  • crates/biome_service/src/scanner/workspace_watcher_bridge.tests.rs
  • crates/biome_service/src/workspace.rs
  • crates/biome_service/src/file_handlers/javascript.rs
  • crates/biome_ruledoc_utils/src/lib.rs
  • crates/biome_css_syntax/src/import_ext.rs
  • crates/biome_js_analyze/src/services/module_graph.rs
  • crates/biome_js_analyze/src/lint/nursery/no_unresolved_imports.rs
  • crates/biome_lsp/src/server.tests.rs
  • crates/biome_js_analyze/src/lib.rs
  • crates/biome_module_graph/src/css_module_info.rs
  • crates/biome_module_graph/src/css_module_info/visitor.rs
  • crates/biome_module_graph/tests/snap/mod.rs
  • crates/biome_module_graph/src/lib.rs
  • crates/biome_module_graph/src/js_module_info/module_resolver.rs
  • crates/biome_service/src/workspace.tests.rs
  • crates/biome_module_graph/tests/spec_tests.rs
  • crates/biome_module_graph/src/module_graph.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : No module may copy or clone data from another module in the module graph, not even behind an `Arc`

Applied to files:

  • crates/biome_css_syntax/src/lib.rs
  • crates/biome_js_analyze/src/lint/nursery/no_deprecated_imports.rs
  • crates/biome_service/src/scanner/workspace_watcher_bridge.tests.rs
  • crates/biome_service/src/workspace.rs
  • crates/biome_ruledoc_utils/src/lib.rs
  • crates/biome_js_analyze/src/services/module_graph.rs
  • crates/biome_lsp/src/server.tests.rs
  • crates/biome_js_analyze/src/lib.rs
  • crates/biome_module_graph/src/css_module_info.rs
  • crates/biome_module_graph/tests/snap/mod.rs
  • crates/biome_module_graph/src/lib.rs
  • crates/biome_module_graph/Cargo.toml
  • crates/biome_module_graph/src/js_module_info/module_resolver.rs
  • crates/biome_service/src/workspace.tests.rs
  • crates/biome_module_graph/tests/spec_tests.rs
  • crates/biome_module_graph/src/module_graph.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/local_inference.rs : Implement local inference in dedicated modules to derive type definitions from expressions without context of surrounding scopes

Applied to files:

  • crates/biome_css_syntax/src/lib.rs
  • crates/biome_service/src/workspace.rs
  • crates/biome_service/src/file_handlers/javascript.rs
  • crates/biome_ruledoc_utils/src/lib.rs
  • crates/biome_js_analyze/src/services/module_graph.rs
  • crates/biome_lsp/src/server.tests.rs
  • crates/biome_js_analyze/src/lib.rs
  • crates/biome_module_graph/src/css_module_info.rs
  • crates/biome_module_graph/tests/snap/mod.rs
  • crates/biome_module_graph/src/lib.rs
  • crates/biome_module_graph/src/js_module_info/module_resolver.rs
  • crates/biome_service/src/workspace.tests.rs
  • crates/biome_module_graph/src/module_graph.rs
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Applies to crates/biome_parser/**/language_kind.rs : Add a new language prefix to the `LANGUAGE_PREFIXES` constant in `language_kind.rs` file

Applied to files:

  • crates/biome_css_syntax/src/lib.rs
  • crates/biome_service/src/workspace/server.rs
  • crates/biome_test_utils/Cargo.toml
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Use `TypeReference` instead of `Arc` for types that reference other types to avoid stale cache issues when modules are replaced

Applied to files:

  • crates/biome_css_syntax/src/lib.rs
  • crates/biome_js_analyze/src/lint/nursery/no_deprecated_imports.rs
  • crates/biome_service/src/scanner/workspace_watcher_bridge.tests.rs
  • crates/biome_service/src/workspace.rs
  • crates/biome_service/src/file_handlers/javascript.rs
  • crates/biome_ruledoc_utils/src/lib.rs
  • crates/biome_module_graph/src/js_module_info.rs
  • crates/biome_js_analyze/src/services/module_graph.rs
  • crates/biome_js_analyze/src/lint/nursery/no_unresolved_imports.rs
  • crates/biome_lsp/src/server.tests.rs
  • crates/biome_js_analyze/src/lib.rs
  • crates/biome_module_graph/src/css_module_info.rs
  • crates/biome_test_utils/Cargo.toml
  • crates/biome_module_graph/tests/snap/mod.rs
  • crates/biome_module_graph/src/lib.rs
  • crates/biome_module_graph/Cargo.toml
  • crates/biome_module_graph/src/js_module_info/module_resolver.rs
  • crates/biome_service/src/workspace.tests.rs
  • crates/biome_module_graph/tests/spec_tests.rs
  • crates/biome_module_graph/src/module_graph.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/src/**/*.rs : Implement the `Merge` trait for rule options to define how options from extended configuration merge with user configuration (usually reset instead of extend)

Applied to files:

  • crates/biome_css_syntax/src/lib.rs
  • crates/biome_test_utils/Cargo.toml
📚 Learning: 2025-11-28T09:08:10.091Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-28T09:08:10.091Z
Learning: Internal crate changes that don't affect user-facing behavior do not require changesets; changesets are only for user-facing changes

Applied to files:

  • crates/biome_css_syntax/src/lib.rs
  • crates/biome_service/src/scanner/workspace_watcher_bridge.tests.rs
  • crates/biome_ruledoc_utils/src/lib.rs
  • crates/biome_module_graph/Cargo.toml
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/src/context.rs : Define `<Language>FormatContext` struct in a `context.rs` file containing `comments` and `source_map` fields, implementing `FormatContext` and `CstFormatContext` traits

Applied to files:

  • crates/biome_css_syntax/src/lib.rs
  • crates/biome_service/src/workspace.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Deprecate rules by adding a `deprecated` field to the `declare_lint_rule!` macro with a message explaining the reason for deprecation (e.g., 'Use the rule noAnotherVar')

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/no_deprecated_imports.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/js_module_info/collector.rs : Implement module-level (thin) inference to resolve `TypeReference::Qualifier` variants by looking up declarations in module scopes and handling import statements

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/no_deprecated_imports.rs
  • crates/biome_service/src/scanner/workspace_watcher_bridge.tests.rs
  • crates/biome_service/src/workspace.rs
  • crates/biome_service/src/file_handlers/javascript.rs
  • crates/biome_ruledoc_utils/src/lib.rs
  • crates/biome_module_graph/src/js_module_info.rs
  • crates/biome_js_analyze/src/services/module_graph.rs
  • crates/biome_js_analyze/src/lint/nursery/no_unresolved_imports.rs
  • crates/biome_lsp/src/server.tests.rs
  • crates/biome_js_analyze/src/lib.rs
  • crates/biome_module_graph/src/css_module_info.rs
  • crates/biome_module_graph/src/css_module_info/visitor.rs
  • crates/biome_module_graph/tests/snap/mod.rs
  • crates/biome_module_graph/src/lib.rs
  • crates/biome_module_graph/src/js_module_info/module_resolver.rs
  • crates/biome_service/src/workspace.tests.rs
  • crates/biome_module_graph/tests/spec_tests.rs
  • crates/biome_module_graph/src/module_graph.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `noUnused` prefix for rules that report unused entities (e.g., `noUnusedVariables`)

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/no_deprecated_imports.rs
  • crates/biome_js_analyze/src/lint/nursery/no_unresolved_imports.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Check if a variable is global before banning it to avoid false positives when the variable is redeclared in local scope; use the semantic model to verify global scope

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/no_deprecated_imports.rs
  • crates/biome_js_analyze/src/lint/nursery/no_unresolved_imports.rs
  • crates/biome_lsp/src/server.tests.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `noUndeclared` prefix for rules that report undefined entities (e.g., `noUndeclaredVariables`)

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/no_deprecated_imports.rs
  • crates/biome_js_analyze/src/lint/nursery/no_unresolved_imports.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `noRedundant` prefix for rules that report redundant code (e.g., `noRedundantUseStrict`)

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/no_deprecated_imports.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/nursery/**/*.rs : New rules must be placed inside the `nursery` group as an incubation space exempt from semantic versioning, with promotion to appropriate groups done during minor/major releases

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/no_deprecated_imports.rs
  • crates/biome_js_analyze/src/lint/nursery/no_unresolved_imports.rs
  • crates/biome_module_graph/Cargo.toml
📚 Learning: 2025-11-24T18:06:12.048Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:12.048Z
Learning: Applies to crates/biome_service/src/workspace/watcher.tests.rs : Implement watcher tests for workspace methods in watcher.tests.rs and end-to-end tests in LSP tests

Applied to files:

  • crates/biome_service/src/scanner/workspace_watcher_bridge.tests.rs
  • crates/biome_service/src/workspace.rs
  • crates/biome_lsp/src/server.tests.rs
  • crates/biome_service/src/workspace/server.rs
  • crates/biome_test_utils/Cargo.toml
  • crates/biome_test_utils/src/lib.rs
  • crates/biome_module_graph/Cargo.toml
  • crates/biome_service/src/workspace.tests.rs
  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-11-24T18:06:12.048Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:12.048Z
Learning: Applies to crates/biome_service/src/workspace*.rs : Implement the Workspace trait in the Biome Service to manage internal state of projects, including open documents, project layout instances, and module graph instances

Applied to files:

  • crates/biome_service/src/scanner/workspace_watcher_bridge.tests.rs
  • crates/biome_service/src/workspace.rs
  • crates/biome_js_analyze/src/services/module_graph.rs
  • crates/biome_service/src/workspace/server.rs
  • crates/biome_test_utils/Cargo.toml
  • crates/biome_test_utils/src/lib.rs
  • crates/biome_module_graph/Cargo.toml
  • crates/biome_service/src/workspace.tests.rs
  • crates/biome_module_graph/src/module_graph.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Store type data in linear vectors instead of using recursive data structures with `Arc` for improved data locality and performance

Applied to files:

  • crates/biome_service/src/scanner/workspace_watcher_bridge.tests.rs
  • crates/biome_service/src/workspace.rs
  • crates/biome_service/src/file_handlers/javascript.rs
  • crates/biome_ruledoc_utils/src/lib.rs
  • crates/biome_js_analyze/src/services/module_graph.rs
  • crates/biome_js_analyze/src/lib.rs
  • crates/biome_module_graph/src/css_module_info.rs
  • crates/biome_test_utils/Cargo.toml
  • crates/biome_module_graph/tests/snap/mod.rs
  • crates/biome_module_graph/Cargo.toml
  • crates/biome_module_graph/src/js_module_info/module_resolver.rs
  • crates/biome_service/src/workspace.tests.rs
  • crates/biome_module_graph/src/module_graph.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Distinguish between `TypeData::Unknown` and `TypeData::UnknownKeyword` to measure inference effectiveness versus explicit user-provided unknown types

Applied to files:

  • crates/biome_service/src/scanner/workspace_watcher_bridge.tests.rs
  • crates/biome_service/src/file_handlers/javascript.rs
  • crates/biome_js_analyze/src/lint/nursery/no_unresolved_imports.rs
  • crates/biome_lsp/src/server.tests.rs
  • crates/biome_module_graph/tests/snap/mod.rs
  • crates/biome_module_graph/src/module_graph.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Always apply the correct `ResolverId` when retrieving raw type data from `ResolvedTypeData.as_raw_data()` to prevent panics during subsequent resolution calls

Applied to files:

  • crates/biome_service/src/scanner/workspace_watcher_bridge.tests.rs
  • crates/biome_service/src/workspace.rs
  • crates/biome_service/src/file_handlers/javascript.rs
  • crates/biome_lsp/src/server.tests.rs
  • crates/biome_js_analyze/src/lib.rs
  • crates/biome_module_graph/src/js_module_info/module_resolver.rs
  • crates/biome_service/src/workspace.tests.rs
📚 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_service/src/workspace.rs
  • crates/biome_js_analyze/src/services/module_graph.rs
  • crates/biome_js_analyze/src/lib.rs
  • crates/biome_module_graph/src/css_module_info.rs
  • crates/biome_module_graph/tests/snap/mod.rs
  • crates/biome_module_graph/src/lib.rs
  • crates/biome_module_graph/src/js_module_info/module_resolver.rs
  • crates/biome_service/src/workspace.tests.rs
  • crates/biome_module_graph/src/module_graph.rs
📚 Learning: 2025-11-24T18:04:57.309Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:57.309Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : Use helper types from the biome_diagnostics::v2 module (CodeFrameAdvice, CommandAdvice, DiffAdvice, LogAdvice) or implement the Advices trait yourself for custom advice handling

Applied to files:

  • crates/biome_service/src/workspace.rs
  • crates/biome_service/src/workspace/server.rs
  • crates/biome_test_utils/Cargo.toml
  • crates/biome_module_graph/tests/snap/mod.rs
  • crates/biome_module_graph/src/lib.rs
  • crates/biome_module_graph/Cargo.toml
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Import the `FormatNode` trait and implement it for your Node when creating formatters in biome_js_formatter

Applied to files:

  • crates/biome_service/src/workspace.rs
  • crates/biome_service/src/workspace/server.rs
  • crates/biome_module_graph/tests/snap/mod.rs
  • crates/biome_module_graph/src/lib.rs
  • crates/biome_module_graph/Cargo.toml
  • crates/biome_module_graph/tests/spec_tests.rs
  • crates/biome_module_graph/src/module_graph.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Use `TypeReference` variants (`Qualifier`, `Resolved`, `Import`, `Unknown`) to represent different phases of type resolution

Applied to files:

  • crates/biome_service/src/workspace.rs
  • crates/biome_service/src/file_handlers/javascript.rs
  • crates/biome_js_analyze/src/lint/nursery/no_unresolved_imports.rs
  • crates/biome_js_analyze/src/lib.rs
  • crates/biome_module_graph/src/css_module_info.rs
  • crates/biome_module_graph/tests/snap/mod.rs
  • crates/biome_module_graph/src/lib.rs
  • crates/biome_module_graph/src/js_module_info/module_resolver.rs
  • crates/biome_module_graph/src/module_graph.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Use `TypeData::Unknown` to indicate when type inference falls short or is not implemented

Applied to files:

  • crates/biome_service/src/file_handlers/javascript.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : When using `ResolvedTypeData`, track the `ResolverId` to ensure subsequent resolver calls use the correct context

Applied to files:

  • crates/biome_service/src/file_handlers/javascript.rs
  • crates/biome_js_analyze/src/lib.rs
  • crates/biome_module_graph/src/js_module_info/module_resolver.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/tests/specs/**/*.jsonc : Use `.jsonc` files in test specs with code snippets as array of strings to test rules in script environment (no import/export syntax)

Applied to files:

  • crates/biome_module_graph/tests/fixtures/css/index.css
  • crates/biome_module_graph/tests/fixtures/css/package.json
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/tests/specs/**/*.{js,ts,tsx,jsx,json,css} : Test rules using snapshot tests via the `insta` library with test cases in `tests/specs/<group>/<rule_name>/` directories prefixed by `invalid` or `valid`

Applied to files:

  • crates/biome_module_graph/tests/fixtures/css/index.css
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Do not attempt to 'fix' the code; if a token/node is known to be mandatory but is missing, return `None` instead

Applied to files:

  • crates/biome_ruledoc_utils/src/lib.rs
  • crates/biome_module_graph/tests/snap/mod.rs
  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/src/**/*.rs : Use `Box<[T]>` instead of `Vec<T>` for rule options array fields to save memory (boxed slices and boxed str use 2 words instead of three words)

Applied to files:

  • crates/biome_ruledoc_utils/src/lib.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/src/**/*.rs : Wrap optional rule option fields in `Option<_>` to properly track set vs unset options during configuration merging

Applied to files:

  • crates/biome_ruledoc_utils/src/lib.rs
  • crates/biome_service/src/workspace/server.rs
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Applies to crates/biome_parser/**/src/**/*.rs : Implement a token source struct that wraps the lexer and implements `TokenSourceWithBufferedLexer` and `LexerWithCheckpoint` for lookahead and re-lexing capabilities

Applied to files:

  • crates/biome_css_syntax/src/import_ext.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Avoid unnecessary string allocations by comparing against `&str` or `TokenText` instead of calling `to_string()` which allocates heap memory

Applied to files:

  • crates/biome_css_syntax/src/import_ext.rs
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Applies to crates/biome_parser/**/language_kind.rs : Add a new variant to `LanguageKind` enum in `language_kind.rs` file and implement all methods for the new language variant

Applied to files:

  • crates/biome_css_syntax/src/import_ext.rs
  • crates/biome_rowan/src/syntax/node.rs
  • crates/biome_service/src/workspace/server.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : When formatting AST nodes, use mandatory tokens from the AST instead of hardcoding token strings (e.g., use `node.l_paren_token().format()` instead of `token("(")`)

Applied to files:

  • crates/biome_css_syntax/src/import_ext.rs
  • crates/biome_module_graph/tests/snap/mod.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `noUnknown` prefix for rules that report mistyped entities in CSS (e.g., `noUnknownUnit`)

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/no_unresolved_imports.rs
  • crates/biome_module_graph/src/css_module_info/visitor.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/src/lib.rs : Expose a public `format_node` function that accepts formatting options and a root syntax node, returning a `FormatResult<Formatted<Context>>` with appropriate documentation

Applied to files:

  • crates/biome_rowan/src/syntax/node.rs
  • crates/biome_module_graph/tests/snap/mod.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Avoid using `unwrap()` or `expect()` on `Result` and `Option` types; instead use helper functions like `map`, `filter`, `and_then` to maintain code clarity and avoid panics

Applied to files:

  • crates/biome_lsp/src/server.tests.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/tests/specs/**/options.json : Create an `options.json` file (formatted as `biome.json`) in test specification folders to apply non-default formatting options to all test files in that folder

Applied to files:

  • crates/biome_module_graph/tests/fixtures/css/package.json
📚 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:

  • crates/biome_module_graph/tests/fixtures/css/package.json
  • crates/biome_test_utils/Cargo.toml
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Commit rule changes with message format: `feat(biome_<crate>): <ruleName>` to follow Biome's conventional commit style

Applied to files:

  • crates/biome_module_graph/tests/fixtures/css/package.json
📚 Learning: 2025-11-24T18:04:57.309Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:57.309Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : Use #[derive(Diagnostic)] on enums when every variant contains a type that is itself a diagnostic

Applied to files:

  • crates/biome_service/src/workspace/server.rs
📚 Learning: 2025-11-24T18:04:57.309Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:57.309Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : Implement the Diagnostic trait on types, or use the #[derive(Diagnostic)] procedural macro to implement the trait. Configure category, severity, description, message, location, and tags using the #[diagnostic] attribute

Applied to files:

  • crates/biome_service/src/workspace/server.rs
📚 Learning: 2025-11-24T18:04:57.309Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:57.309Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : Ensure the type implementing Diagnostic derives Debug

Applied to files:

  • crates/biome_service/src/workspace/server.rs
📚 Learning: 2025-11-24T18:04:57.309Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:57.309Z
Learning: Applies to crates/biome_diagnostics/crates/biome_diagnostics_categories/src/categories.rs : Register all new diagnostic categories in crates/biome_diagnostics_categories/src/categories.rs

Applied to files:

  • crates/biome_service/src/workspace/server.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Implement custom `Queryable` types and `Visitor` traits for rules requiring deep AST inspection to avoid redundant traversal passes

Applied to files:

  • crates/biome_module_graph/src/css_module_info/visitor.rs
📚 Learning: 2025-11-28T09:08:10.091Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-28T09:08:10.091Z
Learning: Applies to Cargo.toml : Use workspace dependencies in the root Cargo.toml; internal crates should use `workspace = true` for dependencies and path dependencies for dev-dependencies

Applied to files:

  • crates/biome_test_utils/Cargo.toml
  • crates/biome_module_graph/Cargo.toml
📚 Learning: 2025-11-24T18:06:12.048Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:12.048Z
Learning: Debug the WorkspaceWatcher by starting the daemon with cargo run --bin=biome -- start and running commands such as cargo run --bin=biome -- lint --use-server <path>

Applied to files:

  • crates/biome_test_utils/Cargo.toml
  • crates/biome_test_utils/src/lib.rs
  • crates/biome_module_graph/Cargo.toml
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Use the `just gen-formatter` command to generate initial formatter implementations from the grammar, which will use `format_verbatim_node` that must be replaced with proper `biome_formatter` utilities

Applied to files:

  • crates/biome_module_graph/tests/snap/mod.rs
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Applies to crates/biome_parser/**/src/**/*.rs : Use `ParseSeparatedList` and `ParseNodeList` for parsing lists with error recovery to avoid infinite loops

Applied to files:

  • crates/biome_test_utils/src/lib.rs
  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/tests/spec_tests.rs : Use the `tests_macros::gen_tests!` macro in `spec_tests.rs` to generate test functions for each specification file matching the pattern `tests/specs/<language>/**/*.<ext>`

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Applies to crates/biome_parser/**/src/**/*.rs : A parser struct must implement the `Parser` trait and save the token source, parser context, and optional parser options

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : For tokens that are not mandatory, use helper functions instead of hardcoding

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/src/**/*.rs : Rule options must be defined in the `biome_rule_options` crate and implement traits: `Deserializable`, `Merge`, `Serialize`, `Deserialize`, and `JsonSchema`

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/src/**/*.rs : Rule options struct fields should use `#[serde(rename_all = "camelCase")]`, `#[serde(deny_unknown_fields)]`, and `#[serde(default)]` attributes for proper JSON serialization

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Create test infrastructure with `tests/specs` folder structure and `spec_test.rs`, `spec_tests.rs`, and `language.rs` files in test directories

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
🧬 Code graph analysis (11)
crates/biome_service/src/scanner/workspace_watcher_bridge.tests.rs (1)
crates/biome_module_graph/src/module_graph.rs (2)
  • as_js_module_info (282-287)
  • as_js_module_info (305-310)
crates/biome_css_syntax/src/import_ext.rs (1)
crates/biome_css_syntax/src/lib.rs (1)
  • inner_string_text (189-198)
crates/biome_rowan/src/syntax/node.rs (2)
crates/biome_service/src/workspace/document.rs (1)
  • node (183-185)
crates/biome_rowan/src/ast/mod.rs (1)
  • unwrap_cast (200-212)
crates/biome_lsp/src/server.tests.rs (1)
crates/biome_module_graph/src/module_graph.rs (2)
  • as_js_module_info (282-287)
  • as_js_module_info (305-310)
crates/biome_js_analyze/src/lib.rs (1)
crates/biome_service/src/configuration.rs (1)
  • file_path (113-115)
crates/biome_module_graph/src/css_module_info.rs (3)
crates/biome_module_graph/src/js_module_info.rs (4)
  • deref (38-40)
  • deref (218-220)
  • deref (229-231)
  • dump (96-131)
crates/biome_module_graph/src/module_graph.rs (2)
  • deref (387-389)
  • dump (298-303)
crates/biome_module_graph/src/css_module_info/visitor.rs (1)
  • new (18-28)
crates/biome_service/src/workspace/server.rs (2)
crates/biome_css_semantic/src/semantic_model/model.rs (2)
  • root (34-36)
  • root (35-35)
crates/biome_rowan/src/syntax/node.rs (1)
  • into_language_root (863-869)
crates/biome_module_graph/src/css_module_info/visitor.rs (1)
crates/biome_module_graph/src/css_module_info.rs (1)
  • new (25-28)
crates/biome_test_utils/src/lib.rs (2)
packages/@biomejs/js-api/src/wasm.ts (1)
  • BiomePath (1-1)
crates/biome_css_parser/src/lib.rs (1)
  • parse_css (27-30)
crates/biome_service/src/workspace.tests.rs (1)
crates/biome_module_graph/src/module_graph.rs (2)
  • as_js_module_info (282-287)
  • as_js_module_info (305-310)
crates/biome_module_graph/src/module_graph.rs (4)
crates/biome_module_graph/src/js_module_info.rs (2)
  • diagnostics (53-55)
  • dump (96-131)
crates/biome_module_graph/src/css_module_info.rs (2)
  • new (25-28)
  • dump (30-39)
crates/biome_module_graph/src/css_module_info/visitor.rs (1)
  • new (18-28)
crates/biome_module_graph/src/js_module_info/collector.rs (1)
  • new (1117-1133)
🔇 Additional comments (30)
crates/biome_rowan/src/syntax/node.rs (1)

863-869: Consider the panic behaviour or add documentation.

This method returns Option<N>, suggesting it handles failure gracefully. However, N::unwrap_cast will panic if the language matches but the node kind doesn't match the expected root type N.

If this panic is intentional (indicating a programming error), please document it in the method's documentation, similar to to_language_root below. Alternatively, consider whether this should return Result or use a fallible cast method.

crates/biome_module_graph/Cargo.toml (1)

19-20: CSS workspace dependencies wired correctly

Adding biome_css_semantic and biome_css_syntax as workspace dependencies here is consistent with the new CSS-aware module graph and follows the workspace dependency pattern. No issues from this file.

crates/biome_module_graph/tests/fixtures/css/package.json (1)

1-4: Minimal CSS fixture manifest looks fine

The minimal package.json (name + version) is perfectly adequate for the CSS module graph tests and keeps the fixture simple.

crates/biome_module_graph/tests/fixtures/css/index.css (1)

1-2: Good coverage of CSS import forms

Using both @import "foo.css"; and @import "./bar.css"; gives nice coverage for bare vs relative CSS imports in the module graph tests. Looks good.

crates/biome_test_utils/Cargo.toml (1)

21-22: CSS parser dependencies correctly added to test utils

Bringing in biome_css_parser and biome_css_syntax as workspace dependencies is consistent with how other language tooling is wired in biome_test_utils. No concerns here.

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

3-10: import_ext module is cleanly integrated

Adding mod import_ext; alongside the other internal modules keeps the new import helpers encapsulated and does not alter the public API surface. Integration here looks tidy.

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

260-264: Use of find_js_exported_symbol matches JS-only rule semantics

Switching to target_info.find_js_exported_symbol is the right move now that the module graph can host non-JS modules: this rule is JS-only and should ignore CSS (or other) exports. The lookup remains constrained by the same module_graph context, so behaviour is preserved for JS while avoiding cross-language confusion.

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

161-164: Resolver now correctly targets JS module info

Using js_module_info_for_path here makes the type resolver explicitly JS-centric, which is what JsAnalyzerServices expects now that the module graph can host multiple module kinds. The surrounding logic is unchanged, so this is a safe and more precise lookup.

crates/biome_service/src/scanner/workspace_watcher_bridge.tests.rs (1)

79-83: Static import assertion correctly adapted to ModuleInfo

Using as_js_module_info().unwrap().static_import_paths.clone() keeps the test aligned with the new ModuleInfo enum; the unwrap is fine here because the fixture is a .js file and a panic would indicate a genuine bug in the graph.

crates/biome_service/src/file_handlers/javascript.rs (1)

627-638: debug_type_info now correctly uses JS-specific module info

Swapping to graph.js_module_info_for_path(path) makes the no-parse-path branch explicitly JS-only and consistent with the updated graph API, without changing the observable behaviour of debug_type_info.

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

128-140: Deprecation lookup correctly narrowed to JS modules

Using module_graph.js_module_info_for_path(target_path) keeps this rule’s resolution strictly JS-focused; unresolved or non-JS targets just bail out as before, which matches the rule’s language: "js" scope.

crates/biome_service/src/workspace.tests.rs (1)

348-352: Module graph assertion updated to use as_js_module_info

The assertion now correctly unwraps the JS variant from ModuleInfo before reading static_import_paths, which matches the new graph representation and is appropriate for this .ts-only test.

crates/biome_module_graph/src/js_module_info/module_resolver.rs (1)

167-178: Registering imported modules via js_module_info_for_path

Switching to self.module_graph.js_module_info_for_path(path)? keeps ModuleResolver firmly in JS territory and lines up with the new graph APIs, without altering the import-resolution flow.

crates/biome_test_utils/src/lib.rs (2)

33-35: CSS parser types wired into test utilities

Importing CssParserOptions and CssRoot here makes sense given the new CSS graph tests and keeps the CSS helpers nicely local to biome_test_utils.


207-208: JS test module graph updated to new JS-path API

Calling update_graph_for_js_paths(&fs, project_layout, &paths) matches the updated signature and keeps this helper focused on JS/TS inputs; CSS fixtures can now go through the separate CSS-specific path.

crates/biome_module_graph/tests/snap/mod.rs (1)

89-121: LGTM! Clean pattern matching for the new ModuleInfo variants.

The empty CSS branch is appropriate for snapshot testing at this stage.

crates/biome_service/src/workspace.rs (1)

66-66: Straightforward migration to SerializedModuleInfo.

The type rename cleanly extends support to both JS and CSS modules whilst maintaining API compatibility.

Also applies to: 1353-1353

crates/biome_css_syntax/src/import_ext.rs (1)

13-26: Implementation looks solid.

The pattern matching is exhaustive and error handling is appropriate. The method cleanly extracts inner text from both CSS string literals and url() function values.

crates/biome_service/src/workspace/server.rs (2)

898-925: CSS module graph update looks solid.

The branching logic correctly handles JS vs CSS roots, and the CSS path appropriately requires both the CSS root and CSS services (semantic model) to be available. The fallback to Default::default() for unrecognised roots is sensible.


2486-2498: Debug implementation updated correctly.

The tuple now reflects the three-field variant, though it still only displays reason for brevity. That's a reasonable choice.

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

1-20: Clean module structure expansion for CSS support.

The new css_module_info module and its public re-exports follow the established pattern from js_module_info. The expanded exports from module_graph align well with the new multi-language module info design.

crates/biome_module_graph/tests/spec_tests.rs (1)

2205-2284: Good test coverage for CSS imports.

The new resolves_css_imports_correctly test properly exercises CSS import resolution with both relative (./bar.css) and non-prefixed (foo.css) specifiers. Nice use of the new get_css_added_paths utility.

crates/biome_module_graph/src/css_module_info/visitor.rs (1)

30-45: Clean visitor implementation.

The preorder traversal correctly captures CSS import URLs. The pattern matches the established approach in the JS module visitor.

crates/biome_module_graph/src/css_module_info.rs (1)

12-40: Solid CSS module info structure.

The CssModuleInfo wrapper with Arc follows the established pattern from JsModuleInfo. The Deref implementation and serialisation logic look correct.

crates/biome_module_graph/src/module_graph.rs (6)

13-28: LGTM!

Imports are well-organised and align with the new CSS module support.


43-70: LGTM!

The data structure generalisation and the new accessor method are correctly implemented. The clone is necessary due to the hashmap guard semantics.


125-129: LGTM!

Clean use of the From trait for converting JsModuleInfo into ModuleInfo.


254-270: LGTM!

Clean enum design with idiomatic From implementations.


297-318: LGTM!

The dump() method and accessors are correctly implemented. The same wildcard pattern suggestion from the SerializedModuleInfo review applies here.


320-365: LGTM!

The function correctly handles the new ModuleInfo enum by only descending into JS modules when resolving re-exports. CSS modules are appropriately skipped since they don't participate in JS-style export resolution.

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

♻️ Duplicate comments (1)
crates/biome_module_graph/src/module_graph.rs (1)

181-190: Misleading comment.

The comment at line 183 references "added/updated paths" but this function handles removed paths.

📜 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 4709448 and 538c98a.

📒 Files selected for processing (4)
  • crates/biome_module_graph/src/css_module_info.rs (1 hunks)
  • crates/biome_module_graph/src/module_graph.rs (7 hunks)
  • crates/biome_module_graph/tests/spec_tests.rs (41 hunks)
  • crates/biome_rowan/src/syntax/node.rs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • crates/biome_rowan/src/syntax/node.rs
  • crates/biome_module_graph/src/css_module_info.rs
🧰 Additional context used
📓 Path-based instructions (1)
crates/**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Update inline rustdoc documentation for rules, assists, and their options when adding new features or changing existing features in Rust crates

Files:

  • crates/biome_module_graph/src/module_graph.rs
  • crates/biome_module_graph/tests/spec_tests.rs
🧠 Learnings (31)
📓 Common learnings
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/scoped_resolver.rs : Implement full inference to resolve `TypeReference::Import` variants across the entire module graph
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/js_module_info/collector.rs : Implement module-level (thin) inference to resolve `TypeReference::Qualifier` variants by looking up declarations in module scopes and handling import statements
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/js_module_info/collector.rs : Implement module-level (thin) inference to resolve `TypeReference::Qualifier` variants by looking up declarations in module scopes and handling import statements

Applied to files:

  • crates/biome_module_graph/src/module_graph.rs
  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : No module may copy or clone data from another module in the module graph, not even behind an `Arc`

Applied to files:

  • crates/biome_module_graph/src/module_graph.rs
  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Use `TypeReference` instead of `Arc` for types that reference other types to avoid stale cache issues when modules are replaced

Applied to files:

  • crates/biome_module_graph/src/module_graph.rs
  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Store type data in linear vectors instead of using recursive data structures with `Arc` for improved data locality and performance

Applied to files:

  • crates/biome_module_graph/src/module_graph.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/scoped_resolver.rs : Implement full inference to resolve `TypeReference::Import` variants across the entire module graph

Applied to files:

  • crates/biome_module_graph/src/module_graph.rs
  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Distinguish between `TypeData::Unknown` and `TypeData::UnknownKeyword` to measure inference effectiveness versus explicit user-provided unknown types

Applied to files:

  • crates/biome_module_graph/src/module_graph.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Assist rules should detect refactoring opportunities and emit code action signals

Applied to files:

  • crates/biome_module_graph/src/module_graph.rs
  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-12-12T10:11:05.564Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-12T10:11:05.564Z
Learning: Applies to crates/**/*.rs : Update inline rustdoc documentation for rules, assists, and their options when adding new features or changing existing features in Rust crates

Applied to files:

  • crates/biome_module_graph/src/module_graph.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/local_inference.rs : Implement local inference in dedicated modules to derive type definitions from expressions without context of surrounding scopes

Applied to files:

  • crates/biome_module_graph/src/module_graph.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Set `version` field to `next` in `declare_lint_rule!` macro

Applied to files:

  • crates/biome_module_graph/src/module_graph.rs
📚 Learning: 2025-11-24T18:06:12.048Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:12.048Z
Learning: Applies to crates/biome_service/src/workspace*.rs : Implement the Workspace trait in the Biome Service to manage internal state of projects, including open documents, project layout instances, and module graph instances

Applied to files:

  • crates/biome_module_graph/src/module_graph.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Use `TypeReference` variants (`Qualifier`, `Resolved`, `Import`, `Unknown`) to represent different phases of type resolution

Applied to files:

  • crates/biome_module_graph/src/module_graph.rs
📚 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_module_graph/src/module_graph.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Import the `FormatNode` trait and implement it for your Node when creating formatters in biome_js_formatter

Applied to files:

  • crates/biome_module_graph/src/module_graph.rs
  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Set `language` to `jsx`, `ts`, or `tsx` for rules that only apply to specific JavaScript dialects

Applied to files:

  • crates/biome_module_graph/src/module_graph.rs
📚 Learning: 2025-11-24T18:06:12.048Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:12.048Z
Learning: Applies to crates/biome_service/src/workspace/watcher.tests.rs : Implement watcher tests for workspace methods in watcher.tests.rs and end-to-end tests in LSP tests

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-12-04T13:29:49.287Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8291
File: crates/biome_html_formatter/tests/specs/prettier/vue/html-vue/elastic-header.html:10-10
Timestamp: 2025-12-04T13:29:49.287Z
Learning: Files under `crates/biome_html_formatter/tests/specs/prettier` are test fixtures synced from Prettier and should not receive detailed code quality reviews (e.g., HTTP vs HTTPS, formatting suggestions, etc.). These files are test data meant to validate formatter behavior and should be preserved as-is.

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/tests/spec_tests.rs : Use the `tests_macros::gen_tests!` macro in `spec_tests.rs` to generate test functions for each specification file matching the pattern `tests/specs/<language>/**/*.<ext>`

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/Cargo.toml : Include development dependencies in `Cargo.toml` for formatter tests: `biome_formatter_test`, `biome_<language>_factory`, `biome_<language>_parser`, `biome_parser`, `biome_service`, `countme`, `iai`, `quickcheck`, `quickcheck_macros`, and `tests_macros`

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Prefix line with `#` in documentation code examples sparingly; prefer concise complete snippets

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Lines prefixed with `#` in rule documentation code examples will be hidden from output

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Do not attempt to 'fix' the code; if a token/node is known to be mandatory but is missing, return `None` instead

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-09-25T12:32:59.003Z
Learnt from: arendjr
Repo: biomejs/biome PR: 7593
File: crates/biome_service/src/workspace/server.rs:1306-1306
Timestamp: 2025-09-25T12:32:59.003Z
Learning: In the biomejs/biome project, do not flag compilation errors during code review as they are handled by the existing test infrastructure and CI. Focus on other code quality aspects instead.

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `full_options` code block property for complete biome.json configuration snippets in documentation

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `ignore` code block property to exclude documentation code examples from automatic validation

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Applies to crates/biome_parser/**/src/**/*.rs : A parser struct must implement the `Parser` trait and save the token source, parser context, and optional parser options

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Applies to crates/biome_parser/**/src/**/*.rs : Use `ParseSeparatedList` and `ParseNodeList` for parsing lists with error recovery to avoid infinite loops

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : For tokens that are not mandatory, use helper functions instead of hardcoding

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Rule options struct must derive `Deserializable`, `Serialize`, `Deserialize`, and optionally `JsonSchema`

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Create test infrastructure with `tests/specs` folder structure and `spec_test.rs`, `spec_tests.rs`, and `language.rs` files in test directories

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
🧬 Code graph analysis (1)
crates/biome_module_graph/tests/spec_tests.rs (2)
crates/biome_test_utils/src/lib.rs (2)
  • get_added_paths (213-234)
  • get_css_added_paths (237-256)
crates/biome_module_graph/src/module_graph.rs (4)
  • data (68-70)
  • from (260-262)
  • from (266-268)
  • from (392-394)
⏰ 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). (18)
  • GitHub Check: Documentation
  • GitHub Check: Check JS Files
  • GitHub Check: Bench (biome_configuration)
  • GitHub Check: Bench (biome_tailwind_parser)
  • 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_graphql_formatter)
  • GitHub Check: Bench (biome_module_graph)
  • GitHub Check: Bench (biome_graphql_parser)
  • GitHub Check: Parser conformance
  • GitHub Check: Bench (biome_json_formatter)
  • GitHub Check: Bench (biome_css_analyze)
  • GitHub Check: Bench (biome_json_analyze)
  • GitHub Check: Bench (biome_css_formatter)
  • GitHub Check: Bench (biome_json_parser)
  • GitHub Check: Bench (biome_css_parser)
🔇 Additional comments (9)
crates/biome_module_graph/src/module_graph.rs (6)

13-27: LGTM!

The imports are appropriately scoped for CSS module support integration.


45-45: LGTM!

Core data structure correctly generalised to accommodate both JS and CSS modules.


60-65: LGTM!

Correctly extracts the JS variant from the ModuleInfo enum.


80-129: LGTM!

Refactored to separate removal handling. The From<JsModuleInfo> conversion at line 125 correctly wraps the JS module info in the new enum.


253-317: LGTM!

Clean enum design with proper accessors and conversions. The as_*_module_info() pattern provides safe downcasting.


319-364: LGTM!

Correctly filters for JS modules when following re-exports. Non-JS modules appropriately return None since they don't export JS symbols.

crates/biome_module_graph/tests/spec_tests.rs (3)

17-23: LGTM!

Appropriate imports for CSS module testing.


133-2203: LGTM!

All test updates correctly reflect the new API:

  • update_graph_for_js_paths signature change applied consistently
  • Proper use of js_module_info_for_path() and as_js_module_info() accessors throughout

2205-2257: LGTM!

Well-structured CSS import test that correctly validates:

  • CSS path resolution through the module graph
  • Import specifier and resolved path tracking
  • Proper use of as_css_module_info() accessor

ematipico and others added 6 commits December 19, 2025 16:08
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@ematipico ematipico force-pushed the feat/css-module-graph branch from 538c98a to ee975f9 Compare December 19, 2025 16:10
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_module_graph/tests/spec_tests.rs (1)

2205-2206: Inconsistent test naming convention.

All other test functions in this file use the test_ prefix (e.g., test_resolve_relative_import, test_resolve_package_import). Consider renaming to test_resolves_css_imports_correctly for consistency.

🔎 Proposed fix
-#[test]
-fn resolves_css_imports_correctly() {
+#[test]
+fn test_resolves_css_imports_correctly() {
📜 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 ee975f9 and ddcdc2f.

📒 Files selected for processing (1)
  • crates/biome_module_graph/tests/spec_tests.rs (41 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
crates/**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Update inline rustdoc documentation for rules, assists, and their options when adding new features or changing existing features in Rust crates

Files:

  • crates/biome_module_graph/tests/spec_tests.rs
🧠 Learnings (21)
📓 Common learnings
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/scoped_resolver.rs : Implement full inference to resolve `TypeReference::Import` variants across the entire module graph
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/js_module_info/collector.rs : Implement module-level (thin) inference to resolve `TypeReference::Qualifier` variants by looking up declarations in module scopes and handling import statements
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Use `TypeReference` instead of `Arc` for types that reference other types to avoid stale cache issues when modules are replaced
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Use `TypeReference` variants (`Qualifier`, `Resolved`, `Import`, `Unknown`) to represent different phases of type resolution
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/scoped_resolver.rs : Implement full inference to resolve `TypeReference::Import` variants across the entire module graph

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-11-24T18:06:12.048Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:12.048Z
Learning: Applies to crates/biome_service/src/workspace/watcher.tests.rs : Implement watcher tests for workspace methods in watcher.tests.rs and end-to-end tests in LSP tests

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Use `TypeReference` instead of `Arc` for types that reference other types to avoid stale cache issues when modules are replaced

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/js_module_info/collector.rs : Implement module-level (thin) inference to resolve `TypeReference::Qualifier` variants by looking up declarations in module scopes and handling import statements

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/tests/spec_tests.rs : Use the `tests_macros::gen_tests!` macro in `spec_tests.rs` to generate test functions for each specification file matching the pattern `tests/specs/<language>/**/*.<ext>`

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-12-04T13:29:49.287Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8291
File: crates/biome_html_formatter/tests/specs/prettier/vue/html-vue/elastic-header.html:10-10
Timestamp: 2025-12-04T13:29:49.287Z
Learning: Files under `crates/biome_html_formatter/tests/specs/prettier` are test fixtures synced from Prettier and should not receive detailed code quality reviews (e.g., HTTP vs HTTPS, formatting suggestions, etc.). These files are test data meant to validate formatter behavior and should be preserved as-is.

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Prefix line with `#` in documentation code examples sparingly; prefer concise complete snippets

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Lines prefixed with `#` in rule documentation code examples will be hidden from output

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Assist rules should detect refactoring opportunities and emit code action signals

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Do not attempt to 'fix' the code; if a token/node is known to be mandatory but is missing, return `None` instead

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-09-25T12:32:59.003Z
Learnt from: arendjr
Repo: biomejs/biome PR: 7593
File: crates/biome_service/src/workspace/server.rs:1306-1306
Timestamp: 2025-09-25T12:32:59.003Z
Learning: In the biomejs/biome project, do not flag compilation errors during code review as they are handled by the existing test infrastructure and CI. Focus on other code quality aspects instead.

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `full_options` code block property for complete biome.json configuration snippets in documentation

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `ignore` code block property to exclude documentation code examples from automatic validation

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Import the `FormatNode` trait and implement it for your Node when creating formatters in biome_js_formatter

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Applies to crates/biome_parser/**/src/**/*.rs : A parser struct must implement the `Parser` trait and save the token source, parser context, and optional parser options

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Applies to crates/biome_parser/**/src/**/*.rs : Use `ParseSeparatedList` and `ParseNodeList` for parsing lists with error recovery to avoid infinite loops

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : For tokens that are not mandatory, use helper functions instead of hardcoding

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Rule options struct must derive `Deserializable`, `Serialize`, `Deserialize`, and optionally `JsonSchema`

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : No module may copy or clone data from another module in the module graph, not even behind an `Arc`

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Create test infrastructure with `tests/specs` folder structure and `spec_test.rs`, `spec_tests.rs`, and `language.rs` files in test directories

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
🧬 Code graph analysis (1)
crates/biome_module_graph/tests/spec_tests.rs (1)
crates/biome_test_utils/src/lib.rs (1)
  • get_css_added_paths (237-256)
⏰ 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: Test Node.js API
  • GitHub Check: End-to-end tests
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Check Dependencies
  • GitHub Check: Documentation
  • 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: Check JS Files
  • GitHub Check: Bench (biome_graphql_formatter)
  • GitHub Check: Bench (biome_js_formatter)
  • GitHub Check: Bench (biome_module_graph)
  • GitHub Check: Bench (biome_js_parser)
  • GitHub Check: Bench (biome_js_analyze)
  • GitHub Check: Parser conformance
  • GitHub Check: Bench (biome_graphql_parser)
  • GitHub Check: Bench (biome_package)
  • GitHub Check: Bench (biome_json_formatter)
  • GitHub Check: Bench (biome_tailwind_parser)
  • GitHub Check: Bench (biome_css_analyze)
  • GitHub Check: Bench (biome_css_parser)
  • GitHub Check: Bench (biome_json_parser)
  • GitHub Check: Bench (biome_json_analyze)
  • GitHub Check: Bench (biome_configuration)
  • GitHub Check: Bench (biome_css_formatter)
🔇 Additional comments (3)
crates/biome_module_graph/tests/spec_tests.rs (3)

17-23: LGTM!

The additional imports for CSS support (CssImport and get_css_added_paths) are appropriate for the new test functionality.


133-148: LGTM!

The API refactoring is correctly applied: update_graph_for_js_paths signature change and the new as_js_module_info() unwrapping pattern align with the introduction of the ModuleInfo enum.


2207-2255: LGTM!

The CSS import resolution test is well-structured and correctly validates the new CSS module graph functionality. The test pattern mirrors existing JS tests and properly exercises the new APIs.

@ematipico ematipico merged commit c53f42e into main Dec 19, 2025
31 checks passed
@ematipico ematipico deleted the feat/css-module-graph branch December 19, 2025 16:34
l0ngvh pushed a commit to l0ngvh/biome that referenced this pull request Dec 21, 2025
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Core Area: core A-Linter Area: linter A-LSP Area: language server protocol A-Parser Area: parser A-Project Area: project L-CSS Language: CSS L-JavaScript Language: JavaScript and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants