5.0.2 β€’ Published 2 years ago

@putout/plugin-convert-math-pow v5.0.2

Weekly downloads
2,779
License
MIT
Repository
github
Last release
2 years ago

@putout/plugin-convert-math-pow NPM version

  • 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 to Math.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 -D

Rule

{
    "rules": {
        "convert-math-pow": "on"
    }
}

❌ Example of incorrect code

Math.pow(2, 4);

βœ… Example of correct code

2 ** 4;

Comparison

LinterRuleFix
🐊 Putoutconvert-math-powβœ…
⏣ ESLintprefer-exponentiation-operatorβœ…

License

MIT

5.0.2

2 years ago

5.0.1

2 years ago

5.0.0

2 years ago

4.0.0

4 years ago

3.0.0

5 years ago

2.0.0

5 years ago

1.2.0

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago