Skip to content

no-unused-prop-types: change reported node to property key #2287

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

Closed
golopot opened this issue May 24, 2019 · 1 comment · Fixed by #2292
Closed

no-unused-prop-types: change reported node to property key #2287

golopot opened this issue May 24, 2019 · 1 comment · Fixed by #2292

Comments

@golopot
Copy link
Contributor

golopot commented May 24, 2019

The rule no-unused-prop-types currently reports the property value of the unused propType. I think it is more appropriate to report the property key.

// current behavior
Foo.propTypes = {
  neverUsed: PropType.number,
//           ~~~~~~~~~~~~~~~
// PropType is defined but never used. 
}

// proposed behavior
Foo.propTypes = {
  neverUsed: PropType.number,
//~~~~~~~~~
// PropType is defined but never used. 
}
@ljharb
Copy link
Member

ljharb commented May 24, 2019

Sounds like a great improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants