Skip to content

Commit 51dbd72

Browse files
committed
upgrade typescript
1 parent 235414e commit 51dbd72

File tree

5 files changed

+13
-9
lines changed

5 files changed

+13
-9
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
},
4242
"devDependencies": {
4343
"@storybook/linter-config": "^3.1.2",
44-
"@tsconfig/node14": "^1.0.3",
44+
"@tsconfig/node18": "^18.2.2",
4545
"@types/node": "^18.7.23",
4646
"@types/yargs": "^17.0.13",
4747
"auto": "^10.37.6",

pnpm-lock.yaml

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/bin.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const main = async () => {
3939
types: {
4040
alias: 'y',
4141
description: 'How types will be written',
42-
choices: ['checkjs', 'typescript', null] as any,
42+
choices: ['checkjs', 'typescript', 'null'] as const,
4343
demandOption: true,
4444
coerce: (value: string) => (value === 'null' ? null : value),
4545
},
@@ -81,6 +81,8 @@ const main = async () => {
8181
})
8282
.parseSync();
8383

84+
const types = argv.types as 'checkjs' | 'typescript' | null;
85+
8486
if (!argv.directory) {
8587
argv.directory = argv.name;
8688
argv.d = argv.name;
@@ -107,7 +109,7 @@ Will call create-svelte with the following arguments:
107109
await create(argv.directory, {
108110
name: argv.name,
109111
template: argv.template,
110-
types: argv.types,
112+
types: types,
111113
prettier: argv.prettier,
112114
eslint: argv.eslint,
113115
playwright: argv.playwright,

src/declarations.d.ts

-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +0,0 @@
1-
// create-svelte is typed with jsdocs but declarations files aren't currently being distributed so we can't use the types
2-
declare module 'create-svelte';

tsconfig.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
{
2-
"extends": "@tsconfig/node14/tsconfig.json",
3-
"compilerOptions": {
4-
"module": "ESNext"
5-
},
2+
"extends": "@tsconfig/node18/tsconfig.json",
63
"include": ["src/**/*"]
74
}

0 commit comments

Comments
 (0)