-
-
Notifications
You must be signed in to change notification settings - Fork 527
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(format/html): implement bracketSameLine (#4968)
- Loading branch information
Showing
8 changed files
with
232 additions
and
32 deletions.
There are no files selected for viewing
This file contains 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 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 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
9 changes: 9 additions & 0 deletions
9
crates/biome_html_formatter/tests/specs/html/elements/bracket-same-line/element.html
This file contains 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 @@ | ||
<div | ||
id="hello" | ||
class="world really-long-class-name another-really-long-class-name" | ||
style="color: red" | ||
data-foo="bar" | ||
data-bar="foo" | ||
> | ||
hello world | ||
</div> |
68 changes: 68 additions & 0 deletions
68
crates/biome_html_formatter/tests/specs/html/elements/bracket-same-line/element.html.snap
This file contains 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,68 @@ | ||
--- | ||
source: crates/biome_formatter_test/src/snapshot_builder.rs | ||
info: elements/bracket-same-line/element.html | ||
--- | ||
# Input | ||
|
||
```html | ||
<div | ||
id="hello" | ||
class="world really-long-class-name another-really-long-class-name" | ||
style="color: red" | ||
data-foo="bar" | ||
data-bar="foo" | ||
> | ||
hello world | ||
</div> | ||
``` | ||
|
||
|
||
============================= | ||
|
||
# Outputs | ||
|
||
## Output 1 | ||
|
||
----- | ||
Indent style: Tab | ||
Indent width: 2 | ||
Line ending: LF | ||
Line width: 80 | ||
Attribute Position: Auto | ||
Bracket same line: false | ||
Whitespace sensitivity: strict | ||
Indent script and style: false | ||
----- | ||
|
||
```html | ||
<div | ||
id="hello" | ||
class="world really-long-class-name another-really-long-class-name" | ||
style="color: red" | ||
data-foo="bar" | ||
data-bar="foo" | ||
>hello world</div> | ||
``` | ||
|
||
## Output 1 | ||
|
||
----- | ||
Indent style: Tab | ||
Indent width: 2 | ||
Line ending: LF | ||
Line width: 80 | ||
Attribute Position: Auto | ||
Bracket same line: true | ||
Whitespace sensitivity: strict | ||
Indent script and style: false | ||
----- | ||
|
||
```html | ||
<div | ||
id="hello" | ||
class="world really-long-class-name another-really-long-class-name" | ||
style="color: red" | ||
data-foo="bar" | ||
data-bar="foo">hello world</div> | ||
``` |
6 changes: 6 additions & 0 deletions
6
crates/biome_html_formatter/tests/specs/html/elements/bracket-same-line/options.json
This file contains 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 @@ | ||
{ | ||
"$schema": "../../../../../../../../packages/@biomejs/biome/configuration_schema.json", | ||
"formatter": { | ||
"bracketSameLine": true | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
crates/biome_html_formatter/tests/specs/html/elements/bracket-same-line/self-closing.html
This file contains 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 @@ | ||
<selfclosing | ||
id="hello" | ||
class="world" | ||
style="color: red" | ||
data-foo="bar" | ||
data-bar="foo" | ||
/> |
66 changes: 66 additions & 0 deletions
66
...s/biome_html_formatter/tests/specs/html/elements/bracket-same-line/self-closing.html.snap
This file contains 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,66 @@ | ||
--- | ||
source: crates/biome_formatter_test/src/snapshot_builder.rs | ||
info: elements/bracket-same-line/self-closing.html | ||
--- | ||
# Input | ||
|
||
```html | ||
<selfclosing | ||
id="hello" | ||
class="world" | ||
style="color: red" | ||
data-foo="bar" | ||
data-bar="foo" | ||
/> | ||
``` | ||
|
||
|
||
============================= | ||
|
||
# Outputs | ||
|
||
## Output 1 | ||
|
||
----- | ||
Indent style: Tab | ||
Indent width: 2 | ||
Line ending: LF | ||
Line width: 80 | ||
Attribute Position: Auto | ||
Bracket same line: false | ||
Whitespace sensitivity: strict | ||
Indent script and style: false | ||
----- | ||
|
||
```html | ||
<selfclosing | ||
id="hello" | ||
class="world" | ||
style="color: red" | ||
data-foo="bar" | ||
data-bar="foo" | ||
/> | ||
``` | ||
|
||
## Output 1 | ||
|
||
----- | ||
Indent style: Tab | ||
Indent width: 2 | ||
Line ending: LF | ||
Line width: 80 | ||
Attribute Position: Auto | ||
Bracket same line: true | ||
Whitespace sensitivity: strict | ||
Indent script and style: false | ||
----- | ||
|
||
```html | ||
<selfclosing | ||
id="hello" | ||
class="world" | ||
style="color: red" | ||
data-foo="bar" | ||
data-bar="foo" /> | ||
``` |