Math.pow raises a number to a power where ** would

tx0/ts:math-pow-callstrictwarningstyle

What it finds

Math.pow(base, exponent) is written base ** exponent since ES2016, an operator that reads like the formula and also works on bigints.

Reported are calls of Math.pow on the global Math with two arguments. The fix, which is safe, writes **, with parentheses around operands and the result where precedence needs them.

From the rule's source, math_pow_call.rs.

Example from the rule's tests
export const a = Math.pow(2, 10);tx0 reports: can be written with **export const b = Math.max(2, 10);
Highlighted lines are the ones tx0 reports, with its message under each; the other lines are left alone.

Turn it on, off or suppress it

The rule runs from the strict tier up. To turn it on in a lower tier, give it a level in tx0.toml:

tx0.toml
[rules]
"tx0/ts:math-pow-call" = "warning"

To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:

// tx0: ignore[tx0/ts:math-pow-call] reason="..."

tx0 explain tx0/ts:math-pow-call shows the same in the terminal. Found a false positive? Report it.