-
Notifications
You must be signed in to change notification settings - Fork 18
Rule Proposal: no-unused-prop-types #28
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
Comments
You may be able to use eslint-rule-composer for this, and avoid having to re-implement the bulk of the rule. |
Interesting, I haven't heard of eslint-rule-composer- seems like a very handy until. let me see if having |
looks like it should pretty straightforward to correctly decide on props usage for the example above (with the help of eslint-rule-composer). |
The only plugin that i know looks at multiple files is the import plugin - and it only does that to build up a dependency map. I don’t actually think we have any code at Airbnb where the redux container and the component it wraps are separate; either way, i think that’s not something you need to handle in the first iteration. |
@ljharb , @MitchLillie I am planning to merge #31, lmk if you have any comments. |
There is a lot of discussion in eslint-plugin-react about the no-unused-prop-types rule. It seems to cause plenty of users issues, but especially Redux users, as it does not make an attempt to check mapStateToProps, mapDispatchToProps, or mergeProps for props that are used. This rule should completely replace react/no-unused-prop-types.
The following would be an example of correct code for this rule:
The text was updated successfully, but these errors were encountered: