Closed ohmree closed 2 years ago
These warnings are from the svelte compiler. So it doesn't make sense for it to support reading a .d.ts
file to find out global variables.
For ways to filter out the warning, it's tracked in https://github.com/sveltejs/language-tools/issues/855. And for allowing configuration for defining global variables for the svelte compiler. it's tracked in https://github.com/sveltejs/svelte/issues/7240.
Closing in favour of these two issues.
Is your feature request related to a problem? Please describe. I tried using
unplugin-auto-import
with the sveltekit demo app template (ts, eslint and prettier all enabled). It generates anauto-imports.d.ts
file that looks like this:And the language server and
svelte-check
complain about it:When the resulting code does in fact work: I can see the transitions and animations as defined by the default template, as well as the
IconCarbonApps
component (which compiles into a svg tag) without having explicitly imported them.Also I'm not sure it's related, but
vite-plugin-svelte
also complains about the icon component on HMR even though there's no visual difference between including and omitting its import statement:One hypothesis I have is that this could be related to the vite plugin order, but I digress.
Describe the solution you'd like I'd like to not receive warnings in my editor (doom emacs with lsp-mode in case that matters), in the
svelte-check
cli and from the vite plugin.Describe alternatives you've considered
Additional context N/A.