question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rule proposal: Check for unused propTypes

See original GitHub issue

While refactoring code you may remove the use of some props but forget to remove them from the propTypes. It would nice if ESLint could alert you with:

`foo` propType is defined but not used.

Similar to the unused vars rule.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:34
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

10reactions
EvHauscommented, May 23, 2016

I’ve done a first pass at this here: https://github.com/yannickcr/eslint-plugin-react/pull/611 (Instructions on how to test and install are in the PR).

Still hunting down false positives, but early feedback would be highly appreciated.

3reactions
ljharbcommented, May 19, 2016

All +1’s should now be in the form of reactions on the first post - I’ll clean up the ones here, and any future ones. Thanks for everyone’s interest!

Read more comments on GitHub >

github_iconTop Results From Across the Web

React no-unused-proptypes error; cannot understand the ...
In my case, I have just added a line into .eslintrc file at the rules object. "rules": {"react/no-unused-prop-types": 0}.
Read more >
Do you still use PropTypes with Typescript or do you just find ...
I recognize typescript is compile-time and PropTypes is run-time, but it just has never felt ... I have not used PropTypes for 3...
Read more >
Typechecking With PropTypes - React
PropTypes exports a range of validators that can be used to make sure the data you receive is valid. In this example, we're...
Read more >
PropTypes: A Guide To Typechecking In React – TheSassWay.com
As a general rule, we can check the type of a prop by looking for it in the primitive type category in JavaScript....
Read more >
Fullstack part5 | props.children and proptypes - Full stack open
If loginVisible is true, then the CSS rule of the component will be: ... You can find the code for our current application...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found