summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Erika <3019731+Princesseuh@users.noreply.github.com> 2022-08-06 10:04:39 -0400
committerGravatar GitHub <noreply@github.com> 2022-08-06 07:04:39 -0700
commit77c018e5159e9084304ca650487b6e99c828d3cf (patch)
tree7bd79ad7baab04a12710a47e4ef8c8b13fb926f2
parent4e4061f485fb25890c286fcea0158b439ae4045d (diff)
downloadastro-77c018e5159e9084304ca650487b6e99c828d3cf.tar.gz
astro-77c018e5159e9084304ca650487b6e99c828d3cf.tar.zst
astro-77c018e5159e9084304ca650487b6e99c828d3cf.zip
Fix relaxed and default TypeScript settings not working (#4183)
* Fix relaxed and default TypeScript settings not working * Create itchy-hats-exist.md
-rw-r--r--.changeset/itchy-hats-exist.md5
-rw-r--r--packages/create-astro/src/index.ts18
2 files changed, 15 insertions, 8 deletions
diff --git a/.changeset/itchy-hats-exist.md b/.changeset/itchy-hats-exist.md
new file mode 100644
index 000000000..ccd341f7f
--- /dev/null
+++ b/.changeset/itchy-hats-exist.md
@@ -0,0 +1,5 @@
+---
+"create-astro": patch
+---
+
+Fix relaxed and default TypeScript settings not working
diff --git a/packages/create-astro/src/index.ts b/packages/create-astro/src/index.ts
index 4f026e997..c3d86912f 100644
--- a/packages/create-astro/src/index.ts
+++ b/packages/create-astro/src/index.ts
@@ -343,14 +343,16 @@ export async function main() {
if (args.dryRun) {
ora().info(dim(`--dry-run enabled, skipping.`));
} else if (tsResponse.typescript) {
- fs.copyFileSync(
- path.join(
- url.fileURLToPath(new URL('..', import.meta.url)),
- 'tsconfigs',
- `tsconfig.${tsResponse.typescript}.json`
- ),
- path.join(cwd, 'tsconfig.json')
- );
+ if (tsResponse.typescript !== 'default') {
+ fs.copyFileSync(
+ path.join(
+ url.fileURLToPath(new URL('..', import.meta.url)),
+ 'tsconfigs',
+ `tsconfig.${tsResponse.typescript}.json`
+ ),
+ path.join(cwd, 'tsconfig.json')
+ );
+ }
ora().succeed('TypeScript settings applied!');
}