-
-
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
eslint-plugin-react 7.20.1 - react/require-default-props - has no corresponding defaultProps declaration #2685
Comments
I just published v7.20.2; can you try with that version? |
Note, though, that the rule doesn't currently care about default values, since these aren't runtime-introspectable, and don't offer the same benefits that defaultProps does. See #2396 for discussion. In other words, I think this is intentional, and it was a bug that you didn't get the warning previously, and the option discussed here might help you. |
Thanks for the feedback! I quickly checked the discussion, but I assume that option is not yet available, right? Will read in more detail tomorrow. Renovate will auto pull in 7.20.2 - I actually think it's already making a build with it atm |
Correct, it's not yet available. Semver with eslint plugins is tricky; many bugfixes will create more warnings, thus failing the build; it's got to be a judgement call every time. |
I think pending the option in #2396, this is intentional and warrants an override comment if you don't want to use defaultProps. Happy to reopen if there's something actionable here tho! |
Description
After upgrading from eslint-plugin-react 7.20.0 -> 7.20.1, my project errors on react/require-default-props
The project didn't have these errors on 7.20.0 (see main branch). The errors are thrown on a functional component with default values.
I am mainly curious as to whether this new error is intentional, and if so what the expected change should be that I need to make.
Steps to reproduce
Expected result
No errors
Actual result
See https://app.netlify.com/sites/gatsby-typescript-eslint-prettier-starter/deploys/5ef9113214fdb700081b9d35
The text was updated successfully, but these errors were encountered: