function prohibit(node){if(node.operator!=="="){context.report({node:node,message:"Unexpected operator assignment shorthand.",fix:function fix(fixer){if(canBeFixed(node.left)){var operatorToken=getOperatorToken(node);var leftText=sourceCode.getText().slice(node.range[0],operatorToken.range[0]);var newOperator=node.operator.slice(0,-1);var rightText=void 0;// If this change would modify precedence (e.g. `foo *= bar + 1` => `foo = foo * (bar + 1)`), parenthesize the right side.
if(astUtils.getPrecedence(node.right)<=astUtils.getPrecedence({type:"BinaryExpression",operator:newOperator})&&!astUtils.isParenthesised(sourceCode,node.right)){rightText=sourceCode.text.slice(operatorToken.range[1],node.right.range[0])+"("+sourceCode.getText(node.right)+")";}else{rightText=sourceCode.text.slice(operatorToken.range[1],node.range[1]);}return fixer.replaceText(node,leftText+"= "+leftText+newOperator+rightText);}return null;}});}}
Warns if an assignment expression uses operator assignment shorthand.
@param   {ASTNode} node An AssignmentExpression node.
@returns {void}