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
feat: handle logical assignment in no-self-assign #14152
Conversation
Hi @Zzzen, thanks for the PR! We listed adding support for As for |
Ooops, did not notice the issue. IMO, even though |
Hi @Zzzen!, thanks for the Pull Request The first commit message isn't properly formatted. We ask that you update the message to match this format, as we use it to generate changelogs and automate releases.
Read more about contributing to ESLint here |
Oops! It looks like we lost track of this pull request. What do we want to do here? This pull request will auto-close in 7 days without an update. |
@eslint/eslint-tsc thoughts about this proposal for the
|
@mdjermanovic i agree with your reasoning. |
@mdjermanovic I agree as well. |
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.
@Zzzen sorry for the delay, the change for &&=
, ||=
, and ??=
is accepted now.
Can you also update the documentation for this rule?
👌 updated |
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!
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)
[x] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:
What rule do you want to change?
no-self-assign
Does this change cause the rule to produce more or fewer warnings?
more warnings
How will the change be implemented? (New option, new default behavior, etc.)?
new default behavior
Please provide some example code that this change will affect:
What does the rule currently do for this code?
no errors are reported
What will the rule do after it's changed?
all lines will be reported.
What changes did you make? (Give an overview)
currently, only
=
is handled inno-self-assign
. But other logical assignment operators work roughly the same as=
.a &&= a
isa && (a = a)
, which is essentially a noop.Is there anything you'd like reviewers to focus on?