# no-loss-of-precision

Rule `vue/no-loss-of-precision`. Disallow literal numbers that lose precision in `<template>`

- Source: vue
- Technologies: Vue
- Kind: correctness
- Needs type information: no
- Autofix: no
- Reach: 758.7K weekly downloads of presets that enable it
- Trend: +49.9% last quarter
- Rank: #1579 by reach, #796 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `vue/no-loss-of-precision` | no | no | package `eslint-plugin-vue` | [docs](https://eslint.vuejs.org/rules/no-loss-of-precision.html) |
| Biome | `correctness/noPrecisionLoss` | yes | no | group correctness, since 1.0.0 | [docs](https://biomejs.dev/linter/rules/no-precision-loss/) |

## Code examples

### Incorrect: the rule reports this

```js
const x = 9007199254740993
```

```js
const x = 5.123000000000000000000000000001
```

```js
const x = 0x20000000000001
```

### Correct: the rule accepts this

```js
const x = 12345
const x = 123.456
const x = 123e34
const x = 12300000000000000000000000
const x = 0x1FFFFFFFFFFFFF
const x = 9007199254740991
const x = 9007_1992547409_91
```

Examples from the Biome documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
import vue from "eslint-plugin-vue";

export default [
  {
    plugins: { vue },
    rules: {
      "vue/no-loss-of-precision": "error",
    },
  },
];
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "correctness": {
        "noPrecisionLoss": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Anthony Fu's config](https://lintradar.dev/presets/antfu.md) | ESLint | `@antfu/eslint-config` | 294 | 758.7K | +49.9% |

## Related rules

- [eslint/no-loss-of-precision](https://lintradar.dev/rules/eslint/no-loss-of-precision.md): Disallow literal numbers that lose precision
- [typescript/no-loss-of-precision](https://lintradar.dev/rules/typescript/no-loss-of-precision.md): Disallow literal numbers that lose precision
- [unicorn/no-loss-of-precision](https://lintradar.dev/rules/unicorn/no-loss-of-precision.md): Disallow numeric literals that lose precision when represented as IEEE 754 binary64 values.
- [vue/no-irregular-whitespace](https://lintradar.dev/rules/vue/no-irregular-whitespace.md): Disallow irregular whitespace in `.vue` files
- [vue/no-sparse-arrays](https://lintradar.dev/rules/vue/no-sparse-arrays.md): Disallow sparse arrays in `<template>`
- [vue/no-empty-pattern](https://lintradar.dev/rules/vue/no-empty-pattern.md): Disallow empty destructuring patterns in `<template>`

---

Web page: https://lintradar.dev/rules/vue/no-loss-of-precision. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
