Skip to content

v-slot-style

Reports v-slot: where the shorthand # would do (v-slot:head). The fix writes #.

One form keeps the templates uniform and shorter.

To fix, write #; the fix does it.

Reported
...
:ok="1"
...
<template v-slot:head>h</template>
<template v-slot="p">d</template>
</MyCard>
<svg :viewBox="v"></svg>
...
After the fix
...
:ok="1"
...
<template #head>h</template>
<template v-slot="p">d</template>
</MyCard>
<svg :viewBox="v"></svg>
...
angular:
lint:
rules:
v-slot-style: warn # off, warn (default), error
html:
lint:
rules:
v-slot-style: warn # off, warn (default), error
svelte:
lint:
rules:
v-slot-style: warn # off, warn (default), error
vue:
lint:
rules:
v-slot-style: warn # off, warn (default), error

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

Suppress one line with sudsy-disable-next-line v-slot-style 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 v-slot-style full