Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(create-vite): use typescript 5.0 in templates #12481

Merged
merged 11 commits into from
Mar 30, 2023
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"npm-run-all": "^4.1.5",
"picocolors": "^1.0.0",
"playwright-chromium": "^1.31.2",
"prettier": "2.8.4",
"prettier": "2.8.5",
"prompts": "^2.4.2",
"resolve": "^1.22.1",
"rimraf": "^4.1.2",
Expand All @@ -84,7 +84,7 @@
"simple-git-hooks": "^2.8.1",
"tslib": "^2.5.0",
"tsx": "^3.12.3",
"typescript": "^4.9.3",
"typescript": "^5.0.2",
"unbuild": "^1.1.2",
"vite": "workspace:*",
"vitepress": "^1.0.0-alpha.49",
Expand Down
2 changes: 1 addition & 1 deletion packages/create-vite/template-lit-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"lit": "^2.6.1"
},
"devDependencies": {
"typescript": "^4.9.3",
"typescript": "^5.0.2",
"vite": "^4.2.0"
}
}
4 changes: 1 addition & 3 deletions packages/create-vite/template-lit-ts/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"moduleResolution": "Node",
"moduleResolution": "bundler",
"isolatedModules": true,
"allowSyntheticDefaultImports": true,
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true,
"useDefineForClassFields": false,
"skipLibCheck": true
},
Expand Down
2 changes: 1 addition & 1 deletion packages/create-vite/template-lit-ts/tsconfig.node.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"composite": true,
"module": "ESNext",
"moduleResolution": "Node",
"moduleResolution": "bundler",
"allowSyntheticDefaultImports": true
},
"include": ["vite.config.ts"]
Expand Down
2 changes: 1 addition & 1 deletion packages/create-vite/template-preact-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"devDependencies": {
"@preact/preset-vite": "^2.5.0",
"typescript": "^4.9.3",
"typescript": "^5.0.2",
"vite": "^4.2.0"
}
}
3 changes: 1 addition & 2 deletions packages/create-vite/template-preact-ts/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
"esModuleInterop": false,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "ESNext",
"moduleResolution": "Node",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/create-vite/template-preact-ts/tsconfig.node.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"composite": true,
"module": "ESNext",
"moduleResolution": "Node",
"moduleResolution": "bundler",
"allowSyntheticDefaultImports": true
},
"include": ["vite.config.ts"]
Expand Down
2 changes: 1 addition & 1 deletion packages/create-vite/template-react-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@types/react": "^18.0.28",
"@types/react-dom": "^18.0.11",
"@vitejs/plugin-react": "^3.1.0",
"typescript": "^4.9.3",
"typescript": "^5.0.2",
"vite": "^4.2.0"
}
}
3 changes: 1 addition & 2 deletions packages/create-vite/template-react-ts/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
"esModuleInterop": false,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "ESNext",
"moduleResolution": "Node",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/create-vite/template-react-ts/tsconfig.node.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"composite": true,
"module": "ESNext",
"moduleResolution": "Node",
"moduleResolution": "bundler",
"allowSyntheticDefaultImports": true
},
"include": ["vite.config.ts"]
Expand Down
2 changes: 1 addition & 1 deletion packages/create-vite/template-svelte-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"svelte": "^3.55.1",
"svelte-check": "^2.10.3",
"tslib": "^2.5.0",
"typescript": "^4.9.3",
"typescript": "^5.0.2",
"vite": "^4.2.0"
}
}
2 changes: 1 addition & 1 deletion packages/create-vite/template-svelte-ts/tsconfig.node.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"composite": true,
"module": "ESNext",
"moduleResolution": "Node"
"moduleResolution": "bundler"
},
"include": ["vite.config.ts"]
}
5 changes: 2 additions & 3 deletions packages/create-vite/template-svelte/jsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"compilerOptions": {
"moduleResolution": "Node",
"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
* `import type` instead of `import` for Types.
*/
"importsNotUsedAsValues": "error",
"verbatimModuleSyntax": true,
"isolatedModules": true,
"resolveJsonModule": true,
/**
Expand All @@ -18,7 +18,6 @@
"sourceMap": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
/**
* Typecheck JS in `.svelte` and `.js` files by default.
* Disable this if you'd like to use dynamic types.
Expand Down
2 changes: 1 addition & 1 deletion packages/create-vite/template-vanilla-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"preview": "vite preview"
},
"devDependencies": {
"typescript": "^4.9.3",
"typescript": "^5.0.2",
"vite": "^4.2.0"
}
}
2 changes: 1 addition & 1 deletion packages/create-vite/template-vanilla-ts/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"useDefineForClassFields": true,
"module": "ESNext",
"lib": ["ESNext", "DOM"],
"moduleResolution": "Node",
"moduleResolution": "bundler",
"strict": true,
"resolveJsonModule": true,
"isolatedModules": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/create-vite/template-vue-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"devDependencies": {
"@vitejs/plugin-vue": "^4.1.0",
"typescript": "^4.9.3",
"typescript": "^5.0.2",
"vite": "^4.2.0",
"vue-tsc": "^1.2.0"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/create-vite/template-vue-ts/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"target": "ESNext",
"useDefineForClassFields": true,
"module": "ESNext",
"moduleResolution": "Node",
"moduleResolution": "bundler",
"strict": true,
"jsx": "preserve",
"resolveJsonModule": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/create-vite/template-vue-ts/tsconfig.node.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"composite": true,
"module": "ESNext",
"moduleResolution": "Node",
"moduleResolution": "bundler",
"allowSyntheticDefaultImports": true
},
"include": ["vite.config.ts"]
Expand Down
2 changes: 1 addition & 1 deletion packages/create-vite/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"outDir": "dist",
"target": "ES2020",
"module": "ES2020",
"moduleResolution": "Node",
"moduleResolution": "bundler",
"strict": true,
"skipLibCheck": true,
"declaration": false,
Expand Down
3 changes: 2 additions & 1 deletion packages/vite/src/node/server/pluginContainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ export async function createPluginContainer(
for (const plugin of getSortedPlugins(hookName)) {
const hook = plugin[hookName]
if (!hook) continue
// @ts-expect-error hook is not a primitive
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore hook is not a primitive
nickserv marked this conversation as resolved.
Show resolved Hide resolved
const handler: Function = 'handler' in hook ? hook.handler : hook
if ((hook as { sequential?: boolean }).sequential) {
await Promise.all(parallelPromises)
Expand Down
2 changes: 1 addition & 1 deletion playground/hmr/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"outDir": "dist",
"allowJs": true,
"esModuleInterop": true,
"moduleResolution": "Node",
"moduleResolution": "bundler",
"baseUrl": ".",
"jsx": "preserve",
"types": ["vite/client", "node"]
Expand Down
2 changes: 1 addition & 1 deletion playground/tsconfig-json-load-error/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"target": "ESNext",
"module": "ESNext",
"lib": ["ESNext", "DOM"],
"moduleResolution": "Node",
"moduleResolution": "bundler",
"strict": true,
"sourceMap": true,
"resolveJsonModule": true,
Expand Down
2 changes: 1 addition & 1 deletion playground/tsconfig-json/nested/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"target": "ESNext",
"module": "ESNext",
"lib": ["ESNext", "DOM"],
"moduleResolution": "Node",
"moduleResolution": "bundler",
"strict": true,
"sourceMap": true,
"resolveJsonModule": true,
Expand Down
2 changes: 1 addition & 1 deletion playground/tsconfig-json/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"target": "ESNext",
"module": "ESNext",
"lib": ["ESNext", "DOM"],
"moduleResolution": "Node",
"moduleResolution": "bundler",
"strict": true,
"sourceMap": true,
"resolveJsonModule": true,
Expand Down
2 changes: 1 addition & 1 deletion playground/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"allowJs": true,
"esModuleInterop": true,
"resolveJsonModule": true,
"moduleResolution": "Node",
"moduleResolution": "bundler",
"skipLibCheck": true,
"noUnusedLocals": true,
"jsx": "preserve",
Expand Down
Loading