diff options
author | 2023-06-05 17:31:21 +0200 | |
---|---|---|
committer | 2023-06-05 17:31:21 +0200 | |
commit | b5213654b1b7f3ba573a48d3be688b2bdde7870f (patch) | |
tree | cbebfed1717a1c2360bd8ff92015e7831ca27779 | |
parent | 4c33576a6c52fd57c32cb4b4cbc2965a29f2eaf3 (diff) | |
download | astro-b5213654b1b7f3ba573a48d3be688b2bdde7870f.tar.gz astro-b5213654b1b7f3ba573a48d3be688b2bdde7870f.tar.zst astro-b5213654b1b7f3ba573a48d3be688b2bdde7870f.zip |
feat(tsconfigs): Enable allowJs in base preset (#7274)
-rw-r--r-- | .changeset/slimy-hotels-agree.md | 5 | ||||
-rw-r--r-- | packages/astro/tsconfigs/base.json | 4 | ||||
-rw-r--r-- | packages/astro/tsconfigs/strictest.json | 4 |
3 files changed, 11 insertions, 2 deletions
diff --git a/.changeset/slimy-hotels-agree.md b/.changeset/slimy-hotels-agree.md new file mode 100644 index 000000000..b8af2cd82 --- /dev/null +++ b/.changeset/slimy-hotels-agree.md @@ -0,0 +1,5 @@ +--- +'astro': minor +--- + +Update base `tsconfig.json` template with `allowJs: true` to provide a better relaxed experience for users unfamilliar with TypeScript. `allowJs` is still set to `false` (its default value) when using the `strictest` preset. diff --git a/packages/astro/tsconfigs/base.json b/packages/astro/tsconfigs/base.json index 41ee2e9d4..aa1f17543 100644 --- a/packages/astro/tsconfigs/base.json +++ b/packages/astro/tsconfigs/base.json @@ -25,6 +25,8 @@ }, // TypeScript 5.0 changed how `isolatedModules` and `importsNotUsedAsValues` works, deprecating the later // Until the majority of users are on TypeScript 5.0, we'll have to supress those deprecation errors - "ignoreDeprecations": "5.0" + "ignoreDeprecations": "5.0", + // Allow JavaScript files to be imported + "allowJs": true } } diff --git a/packages/astro/tsconfigs/strictest.json b/packages/astro/tsconfigs/strictest.json index f59dc4f6c..36f11635e 100644 --- a/packages/astro/tsconfigs/strictest.json +++ b/packages/astro/tsconfigs/strictest.json @@ -19,6 +19,8 @@ // 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 + "allowUnusedLabels": false, + // Disallow JavaScript files from being imported + "allowJs": false } } |