-
-
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
[Bug]: react/destructuring-assignment inconsistent behavior #3828
Comments
I can indeed reproduce this, even when both snippets define a |
ok, so this is happening because the rule is counting If I comment out that propsRefs.length check, then the autofix fails to account for all of the other references, and that causes broken output. I think the rule needs to be made smarter, by autofixing everything that references a property of |
Is there an existing issue for this?
Description Overview
Brief description
It appears the
react/destructuring-assignment
rule is not behaving consistently with type definitions.Code example
What is happening? / What is the error?
MyComponent
, linter gives areact/destructuring-assignment
error.MyOtherComponent
linter stays silent.To me this appears as an unexpected inconsistency.
What command(s) did you run to reproduce issue?
Using the code example above;
Expected Behavior
I would expect both components to trigger the linter rule.
eslint-plugin-react version
v7.34.3
eslint version
v8.57.0
node version
v18.20.2
The text was updated successfully, but these errors were encountered: