@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
$ cnpm 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.

Install

npm i @putout/plugin-convert-math-pow -D

Rule

Rule convert-math-pow is enabled by default, to disable add to .putout.json:

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

❌ 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.1                                ...           latest (4 years ago)

8 Versions

  • 5.0.1                                ...           4 years ago
  • 5.0.0                                ...           4 years ago
  • 4.0.0                                ...           6 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                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (0)
None
Dev Dependencies (8)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |