# this-in-template

Rule `vue/this-in-template`. Disallow usage of `this` in template

- Source: vue
- Technologies: Vue
- Kind: style
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 42.4M weekly downloads of presets that enable it
- Trend: +88.4% last quarter
- Rank: #401 by reach, #393 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `vue/this-in-template` | yes | safe | package `eslint-plugin-vue` | [docs](https://eslint.vuejs.org/rules/this-in-template.html) |
| Biome | `nursery/noVueThisInTemplate` | yes | unsafe | group nursery, since 2.6.5 | [docs](https://biomejs.dev/linter/rules/no-vue-this-in-template/) |

## Code examples

### Incorrect: the rule reports this

```vue
  <a :href="this.url">
    {{ this.text }}
  </a>
</template>
```

```vue
  <a :href="url">
    {{ text }}
  </a>
</template>
```

### Correct: the rule accepts this

```vue
<a :href="url">
  {{ text }}
</a>
```

```vue
<a :href="this.url">
  {{ this.text }}
</a>
```

Examples from the ESLint documentation.

## Enable it

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

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

export default [
  {
    plugins: { vue },
    rules: {
      "vue/this-in-template": "error",
    },
  },
];
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "nursery": {
        "noVueThisInTemplate": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Biome recommended](https://lintradar.dev/presets/biome-recommended.md) | Biome | `@biomejs/biome` | 491 | 28.5M | +106.8% |
| [Vue recommended](https://lintradar.dev/presets/vue-recommended.md) | ESLint | `eslint-plugin-vue` | 118 | 9.5M | +46.6% |
| [Ultracite for Biome](https://lintradar.dev/presets/ultracite-biome.md) | Biome | `ultracite` | 616 | 2.1M | +151.7% |
| [Nuxt](https://lintradar.dev/presets/nuxt.md) | ESLint | `@nuxt/eslint-config` | 188 | 1.5M | +72.8% |
| [Anthony Fu's config](https://lintradar.dev/presets/antfu.md) | ESLint | `@antfu/eslint-config` | 294 | 758.7K | +49.9% |

## Related rules

- [vue/no-lone-template](https://lintradar.dev/rules/vue/no-lone-template.md): Disallow unnecessary `<template>`
- [vue/block-order](https://lintradar.dev/rules/vue/block-order.md): Enforce order of component top-level elements
- [vue/no-required-prop-with-default](https://lintradar.dev/rules/vue/no-required-prop-with-default.md): Enforce props with default values to be optional
- [vue/no-dupe-keys](https://lintradar.dev/rules/vue/no-dupe-keys.md): Disallow duplication of field names
- [vue/no-multiple-slot-args](https://lintradar.dev/rules/vue/no-multiple-slot-args.md): Disallow passing multiple arguments to scoped slots
- [vue/require-default-prop](https://lintradar.dev/rules/vue/require-default-prop.md): Require default value for props

---

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