Reputation: 20382
Whenever I create a SvelteKit project using
npx sv create my-app
there are apparently no Typescript definitions which causes VS Code to underline pretty much my entire code in red. e.g.:
I am just doing what Svelte has in its docs:
Throughout the examples above, we’ve been importing types from a $types.d.ts file. This is a file SvelteKit creates for you in a hidden directory if you’re using TypeScript (or JavaScript with JSDoc type annotations) to give you type safety when working with your root files.
I did find a types.d.ts
file .svelte-kit/types/src/routes/$types.d.ts
in my project root. I have pasted it here. And my package.json
is pasted here.
What can I do to fix this as its just too annoying and happens with all of my SvelteKit projects?
Upvotes: 1
Views: 14