-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Flow + exact types + spread breaks no-unused-prop-types
rule
#2138
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
cc @alexzherdev for some direction in the props code :-) |
Yeah I don't think we're handling spreads like this. It looks like, when we're iterating through properties of the From there, I think you should be able to use the |
We are also experiencing this. I'm willing to take a look if nobody's worked on it yet. Any pointers on how I can easily test this? |
I have not done anything yet here, so feel free. |
After this update, it stopped working for me. 7.16.0 - everything was fine, after 7.17.0 - below.
|
@levenecav please file a new issue. |
I'm using Flow for a React project, and find the
no-unused-prop-types
rule very helpful. However, it seems to silently fail when combining two exact types to make a component's props. This situation commonly occurs when working with Redux. For example, spreading exact types forOwnProps
,StateProps
, andDispatchProps
into a new exact type is the recommended practice for typing connected components; see this comment for more info.Here's a simple example. Even though
unusedProp
is not used, no error is displayed:If I switch to the following, ESLint now reports the error, but Flow (correctly) complains that two exact types cannot be intersected.
This error is preventing us from properly typing our connected React components with Flow; I'd be happy to work on it if someone could show me where to look. The code for extracting props from flow types is pretty dense.
The text was updated successfully, but these errors were encountered: