new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Nuxt · Getting started · all subjects

typescript

7 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Nuxt has zero-config TypeScript support

Nuxt provides zero-config TypeScript support with auto-generated types and tsconfig.json, allowing developers to write type-safe code without needing to learn TypeScript.

Add test directories to TypeScript context in nuxt.config.ts

If tests run in Nuxt Vitest environment but are in directories other than test/nuxt/ or tests/nuxt/, add them to the TypeScript context by configuring typescript.tsConfig.include in nuxt.config.ts with paths relative to the generated .nuxt/tsconfig.json.

TypeScript support in Nuxt 3

Nuxt 3 ships with TypeScript support built-in.

TypeScript support and setup

Nuxt provides automatic type hints for editors through its TypeScript integration. You don't need to write your entire application in TypeScript to benefit from this. Create a tsconfig.json with references to .nuxt/tsconfig.app.json, .nuxt/tsconfig.server.json, .nuxt/tsconfig.shared.json, and .nuxt/tsconfig.node.json. Run npx nuxt prepare to generate the tsconfig files. Install Volar following the docs instructions for full TypeScript support.

Type-check Nuxt app with vue-tsc

Nuxt can type-check your app using vue-tsc with the nuxt typecheck command.

Stricter side-effect imports in Nuxt 5

Nuxt 5's generated `tsconfig.json` enables `noUncheckedSideEffectImports`, which is TypeScript 7 default. Side-effect-only imports that TypeScript cannot resolve become type errors. For non-code assets like `import '~/assets/styles.css'`, add ambient module declaration `declare module '*.css' {}`. Disable with `typescript.tsConfig.compilerOptions.noUncheckedSideEffectImports: false` in nuxt.config.

TypeScript baseUrl removed in Nuxt 5

With `compatibilityVersion: 5`, Nuxt removes `compilerOptions.baseUrl` from generated TypeScript configurations. Relative Nuxt and Nitro aliases are resolved from Nuxt's build directory. Make relative aliases absolute using `fileURLToPath(new URL('./path', import.meta.url))`. Remove `typescript.tsConfig.compilerOptions.baseUrl` from nuxt.config.

Give your agent this brain