Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Update: Check member expressions with `this` in operator-assignment #12495
What is the purpose of this pull request? (put an "X" next to item)
[X] Bug fix
I believe this is a bug fix, but it produces more warnings.
This PR fixes two things in the
What rule do you want to change?
Does this change cause the rule to produce more or fewer 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:
/* eslint operator-assignment: ["error", "always"] */ this.foo = this.foo + bar
What does the rule currently do for this code?
What will the rule do after it's changed?
Error and autofix to:
/* eslint operator-assignment: ["error", "always"] */ this.foo += bar
What changes did you make? (Give an overview)
Is there anything you'd like reviewers to focus on?
All added tests in
The following tests with the
this.foo.bar += baz this[foo] >>>= bar
The following test with the
this.foo += bar
The following tests with the default
this.foo = this.foo + bar this.foo.bar = this.foo.bar + baz this[foo] = this[foo] + bar this = this / foo
Can this be treated as a semver-minor bug fix that produces more warnings? There was a similar case in #12279.