Skip to content

refactor(inference): prepare legacy type removal - #11010

Merged
ematipico merged 7 commits into
mainfrom
17-prepare-legacy-type-removal
Aug 4, 2026
Merged

ematipico merged 7 commits into
mainfrom
17-prepare-legacy-type-removal

Conversation

@ematipico

@ematipico ematipico commented Jul 20, 2026 •

Copy link
Copy Markdown
Member

Summary

Decouples retained Salsa types and test targets from the legacy engine so the follow-up purge can remove only complete files and dependency lines. Legacy implementation files remain present in this intermediary.

Additionally, this PR uses the newly added SCC algorithm for acyclic modules, and it removes the thread-local guards.

Test Plan

Before, I had spect_test_v2.rs to avoid tarnishing the old test suite. In this PR, the tests created until now have been moved into spec_test.rs, and all tests have been split into features, so that they are more organised and easy to reach out.

Docs

N/A

This PR was created with AI assistance (OpenCode).

@changeset-bot

changeset-bot Bot commented Jul 20, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 6896303

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

Copy link
Copy Markdown
Contributor

⚠️ Mixed activity

Activity patterns show a mix of organic and automated signals.

View full analysis β†’

This is an automated analysis by AgentScan

ematipico commented Jul 20, 2026 •

Copy link
Copy Markdown
Member Author

@github-actions github-actions Bot added A-Project Area: project A-Linter Area: linter L-JavaScript Language: JavaScript and super languages A-Type-Inference Area: type inference labels Jul 20, 2026
@ematipico
ematipico changed the base branch from 16-cut-over-type-consumers to graphite-base/11010 July 23, 2026 13:00
@ematipico
ematipico force-pushed the 17-prepare-legacy-type-removal branch from f0a66ee to 01b08c4 Compare July 27, 2026 09:49
@ematipico
ematipico force-pushed the graphite-base/11010 branch from 6c15711 to 47f9cb8 Compare July 27, 2026 09:49
@ematipico
ematipico changed the base branch from graphite-base/11010 to structured-inference July 27, 2026 09:49
@ematipico
ematipico changed the base branch from structured-inference to graphite-base/11010 July 27, 2026 09:50
@ematipico
ematipico marked this pull request as ready for review August 3, 2026 18:23
@ematipico
ematipico force-pushed the graphite-base/11010 branch from 47f9cb8 to d96d6dd Compare August 3, 2026 18:28
@ematipico
ematipico force-pushed the 17-prepare-legacy-type-removal branch from 01b08c4 to d4f501a Compare August 3, 2026 18:28
@ematipico
ematipico changed the base branch from graphite-base/11010 to main August 3, 2026 18:28
@github-actions github-actions Bot removed the A-Type-Inference Area: type inference label Aug 3, 2026
@ematipico
ematipico marked this pull request as draft August 3, 2026 18:31
@coderabbitai

coderabbitai Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The PR migrates JavaScript and module-graph type inference from resolver-owned representations to raw types and Salsa-backed inferred types. It removes legacy resolver APIs, updates global and local type storage, adds inferred module and namespace members, and narrows public exports. It also adds extensive tests for calls, expressions, promises, generics, module resolution, cycles, CSS, HTML, invalidation, and query selection.

Possibly related issues

Possibly related PRs

  • biomejs/biome#10971 β€” Both modify module-graph resolution to preserve inferred module and namespace members.
  • biomejs/biome#11003 β€” This PR uses the raw type collection model introduced by that refactor.
  • biomejs/biome#11008 β€” Both modify raw type resolution and cycle-aware module inference.

Suggested labels: A-Resolver

Suggested reviewers: dyc3

πŸš₯ Pre-merge checks | βœ… 4
βœ… Passed checks (4 passed)
Check name Status Explanation
Linked Issues check βœ… Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check βœ… Passed Check skipped because no linked issues were found for this pull request.
Title check βœ… Passed The title clearly summarises the main refactoring change: preparing legacy type removal from the inference system.
Description check βœ… Passed The description directly explains the decoupling, test reorganisation, SCC changes, and removal of thread-local guards.
✨ Finishing Touches
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 17-prepare-legacy-type-removal

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

πŸ€– Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/biome_module_graph/src/db/type_inference/resolver.rs`:
- Around line 205-280: Update with_namespace_members to collect members from
each relevant TsModuleDeclaration using
SemanticModel::scope(declaration.syntax()).bindings(), rather than filtering
all_bindings by Binding::scope(). Ensure sibling module declarations remain
isolated and aggregate members across all merged namespace declarations instead
of stopping at the first match. Add regression tests covering sibling modules
and merged namespaces.
πŸͺ„ Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
βš™οΈ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 39515778-b36d-40bb-b08d-387917c6227a

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between d96d6dd and d4f501a.

πŸ“’ Files selected for processing (1)
  • crates/biome_module_graph/src/db/type_inference/resolver.rs

@ematipico
ematipico force-pushed the 17-prepare-legacy-type-removal branch from d4f501a to 0aee9ad Compare August 3, 2026 18:37
@ematipico
ematipico marked this pull request as ready for review August 3, 2026 18:38
@github-actions github-actions Bot added A-Linter Area: linter A-Type-Inference Area: type inference labels Aug 3, 2026
@codspeed

codspeed Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will regress 6 benchmarks

⚑ 10 improved benchmarks
❌ 6 regressed benchmarks
βœ… 259 untouched benchmarks
πŸ†• 3 new benchmarks
⏩ 4 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
❌ bench_index_d_ts_salsa_invalidated[react/index.d.ts] 8.2 ms 10.3 ms -20.25%
❌ css_analyzer[pure_9395922602181450299.css] 23.9 ms 29.2 ms -18.11%
❌ css_analyzer[tachyons_11778168428173736564.css] 182.5 ms 219.5 ms -16.85%
❌ css_analyzer[foundation_11602414662825430680.css] 242.2 ms 281.7 ms -14.03%
❌ css_analyzer[bulma_5641719244145477318.css] 1.2 s 1.3 s -9.74%
❌ css_analyzer[bootstrap_18416142857265205439.css] 562.4 ms 616.4 ms -8.76%
⚑ bench_normalize_local_alias 99.2 ¡s 53.9 ¡s +83.89%
⚑ tsconfig_json 626.7 ¡s 440.7 ¡s +42.21%
⚑ bench_normalize_terminal_type 22.9 ¡s 18.3 ¡s +24.86%
⚑ index_d_ts[@next/font/google/index.d.ts] 276.8 ms 236 ms +17.27%
⚑ index_d_ts[react/index.d.ts] 19.8 ms 17 ms +16.78%
⚑ bench_index_d_ts_salsa_end_to_end[@next/font/google/index.d.ts] 333.8 ms 294.3 ms +13.44%
⚑ index_d_ts[RedisCommander.d.ts] 131.9 ms 120.2 ms +9.76%
⚑ bench_index_d_ts_salsa_incremental_first_run 554.2 ms 509 ms +8.88%
⚑ bench_index_d_ts_salsa_end_to_end[RedisCommander.d.ts] 149.3 ms 137.3 ms +8.72%
⚑ json_analyzer[package-lock_11240515041603712709.json] 29 ms 27.5 ms +5.81%
πŸ†• ascii N/A 10.8 Β΅s N/A
πŸ†• sanitized N/A 321.9 Β΅s N/A
πŸ†• unicode_without_colors N/A 442 Β΅s N/A

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing 17-prepare-legacy-type-removal (6896303) with main (60679db)

Open in CodSpeed

Footnotes

  1. 4 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. ↩

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🧹 Nitpick comments (7)
crates/biome_module_graph/src/js_module_info/collector.rs (2)

885-887: πŸ“ Maintainability & Code Quality | πŸ”΅ Trivial | πŸ’€ Low value

The limit diagnostic depends on diagnostics being otherwise empty.

JsModuleInfoDiagnostic has one variant today, so this works. If a second diagnostic kind arrives, the first unrelated diagnostic suppresses the limit report. Check for the variant instead of emptiness.

♻️ Suggested change
-    if diagnostics.is_empty() {
+    if !diagnostics
+        .iter()
+        .any(|diagnostic| matches!(diagnostic, JsModuleInfoDiagnostic::ExceededTypesLimit(_)))
+    {
         diagnostics.push(JsModuleInfoDiagnostic::exceeded_types_limit());
     }
πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/biome_module_graph/src/js_module_info/collector.rs` around lines 885 -
887, Update the diagnostic insertion logic in the surrounding collector method
so it checks whether diagnostics already contains the exceeded-types-limit
variant, rather than whether diagnostics is empty. Add
JsModuleInfoDiagnostic::exceeded_types_limit() only when that specific
diagnostic is absent, preserving unrelated diagnostics.

694-704: πŸ“ Maintainability & Code Quality | πŸ”΅ Trivial | πŸ’€ Low value

Update the raw-reference rationale. Describe the current TypeStore and TypeReference::Resolved(RawTypeId::Local(...)) handling instead of referencing as_raw_data() and apply_module_id_to_reference().

πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/biome_module_graph/src/js_module_info/collector.rs` around lines 694 -
704, Update the explanatory comment above the
TypeReference::Resolved(RawTypeId::Local(resolved_member)) match to describe the
current TypeStore-based raw-reference handling and why local resolved references
are safe to use during collection. Remove the outdated references to
as_raw_data() and apply_module_id_to_reference().
crates/biome_js_type_info/src/globals_ids.rs (1)

70-72: πŸ“ Maintainability & Code Quality | πŸ”΅ Trivial | πŸ’€ Low value

Update the macro documentation, because roles are no longer expanded.

The doc comment still claims the macro expands roles. The $role column is now only matched and then discarded. Either state that the column is reserved, or drop it from the matchers and the 65 manifest rows.

♻️ Documentation-only adjustment
-/// Expands the manifest into IDs, names, roles, required raw aliases, and the name lookup.
+/// Expands the manifest into IDs, names, optional raw aliases, and the name lookup.
+/// The `role` column is parsed but not expanded.
 macro_rules! predefined_globals {
πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/biome_js_type_info/src/globals_ids.rs` around lines 70 - 72, Update
the documentation for the predefined_globals macro to no longer claim that roles
are expanded, since the $role column is matched and discarded. Either describe
the column as reserved or remove it from the macro matcher and all manifest
rows, preserving the existing generated IDs, names, aliases, and lookup
behavior.
crates/biome_js_type_info/src/local_inference.rs (2)

1674-1684: πŸš€ Performance & Scalability | πŸ”΅ Trivial | ⚑ Quick win

Avoid the extra TypeData clone on every function parameter.

ty_data is cloned in both branches. It is needed again only at Line 1697, and only when the binding has no name. In the named case the clone is pure overhead, and TypeData can carry boxed member and parameter lists. This code runs for every parameter of every function in the file.

Register the reference from a borrow instead, and keep ty_data intact.

♻️ Suggested change
         // Optional parameters can be called without a value, so include `undefined` in the type
         let ty = if is_optional {
-            let ty_ref = collector.reference_to_owned_data(ty_data.clone());
-            RawTypeId::Local(collector.optional(ty_ref)).into()
+            let ty_ref = collector.reference_to_registered_data(&ty_data);
+            let optional_id = collector.optional(ty_ref);
+            collector.reference_to_id(optional_id)
         } else {
-            collector.reference_to_owned_data(ty_data.clone())
+            collector.reference_to_registered_data(&ty_data)
         };
πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/biome_js_type_info/src/local_inference.rs` around lines 1674 - 1684,
Update the parameter type construction around ty_data to avoid cloning TypeData
in either branch: register the collector reference from a borrow while
preserving ty_data for the later unnamed-binding path near line 1697. Keep the
optional-parameter undefined wrapping behavior unchanged and ensure the
named-parameter path does not perform an unnecessary clone.

2294-2294: πŸ“ Maintainability & Code Quality | πŸ”΅ Trivial | πŸ’€ Low value

Build optional references through reference_to_id instead of constructing RawTypeId::Local inline. Three sites hard-code RawTypeId::Local(collector.optional(ty)), while Lines 2385-2386 use the trait method reference_to_id for the same operation. The shared root cause is that these sites bypass the RawTypeCollector abstraction, so an implementor that overrides reference construction is ignored in three places and honoured in one.

  • crates/biome_js_type_info/src/local_inference.rs#L2294-L2294: replace RawTypeId::Local(collector.optional(ty)).into() with collector.optional(ty) followed by collector.reference_to_id(id).
  • crates/biome_js_type_info/src/local_inference.rs#L2408-L2408: apply the same replacement in from_name_and_optional_type.
  • crates/biome_js_type_info/src/local_inference.rs#L1681-L1681: apply the same replacement in from_binding_with_annotation; the diff in the comment on Lines 1674-1684 already does this.
πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/biome_js_type_info/src/local_inference.rs` at line 2294, Update
crates/biome_js_type_info/src/local_inference.rs at lines 2294, 2408, and 1681
to construct optional references through RawTypeCollector::reference_to_id:
obtain the optional type with collector.optional(ty), then pass that ID to
collector.reference_to_id instead of constructing RawTypeId::Local inline. Apply
this in the surrounding optional-type logic, including
from_name_and_optional_type and from_binding_with_annotation.
crates/biome_js_type_info/src/type_store.rs (2)

173-195: πŸ“ Maintainability & Code Quality | πŸ”΅ Trivial | πŸ’€ Low value

Remove the duplicate and simplify UnionCollector.

type_store::UnionCollector is used by biome_module_graph. Remove the unused duplicate in resolver.rs. Consider returning TypeData from finish; it always returns Cow::Owned.

πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/biome_js_type_info/src/type_store.rs` around lines 173 - 195, Remove
the duplicate UnionCollector definition from resolver.rs and use
type_store::UnionCollector in biome_module_graph. Simplify
UnionCollector::finish to return TypeData directly, preserving the unknown
result for empty collections and the union result otherwise, and update its
callers to match.

14-30: πŸ—„οΈ Data Integrity & Integration | πŸ”΅ Trivial | ⚑ Quick win

Deduplicate equal entries in TypeStore::from_types. insert_unique does not check equality, so repeated values create multiple lookup entries and find has no canonical index. This conflicts with β€œdeduplicated insertion”. Guard insertion with table.find(...), or document that from_types preserves duplicate positional entries. The global store uses positional get_by_id, not find.

πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/biome_js_type_info/src/type_store.rs` around lines 14 - 30, Update
TypeStore::from_types to check table.find for an existing equal TypeData before
inserting each index, ensuring repeated values map to one canonical lookup entry
while preserving the original types vector and positional get_by_id behavior.
πŸ€– Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/biome_js_type_info/Cargo.toml`:
- Around line 14-18: Update the Cargo package configuration around autotests and
the local_inference [[test]] target: document above autotests = false that every
integration test must be registered manually, then add [[test]] entries for
conditionals, flattening, resolver, and type_data using their corresponding
tests/*.rs paths.

In `@crates/biome_js_type_info/src/globals_ids.rs`:
- Around line 13-14: Add the required salsa::Update implementation to TypeId, or
annotate the TypeId field in GlobalTypeId with #[update(fallback)] so the
existing salsa::Update derive compiles. Preserve GlobalTypeId’s current wrapper
and derives.

In `@crates/biome_js_type_info/src/type_data.rs`:
- Around line 54-63: Update RawTypeId::new and the affected module_resolver call
sites so Import and Full resolver levels are represented without panicking,
preserving correct ResolvedTypeId behavior. Adjust the representation or
construction path consistently, then add regression coverage for namespace
imports and module-0 mapping.

In `@crates/biome_module_graph/src/db/queries/css.rs`:
- Line 19: Add regression tests for the query behavior changes around the
tracked query declaration and the traversal logic in the affected
importer/parent-node query paths. Verify stable importer and parent-node
outputs, duplicate handling, and traversal order; also add Salsa
reuse/selectivity coverage showing unrelated edits reuse results while
dependency edits recompute them.

In `@crates/biome_module_graph/src/js_module_info/collector.rs`:
- Around line 383-401: Prevent dangling JsOwnExport::Type IDs by updating the
FinalisedModuleTypes construction in
crates/biome_module_graph/src/js_module_info/collector.rs lines 383-401 to skip
type-based export collection when inference_mode is TypeInferenceMode::Disabled,
or retain the raw_types entries referenced by those exports; additionally, in
crates/biome_module_graph/src/db/type_inference/imports.rs line 677, add the
js_info.infer_types guard before reading js_info.exports, matching
collect_namespace_names_in_module.

---

Nitpick comments:
In `@crates/biome_js_type_info/src/globals_ids.rs`:
- Around line 70-72: Update the documentation for the predefined_globals macro
to no longer claim that roles are expanded, since the $role column is matched
and discarded. Either describe the column as reserved or remove it from the
macro matcher and all manifest rows, preserving the existing generated IDs,
names, aliases, and lookup behavior.

In `@crates/biome_js_type_info/src/local_inference.rs`:
- Around line 1674-1684: Update the parameter type construction around ty_data
to avoid cloning TypeData in either branch: register the collector reference
from a borrow while preserving ty_data for the later unnamed-binding path near
line 1697. Keep the optional-parameter undefined wrapping behavior unchanged and
ensure the named-parameter path does not perform an unnecessary clone.
- Line 2294: Update crates/biome_js_type_info/src/local_inference.rs at lines
2294, 2408, and 1681 to construct optional references through
RawTypeCollector::reference_to_id: obtain the optional type with
collector.optional(ty), then pass that ID to collector.reference_to_id instead
of constructing RawTypeId::Local inline. Apply this in the surrounding
optional-type logic, including from_name_and_optional_type and
from_binding_with_annotation.

In `@crates/biome_js_type_info/src/type_store.rs`:
- Around line 173-195: Remove the duplicate UnionCollector definition from
resolver.rs and use type_store::UnionCollector in biome_module_graph. Simplify
UnionCollector::finish to return TypeData directly, preserving the unknown
result for empty collections and the union result otherwise, and update its
callers to match.
- Around line 14-30: Update TypeStore::from_types to check table.find for an
existing equal TypeData before inserting each index, ensuring repeated values
map to one canonical lookup entry while preserving the original types vector and
positional get_by_id behavior.

In `@crates/biome_module_graph/src/js_module_info/collector.rs`:
- Around line 885-887: Update the diagnostic insertion logic in the surrounding
collector method so it checks whether diagnostics already contains the
exceeded-types-limit variant, rather than whether diagnostics is empty. Add
JsModuleInfoDiagnostic::exceeded_types_limit() only when that specific
diagnostic is absent, preserving unrelated diagnostics.
- Around line 694-704: Update the explanatory comment above the
TypeReference::Resolved(RawTypeId::Local(resolved_member)) match to describe the
current TypeStore-based raw-reference handling and why local resolved references
are safe to use during collection. Remove the outdated references to
as_raw_data() and apply_module_id_to_reference().
πŸͺ„ Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
βš™οΈ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 67ab2241-08c5-4348-8644-faff7f6c7a84

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between d4f501a and 0aee9ad.

β›” Files ignored due to path filters (11)
  • Cargo.lock is excluded by !**/*.lock and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useAwaitThenable/thenableInvalid.ts.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useAwaitThenable/thenableValid.ts.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_type_info/tests/snapshots/infer_type_of_array.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_type_info/tests/snapshots/infer_type_of_async_function.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_type_info/tests/snapshots/infer_type_of_binary_expression_eq.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_type_info/tests/snapshots/infer_type_of_binary_expression_ne.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_type_info/tests/snapshots/infer_type_of_destructured_array_element.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_type_info/tests/snapshots/infer_type_of_function_with_destructured_arguments.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_type_info/tests/snapshots/infer_type_of_literal.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_type_info/tests/snapshots/infer_type_of_promise_returning_function.snap is excluded by !**/*.snap and included by **
πŸ“’ Files selected for processing (37)
  • crates/biome_js_analyze/tests/specs/nursery/useAwaitThenable/thenableValid.ts
  • crates/biome_js_type_info/CONTRIBUTING.md
  • crates/biome_js_type_info/Cargo.toml
  • crates/biome_js_type_info/src/format_inferred_type_info.rs
  • crates/biome_js_type_info/src/format_type_info.rs
  • crates/biome_js_type_info/src/globals.rs
  • crates/biome_js_type_info/src/globals_builder.rs
  • crates/biome_js_type_info/src/globals_ids.rs
  • crates/biome_js_type_info/src/interned_types.rs
  • crates/biome_js_type_info/src/lib.rs
  • crates/biome_js_type_info/src/local_inference.rs
  • crates/biome_js_type_info/src/type_data.rs
  • crates/biome_js_type_info/src/type_data/literal.rs
  • crates/biome_js_type_info/src/type_store.rs
  • crates/biome_js_type_info/tests/local_inference.rs
  • crates/biome_js_type_info/tests/utils.rs
  • crates/biome_module_graph/Cargo.toml
  • crates/biome_module_graph/src/db/mod.rs
  • crates/biome_module_graph/src/db/queries/css.rs
  • crates/biome_module_graph/src/db/type_inference/imports.rs
  • crates/biome_module_graph/src/db/type_inference/promise_classification.rs
  • crates/biome_module_graph/src/db/type_inference/resolver.rs
  • crates/biome_module_graph/src/format_module_graph.rs
  • crates/biome_module_graph/src/js_module_info.rs
  • crates/biome_module_graph/src/js_module_info/binding.rs
  • crates/biome_module_graph/src/js_module_info/collector.rs
  • crates/biome_module_graph/src/js_module_info/diagnostics.rs
  • crates/biome_module_graph/src/js_module_info/utils.rs
  • crates/biome_module_graph/src/lib.rs
  • crates/biome_module_graph/src/type_inference/context.rs
  • crates/biome_module_graph/tests/snap/mod.rs
  • crates/biome_module_graph/tests/spec_tests_v2.rs
  • crates/biome_module_graph/tests/spec_tests_v2/expected_argument_inference.test.rs
  • crates/biome_module_graph/tests/spec_tests_v2/globals.test.rs
  • crates/biome_service/src/file_handlers/javascript.rs
  • crates/biome_test_utils/src/lib.rs
  • crates/biome_workspace_db/src/lib.rs
πŸ’€ Files with no reviewable changes (2)
  • crates/biome_module_graph/src/js_module_info/utils.rs
  • crates/biome_js_analyze/tests/specs/nursery/useAwaitThenable/thenableValid.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/biome_module_graph/src/db/type_inference/resolver.rs

Comment thread crates/biome_js_type_info/Cargo.toml Resolved
@github-actions github-actions Bot added A-Linter Area: linter and removed A-Linter Area: linter labels Aug 3, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (10)
crates/biome_module_graph/src/db/type_inference/qualifiers.rs (1)

248-257: πŸ“ Maintainability & Code Quality | πŸ”΅ Trivial | ⚑ Quick win

Add regression coverage for global type qualifiers. Add tests for Symbol.dispose and Symbol.asyncDispose, plus a multi-member global type qualifier that exercises sequential traversal. The existing globalThis.Promise test covers an expression chain, not TypeReferenceQualifier.

πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/biome_module_graph/src/db/type_inference/qualifiers.rs` around lines
248 - 257, Add regression tests for TypeReferenceQualifier covering
Symbol.dispose and Symbol.asyncDispose, plus a multi-member global type
qualifier that verifies sequential traversal. Place the coverage alongside the
existing globalThis.Promise test, ensuring the new cases exercise type
qualifiers rather than expression-chain resolution.

Source: Coding guidelines

crates/biome_module_graph/tests/spec_tests/module_resolution.test.rs (2)

72-80: πŸ“ Maintainability & Code Quality | πŸ”΅ Trivial | πŸ’€ Low value

Remove the stray fixture path.

project() never inserts /src/components/Hello.tsx into the filesystem, and this test only asserts on /src/index.ts. The extra path looks like a leftover from the path-alias test and can confuse the next reader.

♻️ Proposed cleanup
     let db = build_js_db(
         &fs,
         &layout,
-        &[
-            BiomePath::new("/src/index.ts"),
-            BiomePath::new("/src/components/Hello.tsx"),
-        ],
+        &[BiomePath::new("/src/index.ts")],
         true,
     );
πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/biome_module_graph/tests/spec_tests/module_resolution.test.rs` around
lines 72 - 80, Remove the unused /src/components/Hello.tsx entry from the file
list passed to build_js_db in the affected test, leaving only /src/index.ts
while preserving the existing project setup and assertions.

30-42: πŸ“ Maintainability & Code Quality | πŸ”΅ Trivial | πŸ’€ Low value

Use the imported helper name.

Line 1 imports deserialize_from_json_str, and line 135 uses it. These two call sites still spell out biome_deserialize::json::deserialize_from_json_str. Please make them consistent.

Also applies to: 216-224

πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/biome_module_graph/tests/spec_tests/module_resolution.test.rs` around
lines 30 - 42, Update the manifest deserialization call sites in the test setup
and the corresponding location around the second noted block to use the imported
deserialize_from_json_str helper directly instead of the fully qualified
biome_deserialize::json::deserialize_from_json_str path, keeping behavior
unchanged.
crates/biome_module_graph/tests/spec_tests/requests.test.rs (1)

26-41: πŸ“ Maintainability & Code Quality | πŸ”΅ Trivial | πŸ’€ Low value

The lookup depends on map iteration order.

raw_expressions.keys().find(...) returns the first key in iteration order. If two expressions in a fixture ever trim to the same snippet, the selected range becomes unstable. The current fixtures each have one match, so this is not a live bug. Sorting the candidates by range start, or asserting a single match, would keep future fixtures safe.

πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/biome_module_graph/tests/spec_tests/requests.test.rs` around lines 26
- 41, The expression_range_by_source helper currently selects an arbitrary
matching range based on raw_expressions iteration order. Collect all ranges
whose source snippet matches expected, then sort candidates by range start
before selecting one, or assert that exactly one match exists; preserve the
existing panic when no matching expression is found.
crates/biome_module_graph/tests/spec_tests/css_properties.test.rs (1)

228-278: πŸ“ Maintainability & Code Quality | πŸ”΅ Trivial | πŸ’€ Low value

Three tests overlap completely.

css_property_query_traverses_js_importers already contains both assertions. The first assertion duplicates css_property_query_preserves_js_import_order. The second duplicates css_property_query_skips_non_css_sibling_imports. Consider keeping the two focused tests and removing the combined one, or the reverse. Either way one of the three can go.

πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/biome_module_graph/tests/spec_tests/css_properties.test.rs` around
lines 228 - 278, Remove the redundant css_property_query_traverses_js_importers
test, since its assertions are already covered by
css_property_query_preserves_js_import_order and
css_property_query_skips_non_css_sibling_imports. Keep the two focused tests
unchanged.
crates/biome_module_graph/tests/spec_tests/html_classes.test.rs (1)

12-34: πŸ“ Maintainability & Code Quality | πŸ”΅ Trivial | πŸ’€ Low value

Bind the markup once.

The same "<div class=\"card\"></div>" literal appears at line 18 and line 25. If one copy changes, the file content in the memory filesystem and the parsed source diverge without any test failing. Also, CssFileSource and WorkspaceDb are written fully qualified while HtmlFileSource is imported at line 2.

♻️ Suggested tidy-up
+use biome_languages::CssFileSource;
+use biome_workspace_db::WorkspaceDb;
+
 fn classes(
     path: &str,
     source: HtmlFileSource,
-    styles: &[(&str, biome_languages::CssFileSource)],
-) -> (biome_workspace_db::WorkspaceDb, Vec<String>) {
+    styles: &[(&str, CssFileSource)],
+) -> (WorkspaceDb, Vec<String>) {
+    const MARKUP: &str = "<div class=\"card\"></div>";
     let fs = MemoryFileSystem::default();
-    fs.insert(path.into(), "<div class=\"card\"></div>");
+    fs.insert(path.into(), MARKUP);
     let embedded = styles
         .iter()
         .map(|(css, source)| parse_embedded_css(css, *source))
         .collect();
-    let db = build_html_db(
-        &fs,
-        &[(path, "<div class=\"card\"></div>", source, embedded)],
-    );
+    let db = build_html_db(&fs, &[(path, MARKUP, source, embedded)]);
πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/biome_module_graph/tests/spec_tests/html_classes.test.rs` around lines
12 - 34, Update the classes helper to bind the shared HTML markup string once
and reuse it for both fs.insert and build_html_db, preventing the filesystem
content and parsed source from diverging. Also use the existing imports for
CssFileSource and WorkspaceDb instead of fully qualified names, while preserving
the helper’s behavior.
crates/biome_module_graph/tests/spec_tests.rs (2)

138-153: πŸ“ Maintainability & Code Quality | πŸ”΅ Trivial | πŸ’€ Low value

Consider delegating to module_for_key.

crates/biome_module_graph/src/db/mod.rs already exposes module_for_key, which performs the same path lookup and stale-key rejection. The import list at line 29 already includes it.

♻️ Suggested simplification
     fn local_type_name(
         &self,
         module_key: InferredModuleKey,
         type_id: InferredLocalTypeId,
     ) -> Option<Text> {
-        let module = ModuleInfo::from_id(module_key.as_id());
-        let current = self.module_for_path(module.path(self))?;
-        if InferredModuleKey::new(current.as_id()) != module_key {
-            return None;
-        }
-
-        let ModuleInfoKind::Js(info) = current.kind(self) else {
+        let current = module_for_key(self, module_key)?;
+        let ModuleInfoKind::Js(info) = current.kind(self) else {
             return None;
         };
         info.local_type_name(type_id)
     }
πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/biome_module_graph/tests/spec_tests.rs` around lines 138 - 153, Update
local_type_name to delegate module resolution to the existing module_for_key
helper instead of duplicating ModuleInfo path lookup and stale-key validation;
retain the JavaScript-kind check and info.local_type_name(type_id) call after
obtaining the module.

682-704: πŸ“ Maintainability & Code Quality | πŸ”΅ Trivial | ⚑ Quick win

Reuse snap::write_source_file instead of a second copy.

crates/biome_module_graph/tests/snap/mod.rs lines 137-192 already define a public write_source_file with the same signature, and mod snap; is registered at line 86. This local copy only handles the JavaScript branch, so the two helpers will drift, and any HTML or CSS fixture passed to assert_inferred_type_snapshot will print unformatted source here while the other path formats it.

Call snap::write_source_file and delete the local function.

πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/biome_module_graph/tests/spec_tests.rs` around lines 682 - 704, In the
snapshot test flow, replace the local write_source_file implementation with a
call to the existing public snap::write_source_file helper, then delete the
duplicate local function. Preserve the current callers, including
assert_inferred_type_snapshot, so all supported fixture types use the shared
formatting behavior.
crates/biome_module_graph/tests/spec_tests/promises.test.rs (1)

7-23: πŸ“ Maintainability & Code Quality | πŸ”΅ Trivial | ⚑ Quick win

Two copies of the same expression-range lookup, both taking the first text match. Each helper scans raw_expressions and accepts the first range whose collapsed source text equals the expected string. Fixtures that repeat an expression therefore measure an arbitrary occurrence, and the duplication means a fix must be applied twice. Promote one helper into crates/biome_module_graph/tests/spec_tests.rs next to source_snippet, and make it reject ambiguous matches.

  • crates/biome_module_graph/tests/spec_tests/promises.test.rs#L7-L23: drop the inline range lookup and call the shared helper, keeping only the infer_expression_function_returns_promise call.
  • crates/biome_module_graph/tests/spec_tests/queries.test.rs#L24-L39: delete expression_range_by_source and use the shared helper from the parent module.
πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/biome_module_graph/tests/spec_tests/promises.test.rs` around lines 7 -
23, Centralize expression-range lookup in a shared helper next to source_snippet
in crates/biome_module_graph/tests/spec_tests.rs, making it reject ambiguous
source-text matches instead of selecting the first. In
crates/biome_module_graph/tests/spec_tests/promises.test.rs lines 7-23, remove
the inline lookup and call the shared helper before
infer_expression_function_returns_promise; in
crates/biome_module_graph/tests/spec_tests/queries.test.rs lines 24-39, delete
expression_range_by_source and use the shared helper, with no other changes.
crates/biome_module_graph/tests/spec_tests/calls.test.rs (1)

279-294: πŸ“ Maintainability & Code Quality | πŸ”΅ Trivial | πŸ’€ Low value

Extract the repeated callable-type lookup.

Six blocks scan inferred.types for a Reader interface or object with a given number of call signatures. Only the name and the expected count change. A pair of helpers keeps each test focused on the behaviour under test.

♻️ Suggested helpers
fn inferred_interface_with_call_signatures<'db>(
    db: &'db TestModuleDb,
    inferred: &InferredModuleTypes<'db>,
    name: &str,
    count: usize,
) -> InferredTypeData<'db> {
    inferred
        .types
        .iter()
        .copied()
        .find(|ty| {
            matches!(
                ty,
                InferredTypeData::Interface(interface)
                    if interface.name(db).text() == name
                        && interface
                            .members(db)
                            .iter()
                            .filter(|member| member.kind.is_call_signature())
                            .count()
                            == count
            )
        })
        .unwrap_or_else(|| panic!("{name} interface type must be inferred"))
}

Also applies to: 318-335, 373-390, 428-445, 481-495, 519-535

πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/biome_module_graph/tests/spec_tests/calls.test.rs` around lines 279 -
294, Extract the repeated inferred-type lookup into an
inferred_interface_with_call_signatures helper near the shared test utilities,
accepting the database, inferred types, interface name, and expected
call-signature count. Replace all six Reader/object lookup blocks, including the
block around reader_ty and the additional referenced ranges, with calls to this
helper while preserving each test’s existing name and expected count.
πŸ€– Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@crates/biome_module_graph/src/db/type_inference/qualifiers.rs`:
- Around line 248-257: Add regression tests for TypeReferenceQualifier covering
Symbol.dispose and Symbol.asyncDispose, plus a multi-member global type
qualifier that verifies sequential traversal. Place the coverage alongside the
existing globalThis.Promise test, ensuring the new cases exercise type
qualifiers rather than expression-chain resolution.

In `@crates/biome_module_graph/tests/spec_tests.rs`:
- Around line 138-153: Update local_type_name to delegate module resolution to
the existing module_for_key helper instead of duplicating ModuleInfo path lookup
and stale-key validation; retain the JavaScript-kind check and
info.local_type_name(type_id) call after obtaining the module.
- Around line 682-704: In the snapshot test flow, replace the local
write_source_file implementation with a call to the existing public
snap::write_source_file helper, then delete the duplicate local function.
Preserve the current callers, including assert_inferred_type_snapshot, so all
supported fixture types use the shared formatting behavior.

In `@crates/biome_module_graph/tests/spec_tests/calls.test.rs`:
- Around line 279-294: Extract the repeated inferred-type lookup into an
inferred_interface_with_call_signatures helper near the shared test utilities,
accepting the database, inferred types, interface name, and expected
call-signature count. Replace all six Reader/object lookup blocks, including the
block around reader_ty and the additional referenced ranges, with calls to this
helper while preserving each test’s existing name and expected count.

In `@crates/biome_module_graph/tests/spec_tests/css_properties.test.rs`:
- Around line 228-278: Remove the redundant
css_property_query_traverses_js_importers test, since its assertions are already
covered by css_property_query_preserves_js_import_order and
css_property_query_skips_non_css_sibling_imports. Keep the two focused tests
unchanged.

In `@crates/biome_module_graph/tests/spec_tests/html_classes.test.rs`:
- Around line 12-34: Update the classes helper to bind the shared HTML markup
string once and reuse it for both fs.insert and build_html_db, preventing the
filesystem content and parsed source from diverging. Also use the existing
imports for CssFileSource and WorkspaceDb instead of fully qualified names,
while preserving the helper’s behavior.

In `@crates/biome_module_graph/tests/spec_tests/module_resolution.test.rs`:
- Around line 72-80: Remove the unused /src/components/Hello.tsx entry from the
file list passed to build_js_db in the affected test, leaving only /src/index.ts
while preserving the existing project setup and assertions.
- Around line 30-42: Update the manifest deserialization call sites in the test
setup and the corresponding location around the second noted block to use the
imported deserialize_from_json_str helper directly instead of the fully
qualified biome_deserialize::json::deserialize_from_json_str path, keeping
behavior unchanged.

In `@crates/biome_module_graph/tests/spec_tests/promises.test.rs`:
- Around line 7-23: Centralize expression-range lookup in a shared helper next
to source_snippet in crates/biome_module_graph/tests/spec_tests.rs, making it
reject ambiguous source-text matches instead of selecting the first. In
crates/biome_module_graph/tests/spec_tests/promises.test.rs lines 7-23, remove
the inline lookup and call the shared helper before
infer_expression_function_returns_promise; in
crates/biome_module_graph/tests/spec_tests/queries.test.rs lines 24-39, delete
expression_range_by_source and use the shared helper, with no other changes.

In `@crates/biome_module_graph/tests/spec_tests/requests.test.rs`:
- Around line 26-41: The expression_range_by_source helper currently selects an
arbitrary matching range based on raw_expressions iteration order. Collect all
ranges whose source snippet matches expected, then sort candidates by range
start before selecting one, or assert that exactly one match exists; preserve
the existing panic when no matching expression is found.

ℹ️ Review info
βš™οΈ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 74ff2d09-623f-455d-b468-960da900a294

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 0aee9ad and 85b7819.

