Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot disable rule svelte(dynamic-slot-name) #145

Closed
ianhogersltn opened this issue Nov 22, 2021 · 1 comment
Closed

Cannot disable rule svelte(dynamic-slot-name) #145

ianhogersltn opened this issue Nov 22, 2021 · 1 comment

Comments

@ianhogersltn
Copy link

Hi,

I'm trying to use slot names via ENUM to make sure I don't have typo's in the slot names.

<script context="module" lang="ts">
	export const TESTING_SLOT_NAME = 'testing';
</script>

<slot name={TESTING_SLOT_NAME}></slot>

But i'm getting the error:
<slot> name cannot be dynamicsvelte(dynamic-slot-name)

I tried making the variable in typescript ReadOnly<string>

I also tried disabling the rule but it wouldn't work either.

Unless there's another way to safely type the slot names other than an ENUM?

@dummdidumm
Copy link
Member

This is a Svelte compiler error, not a warning. This is an open feature request on the Svelte core repo: sveltejs/svelte#6493

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants