Vue · VUE0030
Disable inheritAttrs when binding $attrs
Flags single-root components that forward `v-bind="$attrs"` to an inner element while Vue still applies the same attrs to the root.
vue/attrs/no-duplicate-attr-inheritancesrc/rule-packs/vue/rules/vue/no-duplicate-attr-inheritance.ts Upstream docs Run this rule
pnpm vite-doctor . --framework vue --rules vue/attrs/no-duplicate-attr-inheritance
Why it matters
With inheritAttrs left on, fallthrough attrs land on the component root and on the element that binds $attrs, so classes and ids are duplicated and bubbling listeners such as @click run twice.
Recommended fix
Add defineOptions({ inheritAttrs: false }) so attrs reach only the element that binds $attrs.
Useful links
Example
Turn off attribute inheritance when forwarding $attrs
Before
<template>
<label class="field">
<input v-bind="$attrs">
</label>
</template>
After
<script setup lang="ts">
defineOptions({ inheritAttrs: false })
</script>
<template>
<label class="field">
<input v-bind="$attrs">
</label>
</template>