-
-
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
Enhance forbid-prop-types to check for shape({}) #1673
Comments
Similarly it might make sense to check for |
That's a very specific pattern; |
Yeah, I can't much argue for whether |
If we can come up with a way to generically configure "propTypes that are functions that must take a non-empty argument", that'd be great. I'm curious tho - are you actually seeing people using |
I use I'm all for configurable style though. |
In that case, I'd recommend exporting the shape object from the child and using it on the parent, so that you get the error sooner :-) |
+1, I've seen this used a lot where developers are just being lazy and don't want to document the type. |
+1, I've seen this used a lot where I am just being lazy and don't want to document the type. |
I definitely would like for this to be configurable. I can't think of a good reason to do PropTypes.shape(). |
I'm still not really sure how we'd configure this. Happy to reopen if someone has a concrete idea. |
Does it make sense to enhance the
forbid-prop-types
rule to check for cases usingshape
that do not actually add clarity to the code, for exampleshape({})
.From https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-prop-types.md
And:
When using for example
shape({})
we are not more specifically documenting prop usage.The text was updated successfully, but these errors were encountered: