Permalink
Browse files

Fix: `no-self-assign` false positive at shorthand (fixes #5371)

  • Loading branch information...
mysticatea committed Feb 22, 2016
1 parent b35510a commit fe3f6bd78915535bee5c5927d1dc75e2ba868971
Showing with 4 additions and 1 deletion.
  1. +3 −1 lib/rules/no-self-assign.js
  2. +1 −0 tests/lib/rules/no-self-assign.js
@@ -110,7 +110,9 @@ module.exports = function(context) {
return {
"AssignmentExpression": function(node) {
eachSelfAssignment(node.left, node.right, report);
if (node.operator === "=") {
eachSelfAssignment(node.left, node.right, report);
}
}
};
};
@@ -23,6 +23,7 @@ ruleTester.run("no-self-assign", rule, {
valid: [
"var a = a",
"a = b",
"a += a",
"a = +a",
"a = [a]",
{code: "let a = a", parserOptions: {ecmaVersion: 6}},

0 comments on commit fe3f6bd

Please sign in to comment.