I noticed some generic types are not referenced properly in svelte files, if they have default value.
I'll include some code snippets to better illustrate what I'm talking about.
Examples are taken from urql.
From operationStore.d.ts
export interface OperationStore<Data = any, Vars = any, Result = Data>
AFAIU, if not specified, third generic (Result) is supposed to be the same type as the first one (Data).
something.svelte
As you can see in screenshot, if I specify two generics in svelte file, I get unreferenced third generic Data that is the culprit of unresolved variable errors I get in Webstorm.
Now if I do the same in standalone ts file something.ts I get correct types.
At first I thought it's a problem with tsconfig or something, but in VSCode, I get the same result in svelte file as in Webstorm in typescript file.
edit: It's also interesting that inferred typing in svelte files works correctly
I noticed some generic types are not referenced properly in svelte files, if they have default value.
I'll include some code snippets to better illustrate what I'm talking about.
Examples are taken from urql. From
operationStore.d.ts
AFAIU, if not specified, third generic (Result) is supposed to be the same type as the first one (Data).
something.svelte
As you can see in screenshot, if I specify two generics in svelte file, I get unreferenced third generic
Data
that is the culprit of unresolved variable errors I get in Webstorm.Now if I do the same in standalone ts file
something.ts
I get correct types.At first I thought it's a problem with tsconfig or something, but in VSCode, I get the same result in svelte file as in Webstorm in typescript file.
edit: It's also interesting that inferred typing in svelte files works correctly