TypeScript Support
Nitro supports TypeScript by default. If you are using the starter template, you have nothing to do ✨.
To add type hints within your project, create a tsconfig.json
file:
tsconfig.json
{
"extends": "./.nitro/types/tsconfig.json"
}
Run npx nitropack prepare
to generate the types for global auto-imports. This can be useful in a CI environment or as a postinstall
command in your package.json
.
If you are using Nuxt, your tsconfig.json
can stay:
tsconfig.json
{
"extends": "./.nuxt/tsconfig.json"
}