Skip to content

no-deprecated-slot-attribute

Reports the slot attribute on an element that is not a <slot>. Only in .vue files, because in HTML slot assigns an element to the slot of a web component.

Vue 3 removed the attribute for a named slot, so the content is not put in the slot.

To fix, use v-slot (#name) on a <template>.

Reported
<template>
...
<p slot="head" is="row"></p><slot name="x" />
...
<tr is="vue:row" v-model:title="t" @keyup.enter="k"></tr>
</template>
angular:
lint:
rules:
no-deprecated-slot-attribute: warn # off, warn (default), error
html:
lint:
rules:
no-deprecated-slot-attribute: warn # off, warn (default), error
svelte:
lint:
rules:
no-deprecated-slot-attribute: warn # off, warn (default), error
vue:
lint:
rules:
no-deprecated-slot-attribute: warn # off, warn (default), error

Enabled by the presets: html/eslint-plugin-vue-recommended.

Suppress one line with sudsy-disable-next-line no-deprecated-slot-attribute in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
eslint-plugin-vue no-deprecated-slot-attribute full