From b6cc34642b4d913ccc1e38cd9eb41b4093da36d2 Mon Sep 17 00:00:00 2001 From: "Lyu, Wei Da" Date: Thu, 6 Jul 2023 16:43:16 +0800 Subject: [PATCH 1/2] fix: generate type definition in strict mode --- packages/svelte/scripts/generate-dts.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/svelte/scripts/generate-dts.js b/packages/svelte/scripts/generate-dts.js index fe4b70e09a61..0ecf7127dfd2 100644 --- a/packages/svelte/scripts/generate-dts.js +++ b/packages/svelte/scripts/generate-dts.js @@ -16,6 +16,9 @@ fs.writeFileSync('./types/compiler/interfaces.d.ts', `import '../index.js';`); await createBundle({ output: 'types/index.d.ts', + compilerOptions: { + strict: true + }, modules: { svelte: 'src/runtime/public.d.ts', 'svelte/compiler': 'src/compiler/public.d.ts', From 230a0d910dbb692a712f3e5cc1d06129bc075eef Mon Sep 17 00:00:00 2001 From: "Lyu, Wei Da" Date: Thu, 6 Jul 2023 16:56:55 +0800 Subject: [PATCH 2/2] changeset --- .changeset/funny-bags-occur.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/funny-bags-occur.md diff --git a/.changeset/funny-bags-occur.md b/.changeset/funny-bags-occur.md new file mode 100644 index 000000000000..81f89bcd0f5d --- /dev/null +++ b/.changeset/funny-bags-occur.md @@ -0,0 +1,5 @@ +--- +'svelte': patch +--- + +fix: generate type definition with nullable types