1.0.2 β’ Published 3 years ago
@putout/plugin-convert-sqrt-to-hypot v1.0.2
@putout/plugin-convert-sqrt-to-hypot 
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 -DRule
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