fix: Allow @const inside #key (#15377)

pull/15358/head
Alexis 7 months ago committed by GitHub
parent 3c4a8d425b
commit 5a946e7905
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
Allow `@const` inside `#key`

@ -25,6 +25,7 @@ export function ConstTag(node, context) {
grand_parent?.type !== 'AwaitBlock' &&
grand_parent?.type !== 'SnippetBlock' &&
grand_parent?.type !== 'SvelteBoundary' &&
grand_parent?.type !== 'KeyBlock' &&
((grand_parent?.type !== 'RegularElement' && grand_parent?.type !== 'SvelteElement') ||
!grand_parent.attributes.some((a) => a.type === 'Attribute' && a.name === 'slot')))
) {

Loading…
Cancel
Save