Using VS Code with Sveltekit, I see intellisense suggesting auto imports with relative paths. When an import selected, it adds it correctly: import Accordion from '$lib/components/Accordion.svelte';
I then wanted VS Code to respect the $lib
alias, which is defined by default by SvelteKit. It wasn't hapenning out of the box, so I added:
"paths": {
"$lib": ["./src/lib"],
"$lib/*": ["./src/lib/*"]
}
to tsconfig.json
After this, intellisense does suggest $lib/components/Accordion.svelte
, which is the desired behavior. But when selected, it adds the import with curly braces around the component name: import { Accordion } from '$lib/components/Accordion.svelte
, which results in the Module has no exported member
error.
How can I get auto-import to import without curly braces where relevant?