user3532505
user3532505

Reputation: 419

Astro, Typescript and svelte-check

I'm building a frontend project using Astro. For some dynamic components I added svelte as a UI framework.

Now I want to integrate svelte-check but the command is failing because of: Type annotations can only be used in TypeScript files.

E.g. export let languageCode: string doesn't seem to be correct, even though the Astro project compiles fine using npm run build.

Any ideas on how to fix this error? Thanks.

Upvotes: 2

Views: 342

Answers (1)

user3532505
user3532505

Reputation: 419

I figured out the issue can be fixed when removing comments in the svelte component.

E.g. having this in the svelte component shows the above error

<!--
  Some comment…
-->

When removing these lines, the error is gone.

Upvotes: 0

Related Questions