@putout/plugin-convert-math-pow
v5.0.2
Published
šPutout plugin adds ability to convert 'Math.pow()' to 'exponentiation operator'
Maintainers
Readme
@putout/plugin-convert-math-pow 
- The
Math.pow()static method, given two arguments, base and exponent, returns baseexponent.- The exponentiation operator (
**) returns the result of raising the first operand to the power of the second operand. It is equivalent toMath.pow, except it also accepts BigInts as operands.(c) MDN
šPutout plugin adds ability to convert Math.pow to exponentiation operator. Merged to @putout/plugin-math.
Install
npm i @putout/plugin-convert-math-pow -DRule
{
"rules": {
"convert-math-pow": "on"
}
}ā Example of incorrect code
Math.pow(2, 4);ā Example of correct code
2 ** 4;Comparison
Linter | Rule | Fix
--------|-------|------------|
š Putout | convert-math-pow | ā
⣠ESLint | prefer-exponentiation-operator | ā
License
MIT
