# no-duplicate-attributes

Rule `vue/no-duplicate-attributes`. Disallow duplication of attributes

- Source: vue
- Technologies: Vue
- Kind: correctness
- Needs type information: no
- Autofix: no
- Reach: 42.4M weekly downloads of presets that enable it
- Trend: +88.4% last quarter
- Rank: #356 by reach, #348 by growth

## Linters

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

## Code examples

### Incorrect: the rule reports this

```vue
  <MyComponent :foo="abc" foo="def" />
  <MyComponent foo="abc" :foo="def" />
  <MyComponent foo="abc" foo="def" />
  <MyComponent :foo.a="abc" :foo.b="def" />
  <MyComponent class="abc" class="def" />
</template>
```

```vue
  <MyComponent class="abc" :class="def" />
  <MyComponent style="abc" :style="def" />
</template>
```

### Correct: the rule accepts this

```vue
<MyComponent :foo="abc" />
<MyComponent foo="abc" />
<MyComponent class="abc" :class="def" />
```

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-duplicate-attributes": "error",
    },
  },
];
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "correctness": {
        "noDuplicateAttributes": "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% |
| [Vue essential](https://lintradar.dev/presets/vue-essential.md) | ESLint | `eslint-plugin-vue` | 85 | 9.5M | +46.6% |
| [Vue strongly recommended](https://lintradar.dev/presets/vue-strongly-recommended.md) | ESLint | `eslint-plugin-vue` | 110 | 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-dupe-v-else-if](https://lintradar.dev/rules/vue/no-dupe-v-else-if.md): Disallow duplicate conditions in `v-if` / `v-else-if` chains
- [vue/no-mutating-props](https://lintradar.dev/rules/vue/no-mutating-props.md): Disallow mutation of component props
- [vue/no-deprecated-v-on-number-modifiers](https://lintradar.dev/rules/vue/no-deprecated-v-on-number-modifiers.md): Disallow using deprecated number (keycode) modifiers (in Vue.js 3.0.0+)
- [vue/no-ref-as-operand](https://lintradar.dev/rules/vue/no-ref-as-operand.md): Disallow use of value wrapped by `ref()` (Composition API) as an operand
- [vue/no-deprecated-v-on-native-modifier](https://lintradar.dev/rules/vue/no-deprecated-v-on-native-modifier.md): Disallow using deprecated `.native` modifiers (in Vue.js 3.0.0+)
- [vue/no-template-key](https://lintradar.dev/rules/vue/no-template-key.md): Disallow `key` attribute on `<template>`

---

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