-
-
Notifications
You must be signed in to change notification settings - Fork 476
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
45e29db
commit 55e8531
Showing
5 changed files
with
98 additions
and
4 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
15 changes: 15 additions & 0 deletions
15
crates/biome_js_formatter/tests/specs/jsx/attribute_escape.jsx
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,15 @@ | ||
const a = () => { | ||
const a = "\test"; | ||
const b = "\\test"; | ||
const c = "\\\test"; | ||
const d = "\\\\test"; | ||
|
||
return ( | ||
<> | ||
<input name="pin" type="text" pattern="\d{4,4}" required /> | ||
<input name="\\pin" type="text" pattern="\d{4,4}" required /> | ||
<input name="\\\pin" type="text" pattern="\d{4,4}" required /> | ||
<input name="\\\\pin" type="text" pattern="\d{4,4}" required /> | ||
</> | ||
); | ||
}; |
68 changes: 68 additions & 0 deletions
68
crates/biome_js_formatter/tests/specs/jsx/attribute_escape.jsx.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 | ||
assertion_line: 212 | ||
info: jsx/attribute_escape.jsx | ||
--- | ||
|
||
# Input | ||
|
||
```jsx | ||
const a = () => { | ||
const a = "\test"; | ||
const b = "\\test"; | ||
const c = "\\\test"; | ||
const d = "\\\\test"; | ||
return ( | ||
<> | ||
<input name="pin" type="text" pattern="\d{4,4}" required /> | ||
<input name="\\pin" type="text" pattern="\d{4,4}" required /> | ||
<input name="\\\pin" type="text" pattern="\d{4,4}" required /> | ||
<input name="\\\\pin" type="text" pattern="\d{4,4}" required /> | ||
</> | ||
); | ||
}; | ||
``` | ||
|
||
|
||
============================= | ||
|
||
# Outputs | ||
|
||
## Output 1 | ||
|
||
----- | ||
Indent style: Tab | ||
Indent width: 2 | ||
Line ending: LF | ||
Line width: 80 | ||
Quote style: Double Quotes | ||
JSX quote style: Double Quotes | ||
Quote properties: As needed | ||
Trailing comma: All | ||
Semicolons: Always | ||
Arrow parentheses: Always | ||
Bracket spacing: true | ||
Bracket same line: false | ||
----- | ||
|
||
```jsx | ||
const a = () => { | ||
const a = "\test"; | ||
const b = "\\test"; | ||
const c = "\\\test"; | ||
const d = "\\\\test"; | ||
return ( | ||
<> | ||
<input name="pin" type="text" pattern="\d{4,4}" required /> | ||
<input name="\\pin" type="text" pattern="\d{4,4}" required /> | ||
<input name="\\\pin" type="text" pattern="\d{4,4}" required /> | ||
<input name="\\\\pin" type="text" pattern="\d{4,4}" required /> | ||
</> | ||
); | ||
}; | ||
``` | ||
|
||
|
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