Shared TypeScript configurations for Node.js, libraries, React, and Next.js. Version 2 targets the native TypeScript 7 compiler while retaining a tested TypeScript 6 migration path.
Use these independently in any project; no vllnt monorepo or runtime dependency is required. Extend a preset, then supply project-specific paths and ambient types.
For TypeScript 7 projects:
pnpm add --save-dev @vllnt/typescript@^2 typescript@^7For tools that still require the TypeScript JavaScript API, install TypeScript 7 as the build compiler and TypeScript 6 under the canonical package name:
{
"devDependencies": {
"@typescript/native": "npm:typescript@^7.0.2",
"@vllnt/typescript": "^2.0.0",
"typescript": "npm:@typescript/typescript6@^6.0.2"
}
}This is the official side-by-side migration arrangement: tsc runs TypeScript 7, tsc6 runs TypeScript 6, and tools such as typescript-eslint can continue importing the TypeScript 6 API.
| Preset | Use case | Module resolution | Target | Emit |
|---|---|---|---|---|
base.json |
Foundation extended by other presets | Inherited | Inherited | Inherited |
nodejs.json |
Node.js applications | NodeNext | ES2024 | JavaScript, declarations, source maps |
node-library.json |
Publishable npm packages | NodeNext | ES2024 | JavaScript, declarations and maps |
react.json |
Bundled React applications | Bundler | ES2022 | JavaScript, declarations, source maps |
nextjs.json |
Next.js applications | Bundler | ES2022 | None |
Emitting presets do not enable incremental. Unless you opt in, a clean build emits every output even when a .tsbuildinfo file is left over. If you set incremental: true, delete the .tsbuildinfo file together with the output directory before a clean build. nextjs.json keeps incremental because it does not emit; if you override noEmit, also set incremental: false.
{
"extends": "@vllnt/typescript/nodejs.json",
"compilerOptions": {
"outDir": "dist",
"rootDir": "src",
"types": ["node"]
},
"include": ["src"]
}{
"extends": "@vllnt/typescript/node-library.json",
"compilerOptions": {
"outDir": "dist",
"rootDir": "src",
"types": ["node"]
},
"include": ["src"]
}{
"extends": "@vllnt/typescript/react.json",
"compilerOptions": {
"outDir": "dist",
"rootDir": "src",
"types": ["react"]
},
"include": ["src"]
}{
"extends": "@vllnt/typescript/nextjs.json",
"compilerOptions": {
"types": ["node", "react"]
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}Every specialized preset inherits:
strict: trueisolatedModules: truenoUncheckedIndexedAccess: truenoUncheckedSideEffectImports: trueforceConsistentCasingInFileNames: trueskipLibCheck: trueesModuleInterop: trueresolveJsonModule: truestableTypeOrdering: truelibReplacement: falsetypes: []
Ambient type packages are intentionally opt-in. List every required package in the consuming project's types array. Emitting projects must also set rootDir explicitly.
stableTypeOrdering aligns TypeScript 6 output with TypeScript 7. It can make TypeScript 6 type-checking slower; TypeScript 7 always uses stable ordering.
Version 2 supports TypeScript >=6.0.2 <8 and drops TypeScript 5. Before upgrading:
- Remove
baseUrland makepathstargets relative to the project root. - Replace legacy
moduleResolution: "node"with"NodeNext"for Node.js or"Bundler"for bundled applications. - Set
rootDirin projects that emit files. - List required ambient packages in
types, such asnodeorvitest/globals. - Use Next.js 16.3 or newer when building with TypeScript 7.
- Keep TypeScript 6 available through the side-by-side setup while ESLint or other tools require the legacy JavaScript API.
TypeScript 7 also removes ES5 targeting, legacy module formats and resolution, downlevelIteration, and the ability to disable esModuleInterop, allowSyntheticDefaultImports, or strict mode.
| Surface | Supported version |
|---|---|
| Node.js consumers | >=22 |
| TypeScript | >=6.0.2 <8 |
| Tested compilers | TypeScript 6 compatibility package and TypeScript 7.0.2 |
| Next.js integration | 16.4.3 |
| React integration | 19.3.1 |
| Repository development | Node.js 22.13+, pnpm 11.28.8 |
pnpm install --frozen-lockfile
pnpm check
pnpm pack --dry-runThe checks compile every preset with TypeScript 6 and 7, verify declaration emit, install and compile the packed package, enforce full test-helper coverage, and build real React/Vite and Next.js fixtures.
- Major: raised TypeScript floor, stricter diagnostics, target/module/emit changes, or removed/renamed presets.
- Minor: additive presets or backward-compatible options.
- Patch: fixes, documentation, tests, or CI changes without consumer-visible behavior changes.
- Build-cache exception: a patch may remove a build-cache default, such as
incremental, that makes builds emit wrong or missing output. JavaScript, declaration, and source-map output of a clean build and all diagnostics must stay the same. The changelog states the cache effect and how to opt back in. 2.0.1 uses this exception.
npm latest is stable 2.0.0 at this audit. @canary selects moving prereleases;
pin and test them before adoption. The compatibility matrix above describes
this version's tested integrations, not a requirement to use every framework.
Built by bntvllnt · bntvllnt.com. Part of @vllnt. Sponsor the work.