From b9e63381c8051c884395c30d54460ccaad526e7d Mon Sep 17 00:00:00 2001 From: Simon H <5968653+dummdidumm@users.noreply.github.com> Date: Mon, 19 Jul 2021 17:36:19 +0200 Subject: [PATCH] [fix] add DOM lib to create-svelte tsconfig (#1956) This makes the DOM ambient typings available to the user without errors. This is not 100% correct because on the server most of the typings are not available, but as soon as you want to use one of these, you need to add this to the lib list anyway. It also makes the svelte-kit package command export the correct dispatcher event types (#1943). --- .changeset/mean-pets-confess.md | 5 +++++ packages/create-svelte/shared/+typescript/tsconfig.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/mean-pets-confess.md diff --git a/.changeset/mean-pets-confess.md b/.changeset/mean-pets-confess.md new file mode 100644 index 000000000000..51349c5c70f4 --- /dev/null +++ b/.changeset/mean-pets-confess.md @@ -0,0 +1,5 @@ +--- +'create-svelte': patch +--- + +Add DOM to lib in tsconfig diff --git a/packages/create-svelte/shared/+typescript/tsconfig.json b/packages/create-svelte/shared/+typescript/tsconfig.json index 925722459a9e..773bd1f7d212 100644 --- a/packages/create-svelte/shared/+typescript/tsconfig.json +++ b/packages/create-svelte/shared/+typescript/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "moduleResolution": "node", "module": "es2020", - "lib": ["es2020"], + "lib": ["es2020", "DOM"], "target": "es2019", /** svelte-preprocess cannot figure out whether you have a value or a type, so tell TypeScript