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
[Fix] Support Flow type spread #2446
Conversation
What's your opinion about trying to resolve types from external files, or add an option to warn when type can't be resolved |
@moroine i'm not a flow user, so i'm not sure. what do you think? |
@ljharb I think it can be a good idea to warn first, as I discover that limitation only when reading the code. |
f72490c
to
11dc56b
Compare
`, | ||
parser: parsers.BABEL_ESLINT, | ||
errors: [{ | ||
message: "'notOne' is missing in props validation", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
possibly a dumb question, but why is this erroring? notOne
doesn't appear anywhere else in this test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ghiculescu it is at line 4791
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@moroine I'm not sure I understand. Why is a separate test causing this test to fail? Aren't they each independent tests?
After this update, it stopped working for me. 7.16.0 - everything was fine, after 7.17.0 - below.
|
@levenecav could we have the code of the component? |
He is big, but the essence of this:
|
I use "flow" for types. |
If you use the following props do you have the same error? Because this PR is only about converting spread to the following props. Here I suspect the rule not finding usage of props in other methods
|
I have exactly the same problem as in #2138. |
I'm sure your issue is caused by this PR. But this should be because now spreading is recognized as being
Could you check using Props without spreading with v7.16.0? I suspect the error is due not used Props in the following function:
|
@levenecav Please file a new issue. |
@moroine |
Passing the props object around is an antipattern; always destructure what you need immediately. |
This PR aims to support type spread like:
This PR also fixes #2138