# no-unused-refs

Rule `vue/no-unused-refs`. Disallow unused refs

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

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `vue/no-unused-refs` | no | no | package `eslint-plugin-vue` | [docs](https://eslint.vuejs.org/rules/no-unused-refs.html) |
| Biome | `nursery/noVueUnusedRefs` | no | no | group nursery, since 2.6.4 | [docs](https://biomejs.dev/linter/rules/no-vue-unused-refs/) |

## Code examples

### Incorrect: the rule reports this

```vue
  <input ref="bar" />
</template>
<script>
export default {
  mounted() {
    this.$refs.foo.value = 'foo'
  }
}
</script>
```

### Correct: the rule accepts this

```vue
<input ref="foo" />
```

Examples from the ESLint documentation.

## Enable it

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

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

export default [
  {
    plugins: { vue },
    rules: {
      "vue/no-unused-refs": "error",
    },
  },
];
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "nursery": {
        "noVueUnusedRefs": "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

- [vue/no-sparse-arrays](https://lintradar.dev/rules/vue/no-sparse-arrays.md): Disallow sparse arrays in `<template>`
- [vue/no-useless-v-bind](https://lintradar.dev/rules/vue/no-useless-v-bind.md): Disallow unnecessary `v-bind` directives
- [vue/no-loss-of-precision](https://lintradar.dev/rules/vue/no-loss-of-precision.md): Disallow literal numbers that lose precision in `<template>`
- [vue/object-shorthand](https://lintradar.dev/rules/vue/object-shorthand.md): Require or disallow method and property shorthand syntax for object literals in `<template>`
- [vue/no-irregular-whitespace](https://lintradar.dev/rules/vue/no-irregular-whitespace.md): Disallow irregular whitespace in `.vue` files
- [vue/prefer-template](https://lintradar.dev/rules/vue/prefer-template.md): Require template literals instead of string concatenation in `<template>`

---

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