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
Update: report rename id destructuring in id-blacklist (fixes #12807) #12923
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- renaming identifier in an ObjectPattern destructuring.
This restores correct behavior from v6.8.0
.
- the last identifier in an ObjectPattern destructuring.
These are new warnings.
Maybe we could in another PR add new warnings similar to 2.
, but when the parent is AssignmentPattern
, ArrayPattern
or RestElement
@mdjermanovic
I understand that this rule should check when the parent is But I'm curious why we should check
By the docs at examples of incorrect, it seems this rule should not warn in the below cases(AssignmentPattern). function foo( baz = obj.bar ) {}; // Should we allow `bar` because it is not assignments? Am I missing something? |
I was thinking to cover the remaining cases where ({ a: obj.bar = b } = c);
[obj.bar = b] = c; |
That seems worthwhile - mind making an issue so we can track it? |
wow, actually, I've never seen this syntax before. TIL. Thanks :) @kaicataldo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
…12807) (eslint#12923) * Update: report rename id destructuring in id-blacklist (fixes eslint#12807) * check RestElement, ArrayPattern, computed * check assignment pattern, computed property * add option * remove dupe condition
Prerequisites checklist
What is the purpose of this pull request? (put an "X" next to an item)
[ ] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:
What changes did you make? (Give an overview)
This PR will fix #12807
Is there anything you'd like reviewers to focus on?
It will make a new warning on the below cases. ( about blacklist
foo
)