Skip to content

fix(core): detect JSX reference identifiers in Astro/Vue/Svelte templates#9435

Merged
siketyan merged 1 commit intomainfrom
fix/GH-9432
Mar 11, 2026
Merged

fix(core): detect JSX reference identifiers in Astro/Vue/Svelte templates#9435
siketyan merged 1 commit intomainfrom
fix/GH-9432

Conversation

@siketyan
Copy link
Member

Summary

Closes #9432

Added a branch to handle JsxReferenceIdentifier as well in the visit_non_source_snippet function to correctly detect usages of the value in embedded JSX snippets in Astro/Vue/Svelete templates.

Test Plan

Added a snapshot test.

Docs

N/A

@siketyan siketyan requested review from a team March 10, 2026 14:52
@siketyan siketyan self-assigned this Mar 10, 2026
@changeset-bot
Copy link

changeset-bot bot commented Mar 10, 2026

🦋 Changeset detected

Latest commit: 2dfbb2e

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-CLI Area: CLI A-Project Area: project labels Mar 10, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 10, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2876d6d9-9407-4dce-9734-848572dac0ee

📥 Commits

Reviewing files that changed from the base of the PR and between 795bad4 and 2dfbb2e.

⛔ Files ignored due to path filters (1)
  • crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/use_import_type_not_triggered_for_components_in_template.snap is excluded by !**/*.snap and included by **
📒 Files selected for processing (3)
  • .changeset/curly-games-follow.md
  • crates/biome_cli/tests/cases/handle_astro_files.rs
  • crates/biome_service/src/workspace/document/services/embedded_value_references.rs

Walkthrough

This patch release fixes a false positive in the useImportType and noUnusedImports lint rules for Astro/Vue/Svelte templates. The fix adds JSX reference identifier tracking to the embedded value references service, ensuring component imports used both at runtime in templates and in type positions (e.g., ComponentProps<typeof Component>) are correctly recognised as runtime-used and not flagged as unnecessary value imports.

Possibly related PRs

Suggested labels

A-Linter, L-JavaScript

Suggested reviewers

  • ematipico
  • dyc3
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarises the main change: detecting JSX reference identifiers in Astro/Vue/Svelte templates to fix a false positive in lint rules.
Description check ✅ Passed The description clearly relates to the changeset, explaining the fix for handling JsxReferenceIdentifier in embedded JSX snippets and referencing the linked issue.
Linked Issues check ✅ Passed The PR fully addresses issue #9432 by adding JsxReferenceIdentifier support in visit_non_source_snippet to correctly detect runtime usage in templates, eliminating the false positive useImportType warning.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing issue #9432: a changeset entry, a test case, and the core logic change to track JSX references in embedded snippets.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/GH-9432

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

@siketyan siketyan merged commit 6c5a8f2 into main Mar 11, 2026
13 checks passed
@siketyan siketyan deleted the fix/GH-9432 branch March 11, 2026 00:39
@github-actions github-actions bot mentioned this pull request Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CLI Area: CLI A-Project Area: project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

💅 False positive useImportType in .astro when component import is used in template and in ComponentProps<typeof ...>

2 participants