Skip to content

eslint/no-self-assign Correctness ​

✅ This rule is turned on by default.

What it does ​

Disallow assignments where both sides are exactly the same

Why is this bad? ​

Self assignments have no effect, so probably those are an error due to incomplete refactoring. Those indicate that what you should do is still remaining.

Example ​

javascript
foo = foo;
[bar, baz] = [bar, qiz];

References ​

Released under the MIT License.