-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix: lowercase component member expressions in Astro/Svelte #9302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
e104637
fix: lowercase component member expressions in Astro/Svelte
sepagian 60032e0
changeset: add link to the issue
sepagian 149e5c8
test(regression): add regression test for issue_9300
sepagian fca7afa
test(parser): add parser test for Astro
sepagian 5bac49e
test(parser): add parser test for Svelte
sepagian 65f461f
test(formatter): update formatter test for Astro
sepagian 06b9166
test(formatter): update formatter test for Svelte
sepagian 2aa2381
fix: parse lowercase component member expressions in Svelte/Astro
sepagian 9ae7ddb
update comment to the original state
sepagian e8cc143
fix(parser): align re-lex to use inside_tag_context
sepagian a40d598
test: add link to tanstack form docs
sepagian 046293c
changeset: update the changeset to include diff
sepagian e4ea92f
refactor: use match in consume_token_inside_tag_svelte
sepagian 91d472c
test(regression): use check in issue_9300 to verify noUndeclaredVaria…
sepagian e8911b7
refactor: cli test
dyc3 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@biomejs/biome": patch | ||
| --- | ||
|
|
||
| Fixed Svelte/Astro lowercase component member expressions being formatted with extra space | ||
9 changes: 9 additions & 0 deletions
9
crates/biome_html_formatter/tests/specs/html/astro/lowercase-member.astro
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| --- | ||
| let form; | ||
| let foo; | ||
| let Data; | ||
| --- | ||
| <form.Field></form.Field> | ||
| <form.Field attr="value" /> | ||
| <Data.Client></Data.Client> | ||
| <foo.Bar.Baz /> |
59 changes: 59 additions & 0 deletions
59
crates/biome_html_formatter/tests/specs/html/astro/lowercase-member.astro.snap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| --- | ||
| source: crates/biome_formatter_test/src/snapshot_builder.rs | ||
| info: astro/lowercase-member.astro | ||
| --- | ||
|
|
||
| # Input | ||
|
|
||
| ```astro | ||
| --- | ||
| let form; | ||
| let foo; | ||
| let Data; | ||
| --- | ||
| <form.Field></form.Field> | ||
| <form.Field attr="value" /> | ||
| <Data.Client></Data.Client> | ||
| <foo.Bar.Baz /> | ||
|
|
||
| ``` | ||
|
|
||
|
|
||
| ============================= | ||
|
|
||
| # Outputs | ||
|
|
||
| ## Output 1 | ||
|
|
||
| ----- | ||
| Indent style: Tab | ||
| Indent width: 2 | ||
| Line ending: LF | ||
| Line width: 80 | ||
| Attribute Position: Auto | ||
| Bracket same line: false | ||
| Whitespace sensitivity: css | ||
| Indent script and style: false | ||
| Self close void elements: never | ||
| Trailing newline: true | ||
| ----- | ||
|
|
||
| ```astro | ||
| --- | ||
| let form; | ||
| let foo; | ||
| let Data; | ||
| --- | ||
|
|
||
| <form.Field></form.Field> | ||
| <form.Field attr="value" /> | ||
| <Data.Client></Data.Client> | ||
| <foo.Bar.Baz /> | ||
|
|
||
| ``` | ||
|
|
||
|
|
||
|
|
||
| ## Unimplemented nodes/tokens | ||
|
|
||
| "let form;\nlet foo;\nlet Data;\n-" => 4..34 |
4 changes: 4 additions & 0 deletions
4
crates/biome_html_formatter/tests/specs/html/svelte/lowercase-member.svelte
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| <form.Field></form.Field> | ||
| <form.Field attr="value" /> | ||
| <Data.Client></Data.Client> | ||
| <foo.Bar.Baz /> |
42 changes: 42 additions & 0 deletions
42
crates/biome_html_formatter/tests/specs/html/svelte/lowercase-member.svelte.snap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| --- | ||
| source: crates/biome_formatter_test/src/snapshot_builder.rs | ||
| info: svelte/lowercase-member.svelte | ||
| --- | ||
|
|
||
| # Input | ||
|
|
||
| ```svelte | ||
| <form.Field></form.Field> | ||
|
sepagian marked this conversation as resolved.
|
||
| <form.Field attr="value" /> | ||
| <Data.Client></Data.Client> | ||
| <foo.Bar.Baz /> | ||
|
|
||
| ``` | ||
|
|
||
|
|
||
| ============================= | ||
|
|
||
| # Outputs | ||
|
|
||
| ## Output 1 | ||
|
|
||
| ----- | ||
| Indent style: Tab | ||
| Indent width: 2 | ||
| Line ending: LF | ||
| Line width: 80 | ||
| Attribute Position: Auto | ||
| Bracket same line: false | ||
| Whitespace sensitivity: css | ||
| Indent script and style: false | ||
| Self close void elements: never | ||
| Trailing newline: true | ||
| ----- | ||
|
|
||
| ```svelte | ||
| <form.Field></form.Field> | ||
| <form.Field attr="value" /> | ||
| <Data.Client></Data.Client> | ||
| <foo.Bar.Baz /> | ||
|
|
||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.