Rule proposal: Check for unused propTypes
See original GitHub issueWhile 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:
- Created 8 years ago
- Reactions:34
- Comments:9 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
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!