sveltejs / eslint-plugin-svelte

ESLint plugin for Svelte using AST
https://sveltejs.github.io/eslint-plugin-svelte/
MIT License
290 stars 33 forks source link

experimental-require-slot-types not working with type aliases #528

Closed pawelblaszczyk5 closed 1 year ago

pawelblaszczyk5 commented 1 year ago

Before You File a Bug Report Please Confirm You Have Done The Following...

What version of ESLint are you using?

8.43.0

What version of eslint-plugin-svelte are you using?

2.32.0

What did you do?

Configuration ```json { "svelte/experimental-require-slot-types": "error" } ```
<script lang="ts">
    type $$Slots = {
        default: Record<string, never>;
    };
</script>

<slot />

What did you expect to happen?

Rules should be satisfied because RFC and Svelte language server works with type aliases as well. The declarations are correctly picked up and enforced by language server.

What actually happened?

1:2 error The component must define the $$Slots interface svelte/experimental-require-slot-types

Link to GitHub Repo with Minimal Reproducible Example

https://github.com/pawelblaszczyk5/svelte-eslint-bug-reproduction

https://sveltejs.github.io/eslint-plugin-svelte/playground/#eJwljEEKhDAQBL/SDB4F7xp9hF5zkWQUISSSmV0Q8e87spemu2jqplAiU09OQj1ORVrzPnpS8TT5DOh1MppmSUUFI+6XAZG39ZO0x8yh1OhE65H3Fpm/XKfhPT2WrvtbzWRDzIHOOj0/Ngon2w==

Additional comments

No response