-
-
Notifications
You must be signed in to change notification settings - Fork 929
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 all commits
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
Some comments aren't visible on the classic Files Changed page.
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,10 @@ | ||
| --- | ||
| "@biomejs/biome": patch | ||
| --- | ||
|
|
||
| Fixed [#9300](https://github.com/biomejs/biome/issues/9300): Lowercase component member expressions like `<form.Field>` in Svelte and Astro files are now correctly formatted. | ||
|
|
||
| ```diff | ||
| -<form .Field></form.Field> | ||
| +<form.Field></form.Field> | ||
| ``` |
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
21 changes: 21 additions & 0 deletions
21
crates/biome_cli/tests/snapshots/main_cases_regression_tests/issue_9300.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,21 @@ | ||
| --- | ||
| source: crates/biome_cli/tests/snap_test.rs | ||
| expression: redactor(content) | ||
| --- | ||
| ## `form.astro` | ||
|
|
||
| ```astro | ||
| <form.Field></form.Field> | ||
| ``` | ||
|
|
||
| ## `form.svelte` | ||
|
|
||
| ```svelte | ||
| <form.Field></form.Field> | ||
| ``` | ||
|
|
||
| # Emitted Messages | ||
|
|
||
| ```block | ||
| Checked 2 files in <TIME>. No fixes applied. | ||
| ``` |
11 changes: 11 additions & 0 deletions
11
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,11 @@ | ||
| --- | ||
| let form; | ||
| let foo; | ||
| let Data; | ||
| --- | ||
| <form.Field></form.Field> | ||
| <form.Field attr="value" /> | ||
| <Data.Client></Data.Client> | ||
| <foo.Bar.Baz /> | ||
| <form.Field data-foo.bar="value" /> | ||
| <foo.Bar attr.data-foo="value" /> |
63 changes: 63 additions & 0 deletions
63
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,63 @@ | ||
| --- | ||
| 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 /> | ||
| <form.Field data-foo.bar="value" /> | ||
| <foo.Bar attr.data-foo="value" /> | ||
|
|
||
| ``` | ||
|
|
||
|
|
||
| ============================= | ||
|
|
||
| # 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 /> | ||
| <form.Field data-foo.bar="value" /> | ||
| <foo.Bar attr.data-foo="value" /> | ||
|
|
||
| ``` | ||
|
|
||
|
|
||
|
|
||
| ## Unimplemented nodes/tokens | ||
|
|
||
| "let form;\nlet foo;\nlet Data;\n-" => 4..34 |
6 changes: 6 additions & 0 deletions
6
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,6 @@ | ||
| <form.Field></form.Field> | ||
| <form.Field attr="value" /> | ||
| <Data.Client></Data.Client> | ||
| <foo.Bar.Baz /> | ||
| <form.Field data-foo.bar="value" /> | ||
| <foo.Bar attr.data-foo="value" /> |
46 changes: 46 additions & 0 deletions
46
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,46 @@ | ||
| --- | ||
| source: crates/biome_formatter_test/src/snapshot_builder.rs | ||
| info: svelte/lowercase-member.svelte | ||
| --- | ||
|
|
||
| # Input | ||
|
|
||
| ```svelte | ||
| <form.Field></form.Field> | ||
| <form.Field attr="value" /> | ||
| <Data.Client></Data.Client> | ||
| <foo.Bar.Baz /> | ||
| <form.Field data-foo.bar="value" /> | ||
| <foo.Bar attr.data-foo="value" /> | ||
|
|
||
| ``` | ||
|
|
||
|
|
||
| ============================= | ||
|
|
||
| # 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 /> | ||
| <form.Field data-foo.bar="value" /> | ||
| <foo.Bar attr.data-foo="value" /> | ||
|
|
||
| ``` | ||
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
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
7 changes: 7 additions & 0 deletions
7
crates/biome_html_parser/tests/html_specs/ok/astro/lowercase_component_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,7 @@ | ||
| --- | ||
| let Data; | ||
| --- | ||
| <Data.Client></Data.Client> | ||
| <form.Field attr="value" /> | ||
| <form.Field data-foo.bar="value" /> | ||
| <foo.Bar attr.data-foo="value" /> |
Oops, something went wrong.
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.