Open ajafff opened 6 years ago
Also needs to add parens to both sides of the operator if necessary:
Math.pos(1 + 1, 2 + 2).toString();
// fixed to
((1 + 1) ** (2 + 2)).toString()
Turns fixing parens will be a real mess. Maybe this rule should be pessimistic in more involved cases and simply add parens even if not strictly necessary.
ES2016 added the exponentiation operator, which is a drop-in replacement of
Math.pow
.The fixer needs to add parens if necessary: