This repository was archived by the owner on Aug 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 657
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
Showing
3 changed files
with
68 additions
and
2 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
28 changes: 28 additions & 0 deletions
28
crates/rome_js_analyze/tests/specs/correctness/noRenderReturnValue/validLocal.tsx
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,28 @@ | ||
function render() { } | ||
const ReactDOM = { render }; | ||
|
||
const a = ReactDOM.render(<div />, document.body); | ||
const foo = bar && ReactDOM.render(<div />, document.body); | ||
const foo = bar ? ReactDOM.render(<div />, document.body) : null | ||
const foo = () => ReactDOM.render(<div />, document.body); | ||
const foo = { | ||
react: ReactDOM.render(<div />, document.body) | ||
}; | ||
let lorem; | ||
lorem = ReactDOM.render(<div />, document.body); | ||
function render1() { | ||
return ReactDOM.render(<div />, document.body) | ||
} | ||
|
||
const a = render(<div />, document.body); | ||
const foo = bar && render(<div />, document.body); | ||
const foo = bar ? render(<div />, document.body) : null | ||
const foo = () => render(<div />, document.body); | ||
const foo = { | ||
react: render(<div />, document.body) | ||
}; | ||
let lorem; | ||
lorem = render(<div />, document.body); | ||
function render1() { | ||
return render(<div />, document.body) | ||
} |
38 changes: 38 additions & 0 deletions
38
crates/rome_js_analyze/tests/specs/correctness/noRenderReturnValue/validLocal.tsx.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,38 @@ | ||
--- | ||
source: crates/rome_js_analyze/tests/spec_tests.rs | ||
expression: validLocal.tsx | ||
--- | ||
# Input | ||
```js | ||
function render() { } | ||
const ReactDOM = { render }; | ||
|
||
const a = ReactDOM.render(<div />, document.body); | ||
const foo = bar && ReactDOM.render(<div />, document.body); | ||
const foo = bar ? ReactDOM.render(<div />, document.body) : null | ||
const foo = () => ReactDOM.render(<div />, document.body); | ||
const foo = { | ||
react: ReactDOM.render(<div />, document.body) | ||
}; | ||
let lorem; | ||
lorem = ReactDOM.render(<div />, document.body); | ||
function render1() { | ||
return ReactDOM.render(<div />, document.body) | ||
} | ||
|
||
const a = render(<div />, document.body); | ||
const foo = bar && render(<div />, document.body); | ||
const foo = bar ? render(<div />, document.body) : null | ||
const foo = () => render(<div />, document.body); | ||
const foo = { | ||
react: render(<div />, document.body) | ||
}; | ||
let lorem; | ||
lorem = render(<div />, document.body); | ||
function render1() { | ||
return render(<div />, document.body) | ||
} | ||
|
||
``` | ||
|
||
|