From 5d9c670c35394b8c76984e1c01ab47321bc669df Mon Sep 17 00:00:00 2001 From: Simon H <5968653+dummdidumm@users.noreply.github.com> Date: Wed, 15 Mar 2023 22:26:30 +0100 Subject: [PATCH] docs: mention the types without types feature (#9397) Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com> --- documentation/docs/20-core-concepts/10-routing.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/documentation/docs/20-core-concepts/10-routing.md b/documentation/docs/20-core-concepts/10-routing.md index 763116eed41a..d18496b3c9df 100644 --- a/documentation/docs/20-core-concepts/10-routing.md +++ b/documentation/docs/20-core-concepts/10-routing.md @@ -348,6 +348,10 @@ For example, annotating `export let data` with `PageData` (or `LayoutData`, for In turn, annotating the `load` function with `PageLoad`, `PageServerLoad`, `LayoutLoad` or `LayoutServerLoad` (for `+page.js`, `+page.server.js`, `+layout.js` and `+layout.server.js` respectively) ensures that `params` and the return value are correctly typed. +If you're using VS Code or any IDE that supports the language server protocol and TypeScript plugins then you can omit these types _entirely_! Svelte's IDE tooling will insert the correct types for you, so you'll get type checking without writing them yourself. It also works with our command line tool `svelte-check`. + +You can read more about omitting `$types` in our [blog post](https://svelte.dev/blog/zero-config-type-safety) about it. + ## Other files Any other files inside a route directory are ignored by SvelteKit. This means you can colocate components and utility modules with the routes that need them.