@putout/plugin-convert-sqrt-to-hypot
🐊Putout plugin adds ability to convert 'Math.sqrt()' to 'Math.hypot()'
Last updated 2 years ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @putout/plugin-convert-sqrt-to-hypot 
SYNC missed versions from official npm registry.

@putout/plugin-convert-sqrt-to-hypot NPM version

The Math.hypot() function returns the square root of the sum of squares of its arguments.

(c) MDN

🐊Putout plugin adds ability to convert Math.sqrt() to Math.hypot(). Check out in 🐊Putout Editor. Merged to @putout/plugin-math.

Install

npm i @putout/plugin-sqrt-to-hypot -D

Rule

Rule convert-sqrt-to-hypot is enabled by default, to disable add to .putout.json:

{
    "rules": {
        "convert-sqrt-to-hypot": "off"
    }
}

❌ Example of incorrect code

Math.sqrt(a ** 2, b ** 2);

✅ Example of correct code

Math.hypot(a, b);

License

MIT

Current Tags

  • 1.0.2                                ...           latest (2 years ago)

3 Versions

  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (6)
Dependents (1)

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