+
Skip to content

Conversation

arendjr
Copy link
Contributor

@arendjr arendjr commented Aug 5, 2025

Summary

Fixed #7111: Imported symbols using aliases are now correctly recognised.

Also squeezed in a tiny optimisation for the resolver, to avoid allocations when someone has typeRoots in their tsconfig.json.

Test Plan

Test added.

Copy link

changeset-bot bot commented Aug 5, 2025

🦋 Changeset detected

Latest commit: b6c0c8c

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

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

Not sure what this means? Click here to learn what changesets are.

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

@github-actions github-actions bot added A-Linter Area: linter A-Parser Area: parser L-JavaScript Language: JavaScript and super languages A-Resolver Area: resolver labels Aug 5, 2025
"{base_dir}/node_modules/sleep/dist/src/index.d.ts"
)))
);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test is another bonus. I suspected there was an issue in this area, but there wasn't. At least we have extra coverage now.

Copy link
Contributor

coderabbitai bot commented Aug 5, 2025

Walkthrough

This set of changes addresses the handling of aliased imports in the symbol resolution logic, specifically ensuring that the noFloatingPromises rule detects floating promises even when the imported symbol is accessed via an alias. The implementation refactors how named import specifiers are parsed, updates the resolver to better handle type roots, and introduces a new iterator for explicit type roots. Tests have been updated and expanded to cover scenarios involving aliased imports and to verify type definition resolution without explicit type specification.

Assessment against linked issues

Objective Addressed Explanation
Ensure noFloatingPromises detects floating promises when imported symbols are aliased (#7111)
Update test coverage for aliased imports and floating promise detection (#7111)
Refactor import parsing and symbol resolution to support aliasing (#7111)

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
Refactoring and generalisation of type roots handling, including new enum variant and iterator (crates/biome_resolver/src/lib.rs) This change is not directly related to the detection of floating promises with aliased imports as per #7111.
Addition of a new resolver test for type definitions without type specification (crates/biome_resolver/tests/spec_tests.rs) This test concerns type definition resolution, not floating promises or import aliasing as per #7111.

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6b541fb and b6c0c8c.

⛔ Files ignored due to path filters (7)
  • crates/biome_js_analyze/tests/specs/nursery/noFloatingPromises/invalid.ts.snap is excluded by !**/*.snap
  • crates/biome_resolver/tests/fixtures/resolver_cases_5/node_modules/sleep/dist/index.cjs is excluded by !**/dist/**, !**/node_modules/**
  • crates/biome_resolver/tests/fixtures/resolver_cases_5/node_modules/sleep/dist/index.d.ts is excluded by !**/dist/**, !**/node_modules/**
  • crates/biome_resolver/tests/fixtures/resolver_cases_5/node_modules/sleep/dist/index.js is excluded by !**/dist/**, !**/node_modules/**
  • crates/biome_resolver/tests/fixtures/resolver_cases_5/node_modules/sleep/dist/src/index.d.ts is excluded by !**/dist/**, !**/node_modules/**
  • crates/biome_resolver/tests/fixtures/resolver_cases_5/node_modules/sleep/dist/src/sleep.d.ts is excluded by !**/dist/**, !**/node_modules/**
  • crates/biome_resolver/tests/fixtures/resolver_cases_5/node_modules/sleep/package.json is excluded by !**/node_modules/**
📒 Files selected for processing (6)
  • .changeset/aliased-antilopes-acknowledge.md (1 hunks)
  • crates/biome_js_analyze/tests/quick_test.rs (1 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/noFloatingPromises/invalid.ts (2 hunks)
  • crates/biome_js_syntax/src/import_ext.rs (1 hunks)
  • crates/biome_resolver/src/lib.rs (4 hunks)
  • crates/biome_resolver/tests/spec_tests.rs (1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
.changeset/*.md

📄 CodeRabbit Inference Engine (CONTRIBUTING.md)

.changeset/*.md: Changeset descriptions should be about user-facing changes, use past tense for what you did, present tense for Biome behavior, reference issues/rules/assists with links, include code blocks when applicable, and end every sentence with a full stop.
Headers in changesets should use #### or ##### only; other headers may break the changelog.

Files:

  • .changeset/aliased-antilopes-acknowledge.md
**/*.{rs,toml}

📄 CodeRabbit Inference Engine (CLAUDE.md)

Format code (Rust + TOML) using just format

Format Rust and TOML files using just f (alias for just format).

Files:

  • crates/biome_js_analyze/tests/quick_test.rs
  • crates/biome_js_syntax/src/import_ext.rs
  • crates/biome_resolver/tests/spec_tests.rs
  • crates/biome_resolver/src/lib.rs
crates/biome_*/**/*

📄 CodeRabbit Inference Engine (CLAUDE.md)

Core crates must be located in /crates/biome_*/

Files:

  • crates/biome_js_analyze/tests/quick_test.rs
  • crates/biome_js_analyze/tests/specs/nursery/noFloatingPromises/invalid.ts
  • crates/biome_js_syntax/src/import_ext.rs
  • crates/biome_resolver/tests/spec_tests.rs
  • crates/biome_resolver/src/lib.rs
**/*.rs

📄 CodeRabbit Inference Engine (CONTRIBUTING.md)

Update documentation for new features or changes, using inline rustdoc for rules, assists, and their options.

Files:

  • crates/biome_js_analyze/tests/quick_test.rs
  • crates/biome_js_syntax/src/import_ext.rs
  • crates/biome_resolver/tests/spec_tests.rs
  • crates/biome_resolver/src/lib.rs
🧠 Learnings (36)
📓 Common learnings
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:23.437Z
Learning: Applies to crates/biome_js_type_info/../biome_module_graph/src/js_module_info/scoped_resolver.rs : Full inference should resolve all remaining `TypeReference::Import` variants to `TypeReference::Resolved` using the complete module graph. Implemented in `../biome_module_graph/src/js_module_info/scoped_resolver.rs`.
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:23.437Z
Learning: Applies to crates/biome_js_type_info/src/resolver.rs : Implement and maintain the `TypeResolver` trait in `src/resolver.rs`, with separate implementations for hardcoded symbols, globals, module info collection, and full module resolution.
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:23.437Z
Learning: Applies to crates/biome_js_type_info/../biome_module_graph/src/js_module_info/collector.rs : Module-level (thin) inference should resolve `TypeReference::Qualifier` variants to `TypeReference::Resolved` or `TypeReference::Import` as appropriate, but cannot resolve imports across modules. Implemented in `../biome_module_graph/src/js_module_info/collector.rs`.
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:23.437Z
Learning: Prioritize IDE support and instantaneous diagnostics updates across modules in the design and implementation of type inference and module graph logic.
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:59.193Z
Learning: Use the noImportCycles rule to observe the state in the project layout and module graph
📚 Learning: the file `packages/@biomejs/biome/configuration_schema.json` is auto-generated and should not be man...
Learnt from: dyc3
PR: biomejs/biome#7081
File: packages/@biomejs/biome/configuration_schema.json:7765-7781
Timestamp: 2025-08-05T14:43:29.581Z
Learning: The file `packages/@biomejs/biome/configuration_schema.json` is auto-generated and should not be manually edited or reviewed for schema issues; any changes should be made at the code generation source.

Applied to files:

  • .changeset/aliased-antilopes-acknowledge.md
📚 Learning: test rules using quick tests in the appropriate test file (e.g., `biome_js_analyze/tests/quick_test....
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Test rules using quick tests in the appropriate test file (e.g., `biome_js_analyze/tests/quick_test.rs`) and snapshot tests in `tests/specs/`.

Applied to files:

  • crates/biome_js_analyze/tests/quick_test.rs
📚 Learning: applies to crates/biome_service/src/workspace/watcher.tests.rs : add tests for watcher workspace met...
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:59.193Z
Learning: Applies to crates/biome_service/src/workspace/watcher.tests.rs : Add tests for watcher workspace methods in watcher.tests.rs (src/workspace/watcher.tests.rs)

Applied to files:

  • crates/biome_js_analyze/tests/quick_test.rs
  • crates/biome_resolver/tests/spec_tests.rs
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : update the `language` field in `...
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : Update the `language` field in `declare_lint_rule!` to match the language the rule applies to (e.g., `js`, `jsx`, `ts`, `tsx`).

Applied to files:

  • crates/biome_js_analyze/tests/quick_test.rs
  • crates/biome_js_analyze/tests/specs/nursery/noFloatingPromises/invalid.ts
  • crates/biome_js_syntax/src/import_ext.rs
📚 Learning: applies to crates/biome_formatter/tests/spec_tests.rs : update the `spec_tests.rs` file to generate ...
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/tests/spec_tests.rs : Update the `spec_tests.rs` file to generate a test function for each `.html` file found inside `tests/specs/html` using the `tests_macros::gen_tests!` macro.

Applied to files:

  • crates/biome_js_analyze/tests/quick_test.rs
  • crates/biome_resolver/tests/spec_tests.rs
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : each code block in rule document...
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : Each code block in rule documentation must specify a language and use `expect_diagnostic` for invalid examples.

Applied to files:

  • crates/biome_js_analyze/tests/quick_test.rs
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : when banning certain functions o...
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : When banning certain functions or variables, always check if the variable is global using the semantic model to avoid false positives.

Applied to files:

  • crates/biome_js_analyze/tests/quick_test.rs
  • crates/biome_js_analyze/tests/specs/nursery/noFloatingPromises/invalid.ts
📚 Learning: applies to crates/biome_service/../biome_lsp/src/server.tests.rs : add end-to-end tests for watcher ...
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:59.193Z
Learning: Applies to crates/biome_service/../biome_lsp/src/server.tests.rs : Add end-to-end tests for watcher functionality in LSP tests (../biome_lsp/src/server.tests.rs)

Applied to files:

  • crates/biome_js_analyze/tests/quick_test.rs
  • crates/biome_resolver/tests/spec_tests.rs
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : new rules must be placed inside ...
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : New rules must be placed inside the `nursery` group for incubation before promotion.

Applied to files:

  • crates/biome_js_analyze/tests/quick_test.rs
  • crates/biome_js_analyze/tests/specs/nursery/noFloatingPromises/invalid.ts
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : when implementing the `run` func...
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : When implementing the `run` function for a rule, prefer transforming `Result` into `Option` and using the `?` operator for concise code.

Applied to files:

  • crates/biome_js_analyze/tests/quick_test.rs
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : if a lint rule is ported from an...
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : If a lint rule is ported from another ecosystem (e.g., ESLint), add a `sources` metadata field in `declare_lint_rule!` referencing the original rule.

Applied to files:

  • crates/biome_js_analyze/tests/quick_test.rs
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : the `declare_lint_rule!` macro m...
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : The `declare_lint_rule!` macro must be used to declare an analyzer rule type and implement the RuleMeta trait.

Applied to files:

  • crates/biome_js_analyze/tests/quick_test.rs
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : rule documentation must start wi...
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : Rule documentation must start with a single-line summary, followed by detailed paragraphs, and include `## Examples` with `### Invalid` and `### Valid` sections.

Applied to files:

  • crates/biome_js_analyze/tests/quick_test.rs
📚 Learning: run tests using `cargo test` or `just test` for rust crates....
Learnt from: CR
PR: biomejs/biome#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:49:35.574Z
Learning: Run tests using `cargo test` or `just test` for Rust crates.

Applied to files:

  • crates/biome_js_analyze/tests/quick_test.rs
📚 Learning: applies to benches/html_formatter.rs : benchmark for html formatter must be in `benches/html_formatt...
Learnt from: CR
PR: biomejs/biome#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-05T13:25:32.395Z
Learning: Applies to benches/html_formatter.rs : Benchmark for HTML formatter must be in `benches/html_formatter.rs`

Applied to files:

  • crates/biome_js_analyze/tests/quick_test.rs
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/{no_invalid*,use_valid*}_*.rs : rules t...
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/{no_invalid*,use_valid*}_*.rs : Rules that report invalid code should use the `noInvalid<Concept>` or `useValid<Concept>` naming conventions (e.g., `noInvalidConstructorSuper`, `useValidTypeof`).

Applied to files:

  • crates/biome_js_analyze/tests/specs/nursery/noFloatingPromises/invalid.ts
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no_unused*_*.rs : rules that report unu...
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no_unused*_*.rs : Rules that report unused entities should use the `noUnused<Concept>` naming convention (e.g., `noUnusedVariables`).

Applied to files:

  • crates/biome_js_analyze/tests/specs/nursery/noFloatingPromises/invalid.ts
📚 Learning: applies to crates/biome_js_type_info/../biome_module_graph/src/js_module_info/scoped_resolver.rs : f...
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:23.437Z
Learning: Applies to crates/biome_js_type_info/../biome_module_graph/src/js_module_info/scoped_resolver.rs : Full inference should resolve all remaining `TypeReference::Import` variants to `TypeReference::Resolved` using the complete module graph. Implemented in `../biome_module_graph/src/js_module_info/scoped_resolver.rs`.

Applied to files:

  • crates/biome_js_syntax/src/import_ext.rs
  • crates/biome_resolver/tests/spec_tests.rs
  • crates/biome_resolver/src/lib.rs
📚 Learning: applies to crates/biome_js_type_info/../biome_module_graph/src/js_module_info/collector.rs : module-...
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:23.437Z
Learning: Applies to crates/biome_js_type_info/../biome_module_graph/src/js_module_info/collector.rs : Module-level (thin) inference should resolve `TypeReference::Qualifier` variants to `TypeReference::Resolved` or `TypeReference::Import` as appropriate, but cannot resolve imports across modules. Implemented in `../biome_module_graph/src/js_module_info/collector.rs`.

Applied to files:

  • crates/biome_js_syntax/src/import_ext.rs
  • crates/biome_resolver/tests/spec_tests.rs
  • crates/biome_resolver/src/lib.rs
📚 Learning: applies to crates/biome_js_formatter/**/*.rs : do not attempt to 'fix' the code when formatting ast ...
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:05.640Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Do not attempt to 'fix' the code when formatting AST nodes. If a mandatory token or node is missing, return `None` instead.

Applied to files:

  • crates/biome_js_syntax/src/import_ext.rs
📚 Learning: applies to crates/biome_js_type_info/src/resolver.rs : implement and maintain the `typeresolver` tra...
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:23.437Z
Learning: Applies to crates/biome_js_type_info/src/resolver.rs : Implement and maintain the `TypeResolver` trait in `src/resolver.rs`, with separate implementations for hardcoded symbols, globals, module info collection, and full module resolution.

Applied to files:

  • crates/biome_js_syntax/src/import_ext.rs
  • crates/biome_resolver/tests/spec_tests.rs
  • crates/biome_resolver/src/lib.rs
📚 Learning: applies to crates/biome_js_formatter/**/*.rs : for tokens that are not mandatory, use the provided h...
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:05.640Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : For tokens that are not mandatory, use the provided helper functions when formatting AST nodes.

Applied to files:

  • crates/biome_js_syntax/src/import_ext.rs
📚 Learning: applies to crates/biome_js_formatter/**/*.rs : when formatting ast nodes, if a token is mandatory an...
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:05.640Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : When formatting AST nodes, if a token is mandatory and the AST has that information, use the token from the AST node (e.g., `node.l_paren_token().format()`) instead of hardcoding the token (e.g., `token("(")`).

Applied to files:

  • crates/biome_js_syntax/src/import_ext.rs
📚 Learning: applies to crates/biome_js_formatter/**/*.rs : import the `formatnode` trait and implement it for yo...
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:05.640Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Import the `FormatNode` trait and implement it for your Node when creating a new AST node formatter.

Applied to files:

  • crates/biome_js_syntax/src/import_ext.rs
📚 Learning: applies to crates/biome_parser/crates/biome_*/**/*.rs : use conditional syntax handling to add diagn...
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/**/*.rs : Use conditional syntax handling to add diagnostics if a syntax is not supported in the current file or context, and wrap invalid syntax in a `BOGUS` node if necessary.

Applied to files:

  • crates/biome_js_syntax/src/import_ext.rs
📚 Learning: applies to crates/biome_js_type_info/src/local_inference.rs : local type inference should only creat...
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:23.437Z
Learning: Applies to crates/biome_js_type_info/src/local_inference.rs : Local type inference should only create type references and not resolve them to concrete types. Local inference is implemented in `src/local_inference.rs`.

Applied to files:

  • crates/biome_js_syntax/src/import_ext.rs
  • crates/biome_resolver/tests/spec_tests.rs
  • crates/biome_resolver/src/lib.rs
📚 Learning: applies to crates/biome_formatter/tests/{spec_test.rs,spec_tests.rs,language.rs} : inside the `biome...
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/tests/{spec_test.rs,spec_tests.rs,language.rs} : Inside the `biome_html_formatter` crate, create a `tests` folder containing a `specs` folder and the files `spec_test.rs`, `spec_tests.rs`, and `language.rs` for test infrastructure.

Applied to files:

  • crates/biome_resolver/tests/spec_tests.rs
📚 Learning: applies to crates/biome_formatter/tests/spec_test.rs : implement the `run` function in `spec_test.rs...
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/tests/spec_test.rs : Implement the `run` function in `spec_test.rs` to execute formatting tests using the provided test infrastructure.

Applied to files:

  • crates/biome_resolver/tests/spec_tests.rs
📚 Learning: applies to crates/biome_js_type_info/src/type_info.rs : when using `resolvedtypedata`, always use th...
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:23.437Z
Learning: Applies to crates/biome_js_type_info/src/type_info.rs : When using `ResolvedTypeData`, always use the correct `ResolverId` when resolving `TypeReference`s that are part of the type data; mistakes can lead to panics.

Applied to files:

  • crates/biome_resolver/tests/spec_tests.rs
  • crates/biome_resolver/src/lib.rs
📚 Learning: applies to crates/biome_js_type_info/src/flattening.rs : flattening of type expressions (e.g., reduc...
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:23.437Z
Learning: Applies to crates/biome_js_type_info/src/flattening.rs : Flattening of type expressions (e.g., reducing `TypeData::TypeofExpression` to a concrete type) should be implemented in `src/flattening.rs`.

Applied to files:

  • crates/biome_resolver/tests/spec_tests.rs
  • crates/biome_resolver/src/lib.rs
📚 Learning: applies to crates/biome_js_type_info/src/type_info.rs : avoid circular or recursive data structures ...
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:23.437Z
Learning: Applies to crates/biome_js_type_info/src/type_info.rs : Avoid circular or recursive data structures in type representations; use `TypeReference` and `TypeData::Reference` to refer to other types instead.

Applied to files:

  • crates/biome_resolver/tests/spec_tests.rs
  • crates/biome_resolver/src/lib.rs
📚 Learning: applies to crates/biome_analyze/biome_rule_options/lib/*.rs : use boxed slices (`box<[box]>`) i...
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_rule_options/lib/*.rs : Use boxed slices (`Box<[Box<str>]>`) instead of `Vec<String>` for string arrays in rule options to save memory.

Applied to files:

  • crates/biome_resolver/src/lib.rs
📚 Learning: applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : avoid unnecessary string allocat...
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : Avoid unnecessary string allocations by comparing against `&str` or `TokenText` instead of calling `to_string()`.

Applied to files:

  • crates/biome_resolver/src/lib.rs
📚 Learning: applies to crates/biome_js_type_info/src/type_info.rs : the `typedata` enum, defined in `src/type_in...
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:23.437Z
Learning: Applies to crates/biome_js_type_info/src/type_info.rs : The `TypeData` enum, defined in `src/type_info.rs`, is the central data structure for type information and should be extended to cover all relevant TypeScript types.

Applied to files:

  • crates/biome_resolver/src/lib.rs
📚 Learning: applies to crates/biome_js_type_info/src/type_info.rs : use `typedata::unknown` to represent cases w...
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:23.437Z
Learning: Applies to crates/biome_js_type_info/src/type_info.rs : Use `TypeData::Unknown` to represent cases where type inference is incomplete, and `TypeData::UnknownKeyword` to represent explicit user usage of the TypeScript `unknown` keyword.

Applied to files:

  • crates/biome_resolver/src/lib.rs
🪛 LanguageTool
.changeset/aliased-antilopes-acknowledge.md

[style] ~5-~5: Would you like to use the Oxford spelling “recognized”? The spelling ‘recognised’ is also correct.
Context: ...symbols using aliases are now correctly recognised.

(OXFORD_SPELLING_Z_NOT_S)

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

193-200: Good refactoring for clarity.

Splitting the match arms makes the distinct handling of aliased vs non-aliased imports more explicit and maintainable.

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

930-935: Nice optimization to avoid unnecessary allocations.

The ExplicitOwned variant prevents converting owned strings to string slices when typeRoots are configured in tsconfig.json.

crates/biome_js_analyze/tests/specs/nursery/noFloatingPromises/invalid.ts (1)

2-2: Good test coverage for aliased imports.

The addition properly tests that the noFloatingPromises rule detects floating promises from aliased imports, validating the fix for issue #7111.

Also applies to: 339-339

crates/biome_js_analyze/tests/quick_test.rs (1)

29-30: Test properly validates the aliased import fix.

The quick test correctly sets up a scenario where an aliased import of a promise-returning function is called, ensuring the noFloatingPromises rule can detect it.

Also applies to: 35-35, 42-42

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

502-535: LGTM! Valuable test coverage for type resolution without explicit type specification.

This test effectively verifies that the resolver correctly handles type definition resolution with auto-detected type roots from tsconfig.json. The dual assertion covering both primary module resolution and re-export resolution provides comprehensive coverage for the enhanced type handling logic.

.changeset/aliased-antilopes-acknowledge.md (1)

1-6: Changeset description looks spot-on.

Meets all wording and formatting conventions; nothing to tweak.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codspeed-hq bot commented Aug 5, 2025

CodSpeed Performance Report

Merging #7121 will not alter performance

Comparing arendjr:fix-aliased-imports (b6c0c8c) with main (57c15e6)1

Summary

✅ 128 untouched benchmarks

Footnotes

  1. No successful run was found on main (6b541fb) during the generation of this report, so 57c15e6 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@arendjr arendjr merged commit b9642ab into biomejs:main Aug 5, 2025
31 checks passed
@github-actions github-actions bot mentioned this pull request Aug 5, 2025
@eMerzh
Copy link
Contributor

eMerzh commented Aug 6, 2025

not sure to understand 100% of this, but couldn't that fix #6432 ?

@arendjr
Copy link
Contributor Author

arendjr commented Aug 7, 2025

Thanks for pointing out that PR, I had overlooked it. But no, it’s a separate issue.

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

Labels

A-Linter Area: linter A-Parser Area: parser A-Resolver Area: resolver A-Type-Inference Area: type inference L-JavaScript Language: JavaScript and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

💅 noFloatingPromise fails to find some floating promises

2 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载