β›” Files ignored due to path filters (73)
  • crates/biome_js_analyze/tests/specs/nursery/useDisposables/valid.ts.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_call_expression_type_deduplicates_substituted_union_return_type.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_call_expression_type_resolves_union_function_return_type.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_call_expression_type_selects_callable_interface_overload_by_arity.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_call_expression_type_selects_callable_interface_overload_with_optional_parameter_by_arity.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_call_expression_type_selects_callable_interface_overload_with_rest_parameter_by_arity.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_call_expression_type_selects_callable_object_overload_by_arity.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_call_expression_type_selects_function_declaration_overload_by_callback_return_type.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_call_expression_type_selects_imported_function_declaration_overload_by_callback_return_type.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_call_expression_type_substitutes_chained_generic_default_from_argument.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_call_expression_type_substitutes_chained_generic_defaults.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_call_expression_type_substitutes_generic_from_callback_promise_return_type.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_call_expression_type_substitutes_generic_from_callback_promise_union_return_type.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_call_expression_type_substitutes_generic_inside_intersection_return_type.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_call_expression_type_substitutes_generic_inside_promise_union_return_type.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_call_expression_type_substitutes_generic_inside_union_with_promise_return_type.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_call_expression_type_substitutes_multiple_generics_inside_union_return_type.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_call_expression_type_substitutes_nested_generic_return_type.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_calls_imported_generic_function_type_aliases.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_coerces_tuples_in_additions.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_evaluates_arithmetic_unary_expressions_on_build.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_evaluates_array_element_expressions_on_build.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_evaluates_await_expressions_on_build.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_evaluates_await_local_union_expressions_on_build.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_evaluates_await_promise_like_expressions_on_build.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_evaluates_await_union_expressions_on_build.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_evaluates_call_expressions_on_build.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_evaluates_conditional_logical_expressions_on_build.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_evaluates_conditional_logical_fast_paths_on_build.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_evaluates_destructuring_edge_expressions_on_build.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_evaluates_destructuring_expressions_on_build.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_evaluates_new_expressions_on_build.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_evaluates_static_member_expressions_on_build.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_evaluates_this_and_super_edge_expressions_on_build.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_evaluates_this_and_super_expressions_on_build.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_evaluates_typeof_operator_on_build.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_filters_conditional_subsets_on_build.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_infers_new_expression_nested_generic_instances_on_build.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_keeps_overloads_viable_for_partially_modelled_arguments_on_build.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_merges_class_instance_intersections_on_build.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_merges_function_intersections_on_build.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_merges_inline_object_intersections_on_build.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_merges_mixed_intersections_on_build.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_normalizes_intersection_variants_on_build.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_normalizes_primitive_intersections_on_build.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_normalizes_union_variants_on_build.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_preserves_floating_promise_shapes.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_preserves_generic_class_this_parameters.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_preserves_generic_interface_instantiation_parameters.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_preserves_new_expression_generic_instances_on_build.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_preserves_optional_chain_short_circuit_types_on_build.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_resolves_builtin_global_identities_on_build.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_resolves_generic_builtin_instances_on_build.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_resolves_inherited_static_members.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_resolves_namespace_import_members.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_resolves_namespace_reexport_members.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_resolves_promise_member_chain.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_resolves_record_index_signature_on_build.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_resolves_this_member_in_object_method.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_resolves_utility_type_members_on_build.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_selects_call_overloads_by_interface_call_signatures_on_build.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_selects_call_overloads_by_nominal_class_parameters_on_build.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_selects_call_overloads_by_parameter_types_on_build.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_selects_call_overloads_by_required_object_members_on_build.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_selects_call_overloads_for_array_and_optional_tuple_spreads_on_build.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_selects_call_overloads_for_subclass_arguments_on_build.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_infer_module_types_substitutes_callback_returns_through_type_aliases_on_build.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_normalize_type_collapses_equal_merged_reference_targets.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_normalize_type_preserves_recursive_array_local_edge.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_normalize_type_preserves_recursive_local_edge.snap is excluded by !**/*.snap and included by **
  • crates/biome_module_graph/tests/snapshots/test_normalize_type_resolves_typeof_type.snap is excluded by !**/*.snap and included by **
  • crates/biome_service/src/snapshots/biome_service__workspace__tests__debug_type_info.snap is excluded by !**/*.snap and included by **
  • crates/biome_service/src/snapshots/module_diagnostic.snap is excluded by !**/*.snap and included by **
πŸ“’ Files selected for processing (33)
  • crates/biome_js_analyze/tests/specs/nursery/useDisposables/valid.ts
  • crates/biome_js_type_info/Cargo.toml
  • crates/biome_js_type_info/src/interned_types.rs
  • crates/biome_js_type_info/src/local_inference.rs
  • crates/biome_js_type_info/src/type_data.rs
  • crates/biome_js_type_info/tests/type_data.rs
  • crates/biome_module_graph/Cargo.toml
  • crates/biome_module_graph/src/db/type_inference/qualifiers.rs
  • crates/biome_module_graph/tests/snap/mod.rs
  • crates/biome_module_graph/tests/spec_tests.rs
  • crates/biome_module_graph/tests/spec_tests/calls.test.rs
  • crates/biome_module_graph/tests/spec_tests/css_classes.test.rs
  • crates/biome_module_graph/tests/spec_tests/css_properties.test.rs
  • crates/biome_module_graph/tests/spec_tests/cycles.test.rs
  • crates/biome_module_graph/tests/spec_tests/database.test.rs
  • crates/biome_module_graph/tests/spec_tests/expected_argument_inference.test.rs
  • crates/biome_module_graph/tests/spec_tests/expressions.test.rs
  • crates/biome_module_graph/tests/spec_tests/globals.test.rs
  • crates/biome_module_graph/tests/spec_tests/html_classes.test.rs
  • crates/biome_module_graph/tests/spec_tests/html_components.test.rs
  • crates/biome_module_graph/tests/spec_tests/imports.test.rs
  • crates/biome_module_graph/tests/spec_tests/intersections.test.rs
  • crates/biome_module_graph/tests/spec_tests/js_doc.test.rs
  • crates/biome_module_graph/tests/spec_tests/module_resolution.test.rs
  • crates/biome_module_graph/tests/spec_tests/normalization.test.rs
  • crates/biome_module_graph/tests/spec_tests/overloads.test.rs
  • crates/biome_module_graph/tests/spec_tests/promises.test.rs
  • crates/biome_module_graph/tests/spec_tests/queries.test.rs
  • crates/biome_module_graph/tests/spec_tests/requests.test.rs
  • crates/biome_module_graph/tests/spec_tests/substitutions.test.rs
  • crates/biome_module_graph/tests/spec_tests/support.rs
  • crates/biome_module_graph/tests/spec_tests/types.test.rs
  • crates/biome_module_graph/tests/spec_tests_v2.rs
πŸ’€ Files with no reviewable changes (2)
  • crates/biome_js_type_info/tests/type_data.rs
  • crates/biome_module_graph/tests/snap/mod.rs
🚧 Files skipped from review as they are similar to previous changes (4)
  • crates/biome_js_type_info/Cargo.toml
  • crates/biome_js_type_info/src/interned_types.rs
  • crates/biome_js_type_info/src/type_data.rs
  • crates/biome_js_type_info/src/local_inference.rs

@ematipico
ematipico force-pushed the 17-prepare-legacy-type-removal branch from 85b7819 to 4786ad2 Compare August 4, 2026 06:35
@ematipico
ematipico requested review from a team August 4, 2026 14:28
@ematipico

Copy link
Copy Markdown
Member Author

The regressions are false positives

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

Labels

A-Linter Area: linter A-Project Area: project A-Type-Inference Area: type inference agentscan:mixed-signals L-JavaScript Language: JavaScript and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant