Vue · VUE0044
Do not put attributes on a structural <template>
Reports attributes and directives Vue does not apply on a <template> with v-if, v-else-if, v-else, v-for or v-slot.
vue/template/no-useless-template-attributessrc/rule-packs/vue/rules/vue/no-useless-template-attributes.ts Upstream docs Run this rule
pnpm vite-doctor . --framework vue --rules vue/template/no-useless-template-attributes
Why it matters
A structural <template> does not render an element. Attributes such as id, class, slot, listeners and refs never reach a rendered element, and key and caching directives only work on certain structural templates.
Recommended fix
Apply the attribute or directive to an intended rendered target that supports it. Preserve branch selection when adding visibility, and keep working list keys on a non-slot <template v-for>.
Useful links
Example
Put the id on a rendered element
Before
<template>
<template v-if="open" id="panel">
<section>{{ details }}</section>
</template>
</template>
After
<template>
<template v-if="open">
<section id="panel">{{ details }}</section>
</template>
</template>