From 43ead8fbd5112823118060175c7a4a22522cc325 Mon Sep 17 00:00:00 2001 From: Ben Holmes Date: Wed, 24 Apr 2024 11:33:49 -0400 Subject: [PATCH] Enable `allowJs` for `strictest.json` (#10762) * feat: enable `allowJs` for `strictest.json` * chore: changeset * edit: enables Co-authored-by: Sarah Rainsberger --------- Co-authored-by: Sarah Rainsberger --- .changeset/thirty-poems-chew.md | 7 +++++++ packages/astro/tsconfigs/strictest.json | 4 +--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 .changeset/thirty-poems-chew.md diff --git a/.changeset/thirty-poems-chew.md b/.changeset/thirty-poems-chew.md new file mode 100644 index 000000000000..1072fc92d3a8 --- /dev/null +++ b/.changeset/thirty-poems-chew.md @@ -0,0 +1,7 @@ +--- +"astro": minor +--- + +Enables type checking for JavaScript files when using the `strictest` TS config. This ensures consistency with Astro's other TS configs, and fixes type checking for integrations like Astro DB when using an `astro.config.mjs`. + +If you are currently using the `strictest` preset and would like to still disable `.js` files, set `allowJS: false` in your `tsconfig.json`. diff --git a/packages/astro/tsconfigs/strictest.json b/packages/astro/tsconfigs/strictest.json index 36f11635e8d2..f59dc4f6cd01 100644 --- a/packages/astro/tsconfigs/strictest.json +++ b/packages/astro/tsconfigs/strictest.json @@ -19,8 +19,6 @@ // Report an error for unreachable code instead of just a warning. "allowUnreachableCode": false, // Report an error for unused labels instead of just a warning. - "allowUnusedLabels": false, - // Disallow JavaScript files from being imported - "allowJs": false + "allowUnusedLabels": false } }