Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

📎 useExponentiationOperator #3850

Closed
1 of 4 tasks
Tracked by #3739
kaioduarte opened this issue Nov 24, 2022 · 1 comment · Fixed by biomejs/biome#121
Closed
1 of 4 tasks
Tracked by #3739

📎 useExponentiationOperator #3850

kaioduarte opened this issue Nov 24, 2022 · 1 comment · Fixed by biomejs/biome#121
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

Comments

@kaioduarte
Copy link
Contributor

kaioduarte commented Nov 24, 2022

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

  • Classes declarations/expressions (e.g: class C extends Math.pow(a, b) {}, (class extends Math.pow(a, b) {}), class C extends (Math.pow(a, b)) {})
  • Adjacent 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.
  • Add spaces on BinaryExpression with Math.pow (e.g: a+Math.pow(++b, c) -> a+ ++b**c instead of a+++b**c, and (a)+(Math).pow((++b), c) -> (a)+ ++b**c instead of (a)+++b**c), they are both correct though)
  • Global renaming (e.g: let foo = Math; foo.pow(a, b)) and globalThis (e.g: globalThis.Math.pow(1, 2))
@kaioduarte kaioduarte added the task A task, an action that needs to be performed label Nov 24, 2022
@ematipico ematipico mentioned this issue Nov 24, 2022
29 tasks
@ematipico ematipico added A-Linter Area: linter S-Planned Status: planned by the team, but not in the short term labels Nov 29, 2022
@ematipico
Copy link
Contributor

Hi @kaioduarte , I haven't seen any update for a while. I suppose you don't have time anymore, so I removed you from the assignees

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants