JS.TS.NO.LOSS.OF.PRECISION

Disallow literal numbers that lose precision

Rule Details

This rule extends the base eslint/no-loss-of-precision (https://eslint.org/docs/rules/no-loss-of-precision) rule. It adds support for numeric separators (https://github.com/tc39/proposal-numeric-separator). Note that this rule requires ESLint v7.

How to Use

Copy
{
  // 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"]
}

The content on this page is adapted from the ESLint User Guide. Copyright © OpenJS Foundation and other contributors, www.openjsf.org. All rights reserved. https://eslint.org/docs/rules/