fix(embeds): improve detection of bindings in Astro files#9473
Conversation
🦋 Changeset detectedLatest commit: e962f49 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
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 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThis change extends HTML embedding to recognise and parse Astro directives and HTML attribute initializers as embeddable expressions, adds Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Comment Tip CodeRabbit can enforce grammar and style rules using `languagetool`.Configure the |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.changeset/sharp-adults-jog.md:
- Line 5: Fix the typo in the changeset description: replace the misspelled word
"insisde" with "inside" in the sentence that mentions detection of variables in
Astro files (the line referencing the rule `noUnusedVariables`) so the
description reads "inside Astro files."
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 6eed4e71-3099-44be-a354-530df44cc008
⛔ Files ignored due to path filters (3)
crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/embedded_bindings_are_tracked_correctly.snapis excluded by!**/*.snapand included by**crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/no_unused_variables_in_astro_attribute_expressions.snapis excluded by!**/*.snapand included by**crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/no_unused_variables_in_astro_directive_expressions.snapis excluded by!**/*.snapand included by**
📒 Files selected for processing (4)
.changeset/sharp-adults-jog.mdcrates/biome_cli/tests/cases/handle_astro_files.rscrates/biome_html_syntax/src/directive_ext.rscrates/biome_service/src/file_handlers/html.rs
Merging this PR will not alter performance
Comparing Footnotes
|
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
dyc3
left a comment
There was a problem hiding this comment.
I don't have much experience with astro, but LGTM
|
@ematipico After upgrading from 2.4.6 → 2.4.7 I'm seeing new Biome failures where TypeScript type usage is no longer being considered as variable usage, eg: const { a, b, c } = useThing();
// In 2.4.6 Biome would correctly detect this as variable usage.
// In 2.4.7 Biome now falsely reports this as a `lint/correctness/noUnusedVariables` failure
return someFunction<typeof a, typeof b, typeof c>();This PR was the only change to the |
|
Regression yes, this PR unluckily. Please open an issue with a reproduction |
Summary
Easy fix for Astro files. It should improve the QoL
Tests generated with AI
Test Plan
Added new tests
Docs