From a784ad4cd181a256727732f889a7668f6808a4dd Mon Sep 17 00:00:00 2001 From: Bjorn Lu Date: Fri, 3 Nov 2023 18:07:07 +0800 Subject: [PATCH] chore: update tsconfig setup (#780) * chore: update tsconfig setup * chore: use target es2022 --- packages/e2e-tests/inspector-vite/jsconfig.json | 6 +++--- packages/e2e-tests/svelte-preprocess/tsconfig.json | 6 +++--- packages/e2e-tests/tsconfig.json | 6 +++--- .../playground/big-component-library-vite-ssr/jsconfig.json | 2 +- packages/playground/big-component-library/jsconfig.json | 6 +++--- packages/playground/optimizedeps-include/jsconfig.json | 6 +++--- packages/vite-plugin-svelte-inspector/tsconfig.json | 6 +++--- packages/vite-plugin-svelte/src/handle-hot-update.js | 2 +- packages/vite-plugin-svelte/src/utils/watch.js | 2 +- packages/vite-plugin-svelte/tsconfig.json | 6 +++--- 10 files changed, 24 insertions(+), 24 deletions(-) diff --git a/packages/e2e-tests/inspector-vite/jsconfig.json b/packages/e2e-tests/inspector-vite/jsconfig.json index 7ed0c376b..ecaa58acb 100644 --- a/packages/e2e-tests/inspector-vite/jsconfig.json +++ b/packages/e2e-tests/inspector-vite/jsconfig.json @@ -1,8 +1,8 @@ { "compilerOptions": { - "moduleResolution": "node", - "target": "esnext", - "module": "esnext", + "moduleResolution": "Node16", + "target": "ESNext", + "module": "ESNext", /** * svelte-preprocess cannot figure out whether you have * a value or a type, so tell TypeScript to enforce using diff --git a/packages/e2e-tests/svelte-preprocess/tsconfig.json b/packages/e2e-tests/svelte-preprocess/tsconfig.json index bc54e3c80..717c57741 100644 --- a/packages/e2e-tests/svelte-preprocess/tsconfig.json +++ b/packages/e2e-tests/svelte-preprocess/tsconfig.json @@ -1,8 +1,8 @@ { "compilerOptions": { - "moduleResolution": "node", - "target": "esnext", - "module": "esnext", + "moduleResolution": "Bundler", + "target": "ESNext", + "module": "ESNext", /** * svelte-preprocess cannot figure out whether you have * a value or a type, so tell TypeScript to enforce using diff --git a/packages/e2e-tests/tsconfig.json b/packages/e2e-tests/tsconfig.json index de36077ab..363470ae6 100644 --- a/packages/e2e-tests/tsconfig.json +++ b/packages/e2e-tests/tsconfig.json @@ -2,14 +2,14 @@ "include": ["."], "exclude": ["**/dist/**", "**/build/**", "**/node_modules/**"], "compilerOptions": { - "target": "esnext", - "module": "esnext", + "target": "ESNext", + "module": "ESNext", "outDir": "dist", "baseUrl": ".", "allowJs": true, "esModuleInterop": true, "resolveJsonModule": true, - "moduleResolution": "node", + "moduleResolution": "Bundler", "skipLibCheck": true, "noUnusedLocals": true, "jsx": "preserve", diff --git a/packages/playground/big-component-library-vite-ssr/jsconfig.json b/packages/playground/big-component-library-vite-ssr/jsconfig.json index 913970cf8..20cc0be91 100644 --- a/packages/playground/big-component-library-vite-ssr/jsconfig.json +++ b/packages/playground/big-component-library-vite-ssr/jsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "moduleResolution": "Node", + "moduleResolution": "Bundler", "target": "ESNext", "module": "ESNext", /** diff --git a/packages/playground/big-component-library/jsconfig.json b/packages/playground/big-component-library/jsconfig.json index 7ed0c376b..e0fe30cb3 100644 --- a/packages/playground/big-component-library/jsconfig.json +++ b/packages/playground/big-component-library/jsconfig.json @@ -1,8 +1,8 @@ { "compilerOptions": { - "moduleResolution": "node", - "target": "esnext", - "module": "esnext", + "moduleResolution": "Bundler", + "target": "ESNext", + "module": "ESNext", /** * svelte-preprocess cannot figure out whether you have * a value or a type, so tell TypeScript to enforce using diff --git a/packages/playground/optimizedeps-include/jsconfig.json b/packages/playground/optimizedeps-include/jsconfig.json index 7ed0c376b..e0fe30cb3 100644 --- a/packages/playground/optimizedeps-include/jsconfig.json +++ b/packages/playground/optimizedeps-include/jsconfig.json @@ -1,8 +1,8 @@ { "compilerOptions": { - "moduleResolution": "node", - "target": "esnext", - "module": "esnext", + "moduleResolution": "Bundler", + "target": "ESNext", + "module": "ESNext", /** * svelte-preprocess cannot figure out whether you have * a value or a type, so tell TypeScript to enforce using diff --git a/packages/vite-plugin-svelte-inspector/tsconfig.json b/packages/vite-plugin-svelte-inspector/tsconfig.json index 90b557e70..742202f01 100644 --- a/packages/vite-plugin-svelte-inspector/tsconfig.json +++ b/packages/vite-plugin-svelte-inspector/tsconfig.json @@ -2,9 +2,9 @@ "include": ["src"], "compilerOptions": { "noEmit": true, - "target": "ES2020", - "module": "ES2022", - "moduleResolution": "node", + "target": "ES2022", + "module": "Node16", + "moduleResolution": "Node16", "strict": true, "noUnusedLocals": true, "baseUrl": ".", diff --git a/packages/vite-plugin-svelte/src/handle-hot-update.js b/packages/vite-plugin-svelte/src/handle-hot-update.js index 6f2f78c85..46b9cf1cc 100644 --- a/packages/vite-plugin-svelte/src/handle-hot-update.js +++ b/packages/vite-plugin-svelte/src/handle-hot-update.js @@ -7,7 +7,7 @@ import { toRollupError } from './utils/error.js'; * @param {Function} compileSvelte * @param {import('vite').HmrContext} ctx * @param {import('./types/id.d.ts').SvelteRequest} svelteRequest - * @param {import('./utils/vite-plugin-svelte-cache').VitePluginSvelteCache} cache + * @param {import('./utils/vite-plugin-svelte-cache.js').VitePluginSvelteCache} cache * @param {import('./types/options.d.ts').ResolvedOptions} options * @returns {Promise} */ diff --git a/packages/vite-plugin-svelte/src/utils/watch.js b/packages/vite-plugin-svelte/src/utils/watch.js index 70f3b33e3..007578468 100644 --- a/packages/vite-plugin-svelte/src/utils/watch.js +++ b/packages/vite-plugin-svelte/src/utils/watch.js @@ -5,7 +5,7 @@ import path from 'node:path'; /** * @param {import('../types/options.d.ts').ResolvedOptions} options - * @param {import('./vite-plugin-svelte-cache').VitePluginSvelteCache} cache + * @param {import('./vite-plugin-svelte-cache.js').VitePluginSvelteCache} cache * @param {import('../types/id.d.ts').IdParser} requestParser * @returns {void} */ diff --git a/packages/vite-plugin-svelte/tsconfig.json b/packages/vite-plugin-svelte/tsconfig.json index 753c44ebb..2bc6a221f 100644 --- a/packages/vite-plugin-svelte/tsconfig.json +++ b/packages/vite-plugin-svelte/tsconfig.json @@ -2,9 +2,9 @@ "include": ["src"], "compilerOptions": { "noEmit": true, - "target": "ES2020", - "module": "ES2022", - "moduleResolution": "node", + "target": "ES2022", + "module": "Node16", + "moduleResolution": "Node16", "strict": true, "noUnusedLocals": true, "baseUrl": ".",