@aklesky/typescript-presets
v0.1.3
Published
Shareable TypeScript configuration presets for Node.js 24 and 26.
Readme
@aklesky/typescript-presets
Shareable TypeScript configuration presets for Node.js 24 and 26.
Compiler options are defined once, so each tsconfig.json is a one-line extends. Part of the @aklesky/node-presets collection.
Features
- One preset per Node.js LTS line.
node/24.xandnode/26.xsettargetandlibto what that Node.js version runs, so nothing is downleveled for a runtime the project does not target. - Strict and explicit.
strict,isolatedModulesandverbatimModuleSyntaxare always on. Type-only imports useimport type, so every file compiles on its own withtsc, a bundler or another single-file compiler. - Ready for TypeScript 7. The presets only use options that TypeScript 6 and 7 both support.
Installation
pnpm add -D @aklesky/typescript-presets typescript @types/nodeUsage
Node.js code:
{
"extends": "@aklesky/typescript-presets/node/24.x/node.json"
}A library with declaration files:
{
"extends": "@aklesky/typescript-presets/node/24.x/build.json",
"compilerOptions": {
"outDir": "./dist",
"rootDir": "./src"
}
}Code built by a bundler such as Vite:
{
"extends": "@aklesky/typescript-presets/node/24.x/bundler.json"
}Replace 24.x with 26.x for Node.js 26.
Presets
| Preset | Use for |
| -------------- | ------------------------------------------------------------------- |
| node.json | Type checking Node.js code (module / moduleResolution NodeNext) |
| build.json | Emitting a library with declaration files |
| bundler.json | Code built by a bundler such as Vite (Preserve / Bundler, DOM) |
All presets share shared/base.json: strict, isolatedModules, verbatimModuleSyntax, moduleDetection: force, resolveJsonModule, noUnusedLocals, noUnusedParameters and noFallthroughCasesInSwitch. The node presets set "types": ["node"], so install @types/node for your Node.js version.
TypeScript 7
The presets work with TypeScript 6 and 7. Tools that use the TypeScript API, such as typescript-eslint, still need TypeScript 6, so install both and let tsc run TypeScript 7:
{
"devDependencies": {
"@typescript/native": "npm:[email protected]",
"typescript": "npm:@typescript/[email protected]"
}
}The TypeScript configuration reference explains every option.
Compatibility
| Name | Version | | ---------- | ------------- | | TypeScript | 6.0.2 / 7.0.2 | | Node.js | 24.22.1 |
The node/26.x presets type-check with both TypeScript versions.
License
MIT © Aleksei Semiglasov
