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] no-unused-prop-types: apply skipShapeProps to exact types #2883

Merged
merged 1 commit into from Dec 24, 2020

Conversation

golopot
Copy link
Contributor

@golopot golopot commented Dec 22, 2020

Fixes #2850.

The option skipShapeProps was only applied to PropTypes.shape, this pr make the option apply to PropTypes.exact as well.

Props usages like props.a.map({b} => use(b)) are hard to handle. Currently PropTypes.shape has the same bug under the option skipShapeProps: false. People do not complain about it because most people use skipShapeProps: true.

The bug has two parts:

  1. skipShapeProps should applies to PropTypes.exact.
  2. Props usages like props.a.map({b} => use(b)) should be handled.

This pr only fixes 1.

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.

LGTM pending the one comment

lib/rules/no-unused-prop-types.js Outdated Show resolved Hide resolved
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.

no-unused-prop-types: All fields reported as unused with PropTypes.arrayOf(PropTypes.exact)
2 participants