Skip to content

🐛 Type imports in Svelte files are not detected when using svelte compiler #1670

@arnolicious

Description

@arnolicious

Prerequisites

Reproduction url

https://github.com/arnolicious/knip-compiler-types-repro

Reproduction access

  • I've made sure the reproduction is publicly accessible

Description of the issue

When using knip with the "real" svelte compiler, knip fails to detect types that are imported in svelte files.

When not using the "real" svelte compiler, knip detects the types just fine, but then fails to detect svelte specific features, such as dynamic component imports.

I assume the solution is to somehow configure / patch the compile step to also include types, however I wouldn't really know where to start.

Unfortunately in this state, this makes it very difficult to use knip in a large sveltekit project

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions