-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
no-unused-prop-types - count all properties as used when met {...this.props} #879
Comments
That goes far beyond what a linter is capable of. Spread props are dynamic at runtime and defy static analysis. |
|
The rule's severity is all or nothing - either it's an error (when the rule is configured as an error), or it doesn't report at all. |
IMO configured severity is sort of upper bound, and linter may report some issues with lower severity |
@victor-homyakov that's not how eslint works. Rules only have one "report" function, and everything matches the configured severity. |
:( |
I think only when the entire props object is spread, it makes sense to mark all properties as used. |
I hope there is a chance this could be explored deeper. The only false positives I get anymore are from using |
I am also running into this. Having to turn off that rule around my proptypes fairly frequently. |
Suppose one of components has a bunch of properties, and just passes them to child component
<SomeChild {...this.props} />
. In this caseno-unused-prop-types
rule will mark all properties as unused. Although rule could be manually disabled for the component, I'd like to see that rule can handle that situation, maybe with an additional option in configuration.The text was updated successfully, but these errors were encountered: