Context / Problem
By default, Nuxt 4 strips TypeScript types during the build process but does not explicitly type-check during nuxt dev for performance reasons. This means developers might write code that has TypeScript errors but still runs in development, only to fail later in the build or cause subtle bugs.
Proposed Solution
Enable local type-checking so errors appear directly in the terminal during development.
Implementation Details
- Install
vue-tsc and typescript as development dependencies (if not already strictly required).
- Update
nuxt.config.ts to enable type checking:
export default defineNuxtConfig({
typescript: {
typeCheck: true
}
})
Acceptance Criteria
Context / Problem
By default, Nuxt 4 strips TypeScript types during the build process but does not explicitly type-check during
nuxt devfor performance reasons. This means developers might write code that has TypeScript errors but still runs in development, only to fail later in the build or cause subtle bugs.Proposed Solution
Enable local type-checking so errors appear directly in the terminal during development.
Implementation Details
vue-tscandtypescriptas development dependencies (if not already strictly required).nuxt.config.tsto enable type checking:Acceptance Criteria
pnpm dev.