Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/twelve-singers-bake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-svelte": minor
---

feat: make TypeScript the default for apps
16 changes: 9 additions & 7 deletions packages/create-svelte/bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,21 @@ const options = await p.group(
})
}),

types: () =>
types: ({ results }) =>
p.select({
message: 'Add type checking with TypeScript?',
initialValue: /** @type {'checkjs' | 'typescript' | null} */ ('checkjs'),
initialValue: /** @type {'checkjs' | 'typescript' | null} */ (
results.template === 'skeletonlib' ? 'checkjs' : 'typescript'
),
options: [
{
label: 'Yes, using JavaScript with JSDoc comments',
value: 'checkjs'
},
{
label: 'Yes, using TypeScript syntax',
value: 'typescript'
},
{
label: 'Yes, using JavaScript with JSDoc comments',
value: 'checkjs'
},
{ label: 'No', value: null }
]
}),
Expand Down Expand Up @@ -111,7 +113,7 @@ const options = await p.group(
await create(cwd, {
name: path.basename(path.resolve(cwd)),
template: /** @type {'default' | 'skeleton' | 'skeletonlib'} */ (options.template),
types: options.types,
types: /** @type {'checkjs' | 'typescript' | null} */ (options.types),
prettier: options.features.includes('prettier'),
eslint: options.features.includes('eslint'),
playwright: options.features.includes('playwright'),
Expand Down