This repository has been archived by the owner on Aug 31, 2023. It is now read-only.
📎 useExponentiationOperator #3850
Labels
A-Linter
Area: linter
Help wanted
Help would be really appreciated
S-Planned
Status: planned by the team, but not in the short term
task
A task, an action that needs to be performed
Description
https://eslint.org/docs/latest/rules/prefer-exponentiation-operator
The initial implementation will be done as part of #3848, but it doesn't cover all edge cases covered by the ESLint rule.
Edge cases to cover
class C extends Math.pow(a, b) {}
,(class extends Math.pow(a, b) {})
,class C extends (Math.pow(a, b)) {}
)in
(e.g:Math.pow(a, b)in c
,a+Math.pow(++b, c)in d
) current implementation always wraps the adjacent expression with parentheses, while ESLint doesn't.Math.pow
(e.g:a+Math.pow(++b, c)
->a+ ++b**c
instead ofa+++b**c
, and(a)+(Math).pow((++b), c)
->(a)+ ++b**c
instead of(a)+++b**c
), they are both correct though)let foo = Math; foo.pow(a, b)
) andglobalThis
(e.g:globalThis.Math.pow(1, 2)
)The text was updated successfully, but these errors were encountered: