From 258a08df05c09975184526035f82377acabff2f2 Mon Sep 17 00:00:00 2001 From: Simon Holthausen Date: Fri, 10 Mar 2023 17:53:11 +0100 Subject: [PATCH 1/3] docs: mention the types without types feature --- 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..fd15e95df5b8 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. + +You can read more about `$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. From 11514f437c1a75a2eafbb53b599f94a2e1cf74d7 Mon Sep 17 00:00:00 2001 From: Simon Holthausen Date: Fri, 10 Mar 2023 17:54:05 +0100 Subject: [PATCH 2/3] mention svelte-check --- documentation/docs/20-core-concepts/10-routing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/docs/20-core-concepts/10-routing.md b/documentation/docs/20-core-concepts/10-routing.md index fd15e95df5b8..a7a1d75217d6 100644 --- a/documentation/docs/20-core-concepts/10-routing.md +++ b/documentation/docs/20-core-concepts/10-routing.md @@ -348,7 +348,7 @@ 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. +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 `$types` in our [blog post](https://svelte.dev/blog/zero-config-type-safety) about it. From 48626a83c9c684493876ef4cb72252d9ff4da5bf Mon Sep 17 00:00:00 2001 From: Simon H <5968653+dummdidumm@users.noreply.github.com> Date: Wed, 15 Mar 2023 14:28:33 +0100 Subject: [PATCH 3/3] Update documentation/docs/20-core-concepts/10-routing.md Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com> --- documentation/docs/20-core-concepts/10-routing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/docs/20-core-concepts/10-routing.md b/documentation/docs/20-core-concepts/10-routing.md index a7a1d75217d6..d18496b3c9df 100644 --- a/documentation/docs/20-core-concepts/10-routing.md +++ b/documentation/docs/20-core-concepts/10-routing.md @@ -350,7 +350,7 @@ In turn, annotating the `load` function with `PageLoad`, `PageServerLoad`, `Layo 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 `$types` in our [blog post](https://svelte.dev/blog/zero-config-type-safety) about it. +You can read more about omitting `$types` in our [blog post](https://svelte.dev/blog/zero-config-type-safety) about it. ## Other files