no-loss-of-precision
Disallow literal numbers that lose precision.
Deprecated
This rule has been deprecated because the base eslint/no-loss-of-precision
rule added support for numeric separators.
There is no longer any need to use this extension rule.
Options
See eslint/no-loss-of-precision
's options.
How to Use
- Flat Config
- Legacy Config
eslint.config.mjs
export default tseslint.config({
rules: {
// 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"
}
});
.eslintrc.cjs
module.exports = {
"rules": {
// 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"
}
};
Try this rule in the playground ↗