bug(vue/no-deprecated-slot-attribute): invalid autofix on non-immediate slot
attributes
#1499
Closed
2 tasks done
Labels
Checklist
Tell us about your environment
Please show your full configuration:
Sorry, partial config but the autofixes are coming from
vue/no-deprecated-slot-attribute
so I think this should suffice. Can provide full config if necessary.What did you do?
Ran autofix with
vue/no-deprecated-slot-attribute
enabled.It autocorrected the old
slot="slot-name"
to the new#slot-name
syntax, but broke the code in places where the element withslot="slot-name"
is not an immediate child.With the deprecated syntax
slot="slot-name"
, it appears that content passed into the slot can be in nested<template>
tags. https://jsfiddle.net/hirokiosame/vy6hejcx/With the new syntax
#slot-name
, it appears that content passed into the slot much be an immediate child of the component it's being passed into. https://jsfiddle.net/hirokiosame/njbof5rv/SomeComponent.vue
This works:
This doesn't work:
What did you expect to happen?
For the autofix to not convert the
slot="slot-name"
to#slot-name
if it's not being used on an immediate child.What actually happened?
It autofixed, and is caught as an invalid slot usage by
vue/valid-v-slot
.Repository to reproduce this issue
JSFiddle links above should suffice.
The text was updated successfully, but these errors were encountered: