Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react/no-render-return-value should fire for assignment expressions #2461

Closed
jichu4n opened this issue Oct 11, 2019 · 1 comment
Closed

react/no-render-return-value should fire for assignment expressions #2461

jichu4n opened this issue Oct 11, 2019 · 1 comment

Comments

@jichu4n
Copy link
Contributor

jichu4n commented Oct 11, 2019

The react/no-render-return-value plugin currently fires for the following:

const x = ReactDOM.render(...);

However, it doesn't fire for the following:

this.x = ReactDOM.render(...);

or the following:

let x;
x = ReactDOM.render(...)

In these cases the parent expression type of the ReactDOM.render() call is AssignmentExpression, which is not in the list of expression types blacklisted by the plugin (source). This is rather surprising behavior.

@jichu4n
Copy link
Contributor Author

jichu4n commented Oct 11, 2019

Sent PR #2462 to catch these cases.

@ljharb ljharb closed this as completed in da2c7d2 Oct 12, 2019
stefan-wullems pushed a commit to stefan-wullems/eslint-plugin-react that referenced this issue Nov 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants