Closed
Description
Please describe what the rule should do:
This rule reports deprecated or removed (in Vue.js 2.6.0) slot syntax.
This rule has the following options.
{
"vue/slot-syntax": ["error", {
"v-slot": true,
"slot": true,
"slot-scope": true,
"scope": false
}]
}
v-slot
... Iffalse
, disallowv-slot
. defaulttrue
slot
... Iffalse
, disallowslot
. defaulttrue
slot-scope
... Iffalse
, disallowslot-scope
. defaulttrue
scope
... Iffalse
, disallowscope
. defaultfalse
I think we need to discuss the default options.
The listed defaults are designed not to warn v2.5 - 2.6 users.
What category should the rule belong to?
- Enforces code style
- Warns about a potential error
- Suggests an alternate way of doing something
- Other (please specify:)
Provide 2-3 code examples that this rule should warn about:
<template>
<ListComponent>
<!-- ✓ GOOD -->
<template v-slot:name="props">
{{ props.title }}
</template>
<template slot="name" slot-scope="props">
{{ props.title }}
</template>
</ListComponent>
<ListComponent>
<!-- ✗ BAD -->
<template slot="name" scope="props">
{{ props.title }}
</template>
</ListComponent>
</template>
- option
{"v-slot": true, "slot": false, "slot-scope": false, "scope": false}
You are using Vue.js v2.6.0+ and you want to use only
v-slot
<template>
<ListComponent>
<!-- ✓ GOOD -->
<template v-slot:name="props">
{{ props.title }}
</template>
</ListComponent>
<ListComponent>
<!-- ✗ BAD -->
<template slot="name" slot-scope="props">
{{ props.title }}
</template>
<template slot="name" scope="props">
{{ props.title }}
</template>
</ListComponent>
</template>
- option
{"v-slot": false, "slot": true, "slot-scope": true, "scope": false}
You are using Vue.js v2.5.x
<template>
<ListComponent>
<!-- ✓ GOOD -->
<template slot="name" slot-scope="props">
{{ props.title }}
</template>
</ListComponent>
<ListComponent>
<!-- ✗ BAD -->
<template v-slot:name="props">
{{ props.title }}
</template>
<template slot="name" scope="props">
{{ props.title }}
</template>
</ListComponent>
</template>
Additional context
I started implementing on this branch.
However, we need to make the parser supports to v-slot
.