-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
New Rule Proposal: enforce return in render() method #482
Comments
I run into this use case as well. It's fairly easy to catch with the React errors in the browser, but having a rule to help catch it before hand would be great. @yannickcr I can put together a PR for this if it's a rule we want to add. Proposed Rule Name: |
What about returning If this is just ensuring that a render method returns something, that's fine, but I'm skeptical about the value it will add. |
In my mind the rule would just check for a |
Same for me, but if you send a PR for this @bsbeeks I don't really see reasons to refuse it. |
You can always bypass certain rules in some way, you can do If a component returns an invalid value, there's not much the plugin can do about it. These concerns are clearly separated. The rule would be just a faster way to see that you forgot to return the JSX. |
It sometimes happens to me that I forget to
return
JSX content in therender
method. This rule would warn if thereturn
statement is missing.The text was updated successfully, but these errors were encountered: