From d89a013ce56cf63e80a374915d0d1949e1e029f2 Mon Sep 17 00:00:00 2001 From: Eli Albert Date: Fri, 31 Jul 2020 10:20:53 -0500 Subject: [PATCH] Update typescript.md some advice about getting vscode to allow absolute imports and not just relative ones. This little gotcha took me a while. --- docs/preprocessors/typescript.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/preprocessors/typescript.md b/docs/preprocessors/typescript.md index 0beb60784..f51488778 100644 --- a/docs/preprocessors/typescript.md +++ b/docs/preprocessors/typescript.md @@ -128,3 +128,13 @@ $: show = !!data.someKey; // <-- `show` now has type `boolean` ### Can I use TypeScript syntax inside the template/mustache tags? At the moment, you cannot. Only `script`/`style` tags are preprocessed/transpiled. See [this issue](https://github.com/sveltejs/svelte/issues/4701) for more info. + +### Why is VSCode not finding absolute paths for type imports? + +You may need to set `baseUrl` in `tsconfig.json` at the project root to include (restart the language server to see this take effect): +``` +"compilerOptions": { + "baseUrl": "." + } +} +```