From 7d9dfed5537c5abcff59f374558321e7edd73741 Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Tue, 3 Dec 2024 02:49:15 +0800 Subject: [PATCH 01/11] chore: update vite documentation link --- tsconfig.dom.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsconfig.dom.json b/tsconfig.dom.json index 42b10bd..4d4c29c 100644 --- a/tsconfig.dom.json +++ b/tsconfig.dom.json @@ -3,7 +3,7 @@ "compilerOptions": { "lib": [ // Target ES2020 to align with Vite. - // + // // Support for newer versions of language built-ins are // left for the users to include, because that would require: // - either the project doesn't need to support older versions of browsers; From 29acc1ae8f2ee0633465b2ac82b9cae8e086c187 Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Tue, 3 Dec 2024 02:51:15 +0800 Subject: [PATCH 02/11] docs: be specific about what kind of unwanted types we're avoiding --- tsconfig.dom.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tsconfig.dom.json b/tsconfig.dom.json index 4d4c29c..414085d 100644 --- a/tsconfig.dom.json +++ b/tsconfig.dom.json @@ -16,7 +16,8 @@ // No `ScriptHost` because Vue 3 dropped support for IE ], - // Set to empty to avoid accidental inclusion of unwanted types + // Set to empty to avoid accidental inclusion of unwanted types, + // e.g. the Node.js types that would pollute the global scope. "types": [] } } From 1a343449c6e041c7f3b57fb78f7727b36766e2d9 Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Wed, 19 Feb 2025 02:33:51 +0800 Subject: [PATCH 03/11] chore: use lowercase `bundler` for `moduleResolution` Closes #33 --- tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index 6584fa9..56402e7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,7 +13,7 @@ // We expect users to use bundlers. // So here we enable some resolution features that are only available in bundlers. - "moduleResolution": "Bundler", + "moduleResolution": "bundler", "resolveJsonModule": true, "allowImportingTsExtensions": true, // Even files without `import` or `export` are treated as modules. From 133441181b8aecfb109b5562bfc261f0a0656f33 Mon Sep 17 00:00:00 2001 From: moznion Date: Sun, 2 Mar 2025 16:11:05 +0900 Subject: [PATCH 04/11] docs: Bump up the requred Vue.js version to `>= 3.4` in README (#34) ref: https://github.com/vuejs/tsconfig/releases/tag/v0.7.0 > Require Vue.js >= 3.4 Signed-off-by: moznion --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 60068b5..4d1ab90 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ TSConfigs for Vue projects to extend. Requires TypeScript >= 5.0. For TypeScript v4.5 to v4.9, please use [v0.1.x](https://www.npmjs.com/package/@vue/tsconfig/v/0.1.3). -Requires Vue.js >= 3.3. +Requires Vue.js >= 3.4. [See below for the breaking changes in v0.3.x.](#migrating-from-typescript--50) From b22acb3fe38a56c00af1e320fbfd5c77dbc15d41 Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Sun, 16 Mar 2025 23:31:33 +0800 Subject: [PATCH 05/11] docs: explain the options in tsconfig.lib.json --- tsconfig.lib.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tsconfig.lib.json b/tsconfig.lib.json index d6b6fca..964598a 100644 --- a/tsconfig.lib.json +++ b/tsconfig.lib.json @@ -1,8 +1,13 @@ { "compilerOptions": { + // Emit declaration files for the library. "noEmit": false, "declaration": true, "emitDeclarationOnly": true, + + // Libraries generally require more strict type accuracy. + // For example, its types must be compatible with the Vue types. + // So we don't want to skip the type checking of its dependencies. "skipLibCheck": false } } From 85a620af98344ef2023d60334dc1fe236a0af950 Mon Sep 17 00:00:00 2001 From: ntnyq Date: Fri, 15 Aug 2025 15:33:14 +0800 Subject: [PATCH 06/11] feat!: disable `libReplacement` for better performance (#35) --- tsconfig.json | 1 + 1 file changed, 1 insertion(+) diff --git a/tsconfig.json b/tsconfig.json index 56402e7..1852ee8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -52,6 +52,7 @@ // Recommended "esModuleInterop": true, "forceConsistentCasingInFileNames": true, + "libReplacement": false, // See "skipLibCheck": true, } From e690a7658eeba51fd9e16ceb50224006d60610fe Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Fri, 15 Aug 2025 20:02:59 +0800 Subject: [PATCH 07/11] feat!: enable `noUncheckedIndexedAccess` and `exactOptionalPropertyTypes` (#36) See https://www.semver-ts.org/formal-spec/5-compiler-considerations.html#strictness for the arguments for turning these options on. Both are now turned on by default in the `tsc --init` template of TS 5.9 https://github.com/microsoft/TypeScript/pull/61813 --- tsconfig.json | 5 +++++ tsconfig.lib.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index 1852ee8..8b21832 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -31,6 +31,11 @@ "noImplicitThis": true, "strict": true, + // See + // These 2 options are also part of the recommended tsconfig as of TS 5.9 + "noUncheckedIndexedAccess": true, + "exactOptionalPropertyTypes": true, + // // Any imports or exports without a type modifier are left around. This is important for `