diff --git a/.changeset/slimy-avocados-sniff.md b/.changeset/slimy-avocados-sniff.md new file mode 100644 index 000000000000..3cf85cd928be --- /dev/null +++ b/.changeset/slimy-avocados-sniff.md @@ -0,0 +1,5 @@ +--- +"astro": patch +--- + +Updates the base `tsconfig.json` preset with `jsx: 'preserve'` in order to fix errors when importing Astro files inside `.js` and `.ts` files. diff --git a/packages/astro/tsconfigs/base.json b/packages/astro/tsconfigs/base.json index 371b2a15deb2..f1394474d441 100644 --- a/packages/astro/tsconfigs/base.json +++ b/packages/astro/tsconfigs/base.json @@ -24,6 +24,8 @@ // Skip typechecking libraries and .d.ts files "skipLibCheck": true, // Allow JavaScript files to be imported - "allowJs": true + "allowJs": true, + // Allow JSX files (or files that are internally considered JSX, like Astro files) to be imported inside `.js` and `.ts` files. + "jsx": "preserve" } }