Skip to content

Commit

Permalink
feat(create-vite): use typescript 5.0 in templates (#12481)
Browse files Browse the repository at this point in the history
  • Loading branch information
nickserv authored Mar 30, 2023
1 parent 51f68f9 commit 8582e2d
Show file tree
Hide file tree
Showing 26 changed files with 74 additions and 78 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"simple-git-hooks": "^2.8.1",
"tslib": "^2.5.0",
"tsx": "^3.12.6",
"typescript": "^4.9.3",
"typescript": "^5.0.2",
"unbuild": "^1.1.2",
"vite": "workspace:*",
"vitepress": "^1.0.0-alpha.61",
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 @@ -12,7 +12,7 @@
"lit": "^2.6.1"
},
"devDependencies": {
"typescript": "^4.9.3",
"typescript": "^5.0.2",
"vite": "^4.2.1"
}
}
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 @@ -8,11 +8,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-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.1"
}
}
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.1"
}
}
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.57.0",
"svelte-check": "^2.10.3",
"tslib": "^2.5.0",
"typescript": "^4.9.3",
"typescript": "^5.0.2",
"vite": "^4.2.1"
}
}
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.1"
}
}
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.1",
"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
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

0 comments on commit 8582e2d

Please sign in to comment.