Skip to content

Commit

Permalink
feat(tsconfigs): Enable allowJs in base preset (#7274)
Browse files Browse the repository at this point in the history
  • Loading branch information
Princesseuh authored Jun 5, 2023
1 parent 4c33576 commit b521365
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/slimy-hotels-agree.md
Original file line number Diff line number Diff line change
@@ -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.
4 changes: 3 additions & 1 deletion packages/astro/tsconfigs/base.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
4 changes: 3 additions & 1 deletion packages/astro/tsconfigs/strictest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

0 comments on commit b521365

Please sign in to comment.