Skip to content
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] prop-types: handle RestElement in destructured param #2805

Merged
merged 1 commit into from Sep 24, 2020

Conversation

hank121314
Copy link
Contributor

Summary

This pr fixes: #2804 .

Function parameter will have RestElement which do not have property value.
It will cause undefined property error.

Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ljharb ljharb merged commit 39307b4 into jsx-eslint:master Sep 24, 2020
@hank121314
Copy link
Contributor Author

Thanks!

Thank you for the quick review!

@alexfdz
Copy link

alexfdz commented Sep 25, 2020

Same problem with ExperimentalRestProperty

@ljharb
Copy link
Member

ljharb commented Sep 26, 2020

@alexfdz an issue, or better, a PR with a failing test case, would be appreciated (and would be fixed the fastest)

@minwe
Copy link
Contributor

minwe commented Sep 27, 2020

Not fixed yet, e.g. property.type === 'ExperimentalRestProperty'

@ljharb
Copy link
Member

ljharb commented Sep 27, 2020

@minwe
Copy link
Contributor

minwe commented Sep 27, 2020

@ljharb I have fixed error got when property.type === 'ExperimentalRestProperty'. Please review the PR, and release a new version if it's ok.

ljharb pushed a commit to minwe/eslint-plugin-react that referenced this pull request Sep 27, 2020
artem0723 pushed a commit to artem0723/React-Eslint-Plugin that referenced this pull request Aug 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

TypeError: Cannot read property 'type' of undefined in prop-types
4 participants