@putout/plugin-convert-math-pow
putout plugin adds ability to convert Math.pow to exponentiation operator
Last updated 7 years ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @putout/plugin-convert-math-pow 
SYNC missed versions from official npm registry.

@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

Linter Rule Fix
🐊 Putout convert-math-pow ✅
⏣ ESLint prefer-exponentiation-operator ✅

License

MIT

Current Tags

  • 5.0.2                                ...           latest (4 years ago)

9 Versions

  • 5.0.2                                ...           4 years ago
  • 5.0.1                                ...           5 years ago
  • 5.0.0                                ...           5 years ago
  • 4.0.0                                ...           7 years ago
  • 3.0.0                                ...           7 years ago
  • 2.0.0                                ...           7 years ago
  • 1.2.0                                ...           7 years ago
  • 1.1.0                                ...           7 years ago
  • 1.0.0                                ...           8 years ago
Maintainers (1)
Downloads
Total 19
Today 0
This Week 1
This Month 15
Last Day 0
Last Week 3
Last Month 4
Dependencies (0)
None
Dev Dependencies (8)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE