Skip to content

fix(noUndeclaredVariables): consult embedded bindings service before flagging false positives#9269

Open
dyc3 wants to merge 1 commit intomainfrom
dyc3/no-undeclared-vars-embedded-bindings
Open

fix(noUndeclaredVariables): consult embedded bindings service before flagging false positives#9269
dyc3 wants to merge 1 commit intomainfrom
dyc3/no-undeclared-vars-embedded-bindings

Conversation

@dyc3
Copy link
Contributor

@dyc3 dyc3 commented Feb 27, 2026

Summary

I encountered this when trying to migrate a vue codebase to biome. There's more problems that I will open follow up PRs for. It probably affects other html-ish languages, but I haven't bothered to figure that out yet.

Planned by sonnet 4.6, implemented by gpt 5 mini.

Test Plan

added a cli test

Docs

@changeset-bot
Copy link

changeset-bot bot commented Feb 27, 2026

🦋 Changeset detected

Latest commit: 9069b7f

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

Copy link
Contributor Author

dyc3 commented Feb 27, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions bot added A-CLI Area: CLI A-Linter Area: linter L-JavaScript Language: JavaScript and super languages labels Feb 27, 2026
@dyc3 dyc3 marked this pull request as ready for review February 27, 2026 22:20
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 27, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 412a08d and 9069b7f.

⛔ Files ignored due to path filters (1)
  • crates/biome_cli/tests/snapshots/main_cases_handle_vue_files/no_undeclared_variables_not_triggered_for_script_setup_bindings.snap is excluded by !**/*.snap and included by **
📒 Files selected for processing (3)
  • .changeset/fix-no-undeclared-vue-bindings.md
  • crates/biome_cli/tests/cases/handle_vue_files.rs
  • crates/biome_js_analyze/src/lint/correctness/no_undeclared_variables.rs

Walkthrough

This pull request introduces a patch release for @biomejs/biome that fixes a false positive in the noUndeclaredVariables rule. The change ensures Vue script setup bindings are not incorrectly reported as undeclared when used in templates. The rule now checks EmbeddedBindings (including imports and defineModel results from script snippets) before flagging variables as undeclared. A test case validates that bindings from Vue script setup blocks are properly recognised.

Possibly related PRs

Suggested reviewers

  • ematipico
  • arendjr
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: fixing the noUndeclaredVariables rule to consult embedded bindings before reporting false positives, which aligns perfectly with the changeset and code modifications.
Description check ✅ Passed The description clearly explains the motivation (Vue codebase migration issues), the solution (consulting embedded bindings), and includes test details, which directly relates to the changeset.

✏️ 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 dyc3/no-undeclared-vars-embedded-bindings

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

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 27, 2026

Merging this PR will not alter performance

✅ 58 untouched benchmarks
⏩ 156 skipped benchmarks1


Comparing dyc3/no-undeclared-vars-embedded-bindings (9069b7f) with main (9bbdf4d)2

Open in CodSpeed

Footnotes

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

  2. No successful run was found on main (412a08d) during the generation of this report, so 9bbdf4d was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

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

Labels

A-CLI Area: CLI A-Linter Area: linter L-JavaScript Language: JavaScript and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant