Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cli): use typescript by default for new projects #3836

Merged
merged 1 commit into from
Nov 3, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export default async function initSanity(
}

// Use typescript?
let useTypeScript = false
let useTypeScript = true
if (typeof cliFlags.typescript === 'boolean') {
useTypeScript = cliFlags.typescript
} else if (!unattended) {
Expand Down
2 changes: 1 addition & 1 deletion packages/@sanity/cli/src/actions/init-project/prompts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export function promptForTypeScript(prompt: CliPrompter): Promise<boolean> {
return prompt.single({
type: 'confirm',
message: 'Do you want to use TypeScript?',
default: false,
default: true,
})
}

Expand Down
2 changes: 1 addition & 1 deletion packages/@sanity/cli/src/commands/init/initCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Options
--project-plan <name> Optionally select a plan for a new project
--coupon <name> Optionally select a coupon for a new project (cannot be used with --project-plan)
--reconfigure Reconfigure Sanity studio in current folder with new project/dataset
--typescript Use TypeScript for template files
--no-typescript Do not use TypeScript for template files

Examples
# Initialize a new project, prompt for required information along the way
Expand Down