From b48b98ce0618eb3d142c0ce86a765502fb4ac190 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BF=A0=20/=20green?= Date: Wed, 18 Dec 2024 19:41:08 +0900 Subject: [PATCH] feat(create-vite): align tsconfigs in svelte-ts template with others (#18995) --- .../template-svelte-ts/tsconfig.app.json | 20 ++++++++++++++++ .../template-svelte-ts/tsconfig.json | 24 ++++--------------- .../template-svelte-ts/tsconfig.node.json | 17 ++++++++++--- 3 files changed, 39 insertions(+), 22 deletions(-) create mode 100644 packages/create-vite/template-svelte-ts/tsconfig.app.json diff --git a/packages/create-vite/template-svelte-ts/tsconfig.app.json b/packages/create-vite/template-svelte-ts/tsconfig.app.json new file mode 100644 index 00000000000000..55a2f9b6548ebf --- /dev/null +++ b/packages/create-vite/template-svelte-ts/tsconfig.app.json @@ -0,0 +1,20 @@ +{ + "extends": "@tsconfig/svelte/tsconfig.json", + "compilerOptions": { + "target": "ESNext", + "useDefineForClassFields": true, + "module": "ESNext", + "resolveJsonModule": true, + /** + * Typecheck JS in `.svelte` and `.js` files by default. + * Disable checkJs if you'd like to use dynamic types in JS. + * Note that setting allowJs false does not prevent the use + * of JS in `.svelte` files. + */ + "allowJs": true, + "checkJs": true, + "isolatedModules": true, + "moduleDetection": "force" + }, + "include": ["src/**/*.ts", "src/**/*.js", "src/**/*.svelte"] +} diff --git a/packages/create-vite/template-svelte-ts/tsconfig.json b/packages/create-vite/template-svelte-ts/tsconfig.json index df56300cc65f66..1ffef600d959ec 100644 --- a/packages/create-vite/template-svelte-ts/tsconfig.json +++ b/packages/create-vite/template-svelte-ts/tsconfig.json @@ -1,21 +1,7 @@ { - "extends": "@tsconfig/svelte/tsconfig.json", - "compilerOptions": { - "target": "ESNext", - "useDefineForClassFields": true, - "module": "ESNext", - "resolveJsonModule": true, - /** - * Typecheck JS in `.svelte` and `.js` files by default. - * Disable checkJs if you'd like to use dynamic types in JS. - * Note that setting allowJs false does not prevent the use - * of JS in `.svelte` files. - */ - "allowJs": true, - "checkJs": true, - "isolatedModules": true, - "moduleDetection": "force" - }, - "include": ["src/**/*.ts", "src/**/*.js", "src/**/*.svelte"], - "references": [{ "path": "./tsconfig.node.json" }] + "files": [], + "references": [ + { "path": "./tsconfig.app.json" }, + { "path": "./tsconfig.node.json" } + ] } diff --git a/packages/create-vite/template-svelte-ts/tsconfig.node.json b/packages/create-vite/template-svelte-ts/tsconfig.node.json index 46d1fa3b16d5a7..db0becc8b033a4 100644 --- a/packages/create-vite/template-svelte-ts/tsconfig.node.json +++ b/packages/create-vite/template-svelte-ts/tsconfig.node.json @@ -1,12 +1,23 @@ { "compilerOptions": { - "composite": true, "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", - "skipLibCheck": true, + "target": "ES2022", + "lib": ["ES2023"], "module": "ESNext", + "skipLibCheck": true, + + /* Bundler mode */ "moduleResolution": "bundler", - "strict": true, + "allowImportingTsExtensions": true, + "isolatedModules": true, + "moduleDetection": "force", "noEmit": true, + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true, "noUncheckedSideEffectImports": true }, "include": ["vite.config.ts"]