From c45c35e7b40837cd1bea3fc26cfb831478e03c00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jeremy=20M=C3=B6glich?= Date: Mon, 13 Mar 2023 15:47:00 +0100 Subject: [PATCH] fix: allow extending multiple other tsconfigs (#9413) possible since typescript 5.0 closes #9412 --------- Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com> --- .changeset/metal-pugs-wink.md | 5 +++++ packages/kit/src/core/sync/write_tsconfig.js | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 .changeset/metal-pugs-wink.md diff --git a/.changeset/metal-pugs-wink.md b/.changeset/metal-pugs-wink.md new file mode 100644 index 000000000000..06f9b27d2414 --- /dev/null +++ b/.changeset/metal-pugs-wink.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/kit': patch +--- + +fix: allow tsconfig to extend multiple other tsconfigs diff --git a/packages/kit/src/core/sync/write_tsconfig.js b/packages/kit/src/core/sync/write_tsconfig.js index 6f3b41398b94..9f3a083649fe 100644 --- a/packages/kit/src/core/sync/write_tsconfig.js +++ b/packages/kit/src/core/sync/write_tsconfig.js @@ -176,7 +176,12 @@ function load_user_tsconfig(cwd) { function validate_user_config(kit, cwd, out, config) { // we need to check that the user's tsconfig extends the framework config const extend = config.options.extends; - const extends_framework_config = extend && path.resolve(cwd, extend) === out; + const extends_framework_config = + typeof extend === 'string' + ? path.resolve(cwd, extend) === out + : Array.isArray(extend) + ? extend.some((e) => path.resolve(cwd, e) === out) + : false; const options = config.options.compilerOptions || {};