Skip to content

Commit

Permalink
feat: make TypeScript the default for apps (#12186)
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann authored May 18, 2024
1 parent 22ab4c1 commit 119bff9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
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 @@ -59,19 +59,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 @@ -110,7 +112,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

0 comments on commit 119bff9

Please sign in to comment.