-
-
Notifications
You must be signed in to change notification settings - Fork 510
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(analyzer): lint/complexity/noUselessFragments removing assignment #…
- Loading branch information
1 parent
4a024bb
commit 4ec3bcd
Showing
5 changed files
with
44 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
1 change: 1 addition & 0 deletions
1
crates/biome_js_analyze/tests/specs/complexity/noUselessFragments/assigments.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 @@ | ||
arr = <>Error</> |
30 changes: 30 additions & 0 deletions
30
crates/biome_js_analyze/tests/specs/complexity/noUselessFragments/assigments.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,30 @@ | ||
--- | ||
source: crates/biome_js_analyze/tests/spec_tests.rs | ||
expression: assigments.jsx | ||
--- | ||
# Input | ||
```js | ||
arr = <>Error</> | ||
|
||
``` | ||
|
||
# Diagnostics | ||
``` | ||
assigments.jsx:1:7 lint/complexity/noUselessFragments FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
! Avoid using unnecessary Fragment. | ||
> 1 │ arr = <>Error</> | ||
│ ^^^^^^^^^^ | ||
2 │ | ||
i Suggested fix: Remove the Fragment | ||
1 │ - arr·=·<>Error</> | ||
1 │ + arr·=·"Error" | ||
2 2 │ | ||
``` | ||
|
||
|
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