This repository has been archived by the owner on Aug 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 656
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: code review and more test cases
- Loading branch information
Showing
7 changed files
with
137 additions
and
67 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
5 changes: 5 additions & 0 deletions
5
crates/rome_js_analyze/tests/specs/nursery/noUselessFragment/fromImportNamespaceInvalid.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,5 @@ | ||
import * as AwesomeReact from "noReact"; | ||
|
||
<> | ||
<AwesomeReact.Fragment>foo</AwesomeReact.Fragment> | ||
</> |
6 changes: 6 additions & 0 deletions
6
crates/rome_js_analyze/tests/specs/nursery/noUselessFragment/fromImportRenameInvalid.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,6 @@ | ||
import AwesomeReact, { Fragment as AwesomeFragment } from "react"; | ||
|
||
<> | ||
<AwesomeFragment></AwesomeFragment> | ||
<AwesomeReact.Fragment>foo</AwesomeReact.Fragment> | ||
</> |
37 changes: 37 additions & 0 deletions
37
...es/rome_js_analyze/tests/specs/nursery/noUselessFragment/fromImportRenameInvalid.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,37 @@ | ||
--- | ||
source: crates/rome_js_analyze/tests/spec_tests.rs | ||
expression: fromImportRenameInvalid.jsx | ||
--- | ||
# Input | ||
```js | ||
import AwesomeReact, { Fragment as AwesomeFragment } from "react"; | ||
<> | ||
<AwesomeFragment></AwesomeFragment> | ||
<AwesomeReact.Fragment>foo</AwesomeReact.Fragment> | ||
</> | ||
``` | ||
|
||
# Diagnostics | ||
``` | ||
warning[nursery/noUselessFragment]: Avoid using unnecessary Fragment. | ||
┌─ fromImportRenameInvalid.jsx:4:5 | ||
│ | ||
4 │ <AwesomeFragment></AwesomeFragment> | ||
│ ----------------------------------- | ||
``` | ||
|
||
``` | ||
warning[nursery/noUselessFragment]: Avoid using unnecessary Fragment. | ||
┌─ fromImportRenameInvalid.jsx:5:5 | ||
│ | ||
5 │ <AwesomeReact.Fragment>foo</AwesomeReact.Fragment> | ||
│ -------------------------------------------------- | ||
``` | ||
|
||
|
6 changes: 6 additions & 0 deletions
6
crates/rome_js_analyze/tests/specs/nursery/noUselessFragment/fromImportRenameValid.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,6 @@ | ||
import AwesomeReact, { Fragment as AwesomeFragment } from "noReact"; | ||
|
||
<> | ||
<AwesomeFragment></AwesomeFragment> | ||
<AwesomeReact.Fragment>foo</AwesomeReact.Fragment> | ||
</> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.