Framework - Astro
This preset is the framework layer for Astro projects in your TypeScript config.
It sets the modern, browser-oriented compiler options an Astro project expects — native .ts and .tsx import extensions, isolatedModules, the DOM libraries, ESNext modules, Bundler module resolution, and preserved JSX. Use it after Nova's required essentials, strict, app-role, and browser-runtime layers:
tsconfig.astro.json
{
"extends": [
"@cbnventures/nova/presets/tsconfig/dx-essentials.json",
"@cbnventures/nova/presets/tsconfig/dx-strict.json",
"@cbnventures/nova/presets/tsconfig/role-app.json",
"@cbnventures/nova/presets/tsconfig/runtime-browser.json",
"@cbnventures/nova/presets/tsconfig/fw-astro.json"
],
"include": [
".astro/types.d.ts",
"./src/**/*"
]
}
Compiler Options
| Option | Value | Purpose |
|---|---|---|
allowImportingTsExtensions | true | Accepts native .ts and .tsx import paths used by Astro source files. |
isolatedModules | true | Keeps every file safe for independent transpilation. |
jsx | "preserve" | Leaves JSX for Astro's Vite pipeline to transform. |
lib | ["DOM", "DOM.Iterable", "ESNext"] | Provides browser APIs, iterable DOM collections, and modern JavaScript. |
module | "ESNext" | Preserves modern ECMAScript modules for the bundler. |
moduleResolution | "Bundler" | Resolves packages with bundler-aware import rules. |
Related
- Review the Astro scaffold.
- Review the layering order in TSConfig Best Practices.