Skip to content

math/prefer-math-hypot

enforce the use of Math.hypot() instead of other hypotenuse calculations

  • ⚙️ This rule is included in "plugin:math/recommended".
  • 🔧 The --fix option on the command line can automatically fix some of the problems reported by this rule.
  • 💡 Some problems reported by this rule are manually fixable by editor suggestions.

📖 Rule Details

This rule aims to enforce the use of Math.hypot() instead of other hypotenuse calculations.

Now loading...

Note that the results are different when dealing with strictly non-finite numbers.

🔧 Options

Nothing.

📚 Further reading

🚀 Version

This rule was introduced in eslint-plugin-math v0.6.0

🔍 Implementation