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
Rule proposal: Check for unused propTypes #226
Comments
+1 this seems necessary since we check for props missing a proptype definition we should also check for proptypes never being used |
All +1's should now be in the form of reactions on the first post - I'll clean up the ones here, and any future ones. Thanks for everyone's interest! |
I'm going to take a stab at writing this rule. Will submit a PR. |
What should happen if the whole |
Yeah, unfortunately I think this rule is prone to false-positives. |
Maybe we could just have it have options to issue warning or not if props object is passed to a third party function or using a spread operator? Instead of throwing the baby with the bathwater. |
I've done a first pass at this here: #611 (Instructions on how to test and install are in the PR). Still hunting down false positives, but early feedback would be highly appreciated. |
Any update on this? Is there something preventing this from being merged? |
@EvNaverniouk Thank you for add this rule here, Evgueni. During our development here, we found that this rule checks propType used under |
While refactoring code you may remove the use of some props but forget to remove them from the propTypes. It would nice if ESLint could alert you with:
Similar to the unused vars rule.
The text was updated successfully, but these errors were encountered: