-
-
Notifications
You must be signed in to change notification settings - Fork 511
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(linter): noUselessFragments deal html escapes under fragements wr…
…ong (#4107) Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
- Loading branch information
1 parent
d7cc01f
commit f8d9173
Showing
4 changed files
with
81 additions
and
3 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
17 changes: 17 additions & 0 deletions
17
crates/biome_js_analyze/tests/specs/complexity/noUselessFragments/issue_4059.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,17 @@ | ||
function MyComponent() { | ||
return ( | ||
<div key={index}>{line || <> </>}</div> | ||
) | ||
} | ||
|
||
function MyComponent2() { | ||
return ( | ||
<div key={index}>{<> </>}</div> | ||
) | ||
} | ||
|
||
function MyComponent3() { | ||
return ( | ||
<div key={index}>{value ?? <> </>}</div> | ||
) | ||
} |
24 changes: 24 additions & 0 deletions
24
crates/biome_js_analyze/tests/specs/complexity/noUselessFragments/issue_4059.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,24 @@ | ||
--- | ||
source: crates/biome_js_analyze/tests/spec_tests.rs | ||
expression: issue_4059.jsx | ||
--- | ||
# Input | ||
```jsx | ||
function MyComponent() { | ||
return ( | ||
<div key={index}>{line || <> </>}</div> | ||
) | ||
} | ||
|
||
function MyComponent2() { | ||
return ( | ||
<div key={index}>{<> </>}</div> | ||
) | ||
} | ||
|
||
function MyComponent3() { | ||
return ( | ||
<div key={index}>{value ?? <> </>}</div> | ||
) | ||
} | ||
``` |