-
-
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
no-unused-prop-types returns false positive when destructuring props cast to a different type #2517
Comments
Although any use of |
Yup I should've made it more clear in the example that any kind of assertion causes a failure. I encountered the behaviour when casting to a generic that makes use of I'd be more than happy to try and prepare a PR but I'd need some guidance regarding where to start – I don't have any experience with |
In this case, I'd follow these rough steps:
|
Thanks! I'll have a go at it later this week 👍 |
Sample Code
Issue
The linter throws an error:
'foo' PropType is defined but prop is never used
even tho the prop is used.Expected
The linter should not care about props being asserted to be of a different type. If an assertion is made it's most likely for a good reason and the actual prop is still referenced inside the component (no matter its type).
The text was updated successfully, but these errors were encountered: