Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/rules/syntaxes/utils/can-convert-to-v-slot.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ module.exports = function canConvertToVSlot(element, sourceCode, tokenStore) {
const ownerElement = element.parent
if (
ownerElement.type === 'VDocumentFragment' ||
!utils.isCustomComponent(ownerElement)
!utils.isCustomComponent(ownerElement) ||
ownerElement.name === 'component'
) {
return false
}
Expand Down
13 changes: 13 additions & 0 deletions tests/lib/rules/no-deprecated-slot-attribute.js
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,19 @@ tester.run('no-deprecated-slot-attribute', rule, {
</my-component>
</template>`,
errors: ['`slot` attributes are deprecated.']
},
{
code: `
<template>
<component :is="toggle ? 'my-component' : 'div'">
<div slot="named">
Passing in a named slot to a div worked with old syntax
But not with new syntax
</div>
</component>
</template>`,
output: null,
errors: ['`slot` attributes are deprecated.']
}
]
})
Loading