fix(parse/html): svelte directive member expression#9925
Conversation
🦋 Changeset detectedLatest commit: 6cff41d 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 |
Parser conformance results onjs/262
jsx/babel
markdown/commonmark
symbols/microsoft
ts/babel
ts/microsoft
|
WalkthroughThis PR extends Biome's Svelte support to parse and format directive properties with member expressions (dot notation). Updates include grammar extensions for Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.changeset/tender-chicken-swim.md (1)
5-5: Consider mentioning formatter behaviour as well as parsing.The current sentence is correct, but the user-facing fix also includes whitespace/formatting behaviour for dotted Svelte directive properties; calling that out will make release notes clearer.
✍️ Suggested wording tweak
-Fixed [`#9910`](https://github.com/biomejs/biome/issues/9910): added support for parsing member expressions in Svelte directive properties. Biome now correctly parses directives like `in:renderer.in|global`, `use:obj.action`, and deeply nested forms like `in:a.b.c|global`. +Fixed [`#9910`](https://github.com/biomejs/biome/issues/9910): added support for parsing and formatting member expressions in Svelte directive properties. Biome now preserves directives like `in:renderer.in|global`, `use:obj.action`, and deeply nested forms like `in:a.b.c|global` without introducing extra whitespace.As per coding guidelines, "Changeset descriptions should focus on user-facing changes only" and "Write changeset descriptions concisely and clearly (1-3 sentences)".
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.changeset/tender-chicken-swim.md at line 5, Update the changeset text in .changeset/tender-chicken-swim.md to also mention the formatter/whitespace behavior for dotted Svelte directive properties in addition to parsing; edit the sentence that currently reads about parsing support for examples like `in:renderer.in|global`, `use:obj.action`, and `in:a.b.c|global` to add a short clause that the formatter now preserves or normalizes whitespace/formatting for these dotted directive properties so the release note reflects both parsing and formatting user-visible changes.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.changeset/tender-chicken-swim.md:
- Line 5: Update the changeset text in .changeset/tender-chicken-swim.md to also
mention the formatter/whitespace behavior for dotted Svelte directive properties
in addition to parsing; edit the sentence that currently reads about parsing
support for examples like `in:renderer.in|global`, `use:obj.action`, and
`in:a.b.c|global` to add a short clause that the formatter now preserves or
normalizes whitespace/formatting for these dotted directive properties so the
release note reflects both parsing and formatting user-visible changes.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: a2b599f2-fbc7-40a0-a633-33d7a995573c
⛔ Files ignored due to path filters (9)
crates/biome_html_factory/src/generated/node_factory.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_html_factory/src/generated/syntax_factory.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_html_formatter/tests/specs/html/svelte/directive_member_expression.svelte.snapis excluded by!**/*.snapand included by**crates/biome_html_parser/tests/html_specs/error/svelte/directives/directive_member_expression_invalid.svelte.snapis excluded by!**/*.snapand included by**crates/biome_html_parser/tests/html_specs/ok/svelte/directives/directive_member_expression.svelte.snapis excluded by!**/*.snapand included by**crates/biome_html_syntax/src/generated/kind.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_html_syntax/src/generated/macros.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_html_syntax/src/generated/nodes.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_html_syntax/src/generated/nodes_mut.rsis excluded by!**/generated/**,!**/generated/**and included by**
📒 Files selected for processing (15)
.changeset/tender-chicken-swim.mdcrates/biome_html_formatter/src/generated.rscrates/biome_html_formatter/src/svelte/any/binding_property.rscrates/biome_html_formatter/src/svelte/any/member_object.rscrates/biome_html_formatter/src/svelte/any/mod.rscrates/biome_html_formatter/src/svelte/auxiliary/member_property.rscrates/biome_html_formatter/src/svelte/auxiliary/mod.rscrates/biome_html_formatter/src/svelte/value/directive_value.rscrates/biome_html_formatter/tests/specs/html/svelte/directive_member_expression.sveltecrates/biome_html_parser/src/lexer/mod.rscrates/biome_html_parser/src/syntax/svelte.rscrates/biome_html_parser/tests/html_specs/error/svelte/directives/directive_member_expression_invalid.sveltecrates/biome_html_parser/tests/html_specs/ok/svelte/directives/directive_member_expression.sveltextask/codegen/html.ungramxtask/codegen/src/html_kinds_src.rs
Merging this PR will not alter performance
Comparing Footnotes
|
Summary
Closes #9910
Implemented via AI
Test Plan
Added new tests: ok parse cases, err parse cases, formatter
Docs