vscode intellisense errors on the same type definition in some files, but not others
e.g. the following type:
In some files, this works fine. In others, in the exact same project, this causes the following error:
Any ideas for what might be going on?
4 Replies
Aha, I think I've figured ti out. This is something to do with sveltekit's implicit typing. In
+server.ts
or +page.ts
modules, it appears that the type
import resolves to:
in arktype/out/type.d.ts
In files not prefixed with a +
, it resolves to namespace type { ...
in arktype/out/keywords/ark.d.ts
.
Any suggestions for how I fix this / force the type
import to be correct?
ah, I think it's an interaction with the svelte language server. Disabling the svelte language extension fixes the problem.I suspect the file mangling done here: https://github.com/sveltejs/language-tools/blob/0655c67d25dfa9412f0aac8a1c48a7b3aaa28454/packages/svelte2tsx/src/helpers/sveltekit.ts#L133 - is causing issues
GitHub
language-tools/packages/svelte2tsx/src/helpers/sveltekit.ts at 0655...
The Svelte Language Server, and official extensions which use it - sveltejs/language-tools
update, it's not related to the language server, but rather the svelte extension ts plugin.
opened language-tools issue: https://github.com/sveltejs/language-tools/issues/2474
GitHub
Svelte extension resolves incorrect import types in kit files when ...
Describe the bug The bug appears to be in the typescript plugin for the language extension. It appears under the following conditions: you are working on a sveltekit project with sveltekit-superfor...