Skip to content

Commit

Permalink
feat: make TypeScript the default for apps
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed May 4, 2024
1 parent 7a62572 commit cd2cd2e
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 @@ -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

0 comments on commit cd2cd2e

Please sign in to comment.