vue/no-duplicate-attributes
Disallow duplicate attributes on the same element.
| Default severity | Presets | Automatic fix | Options |
|---|---|---|---|
error |
essential, happy-path, nuxt, ecosystem, opinionated |
No | None |
Applies to: Vue SFC templates and blocks, with script context where the rule requires it.
Bad
The same button declares class twice instead of one combined class value.
<template>
<button class="primary" class="large">Save</button>
</template>
Good
Both class tokens appear in a single class attribute.
<template>
<button class="primary large">Save</button>
</template>
Configuration (Vite+)
import { defineConfig } from "@vizejs/vite-plugin/vite-plus";
export default defineConfig({}).withVue({
linter: {
"preset": "incremental",
"rules": {
"vue/no-duplicate-attributes": "error"
}
},
});
Then run vp run lint.