Skip to content

Commit 119bff9

Browse files
authored
feat: make TypeScript the default for apps (#12186)
1 parent 22ab4c1 commit 119bff9

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

.changeset/twelve-singers-bake.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"create-svelte": minor
3+
---
4+
5+
feat: make TypeScript the default for apps

packages/create-svelte/bin.js

+9-7
Original file line numberDiff line numberDiff line change
@@ -59,19 +59,21 @@ const options = await p.group(
5959
})
6060
}),
6161

62-
types: () =>
62+
types: ({ results }) =>
6363
p.select({
6464
message: 'Add type checking with TypeScript?',
65-
initialValue: /** @type {'checkjs' | 'typescript' | null} */ ('checkjs'),
65+
initialValue: /** @type {'checkjs' | 'typescript' | null} */ (
66+
results.template === 'skeletonlib' ? 'checkjs' : 'typescript'
67+
),
6668
options: [
67-
{
68-
label: 'Yes, using JavaScript with JSDoc comments',
69-
value: 'checkjs'
70-
},
7169
{
7270
label: 'Yes, using TypeScript syntax',
7371
value: 'typescript'
7472
},
73+
{
74+
label: 'Yes, using JavaScript with JSDoc comments',
75+
value: 'checkjs'
76+
},
7577
{ label: 'No', value: null }
7678
]
7779
}),
@@ -110,7 +112,7 @@ const options = await p.group(
110112
await create(cwd, {
111113
name: path.basename(path.resolve(cwd)),
112114
template: /** @type {'default' | 'skeleton' | 'skeletonlib'} */ (options.template),
113-
types: options.types,
115+
types: /** @type {'checkjs' | 'typescript' | null} */ (options.types),
114116
prettier: options.features.includes('prettier'),
115117
eslint: options.features.includes('eslint'),
116118
playwright: options.features.includes('playwright'),

0 commit comments

Comments
 (0)