Skip to main content

Disallow literal numbers that lose precision (no-loss-of-precision)

Rule Details

This rule extends the base eslint/no-loss-of-precision rule. It adds support for numeric separators. Note that this rule requires ESLint v7.

How to use

{
// note you must disable the base rule as it can report incorrect errors
"no-loss-of-precision": "off",
"@typescript-eslint/no-loss-of-precision": ["error"]
}

Taken with โค๏ธ from ESLint core

Attributes

  • โœ… Recommended
  • ๐Ÿ”ง Fixable
  • ๐Ÿ’ญ Requires type information