@agentable/tsconfig
v0.4.2
Published
Shared TypeScript 7 configuration presets for Fleet-family TypeScript packages.
Maintainers
Readme
@agentable/tsconfig
Shared TypeScript 7 presets for Fleet-family libraries, applications, and tooling.
Installation
pnpm add -D @agentable/tsconfig typescriptInstall the @types/node major matching the runtime (Node.js 24 through 26 are supported) when using
the node or tooling preset.
Choose a preset
| Preset | Use case | Runtime libraries | Resolution |
| ------------- | ------------------------------------- | --------------------------- | ---------- |
| base | Strict compiler policy only | ES2025 | Default |
| library | Platform-neutral published library | ES2025 | Bundler |
| web-library | Published library using browser APIs | ES2025 + DOM + DOM.Iterable | Bundler |
| react | Published React Web library or bridge | ES2025 + DOM + DOM.Iterable | Bundler |
| app | Browser application | ES2025 + DOM + DOM.Iterable | Bundler |
| node | Published Node.js library or CLI API | ES2025 + Node | NodeNext |
| tooling | Node.js config, script, or generator | ES2025 + Node | NodeNext |
Configure a library
Use library when the public API does not depend on browser or Node.js globals.
{
"extends": "@agentable/tsconfig/library",
"compilerOptions": {
"rootDir": "./src",
},
"include": ["src"],
"exclude": ["src/**/*.test.ts", "dist", "coverage", "node_modules"],
}Choose web-library or react only when the package directly uses that environment. All library
presets enable declaration-safe checking for tsdown. Renderer-neutral React packages extend
library and select react-jsx locally; React applications extend app and do the same.
Configure tests
Keep test globals and runtime libraries out of the production project.
{
"extends": "@agentable/tsconfig/library",
"compilerOptions": {
"declaration": false,
"isolatedDeclarations": false,
"lib": ["ES2025", "DOM"],
"rootDir": "./src",
"types": ["node"],
},
"include": ["src/**/*.test.ts", "src/**/*.test-d.ts"],
"exclude": ["dist", "coverage", "node_modules"],
}Configure repository tooling
Use tooling for config files and scripts that Node.js executes directly.
{
"extends": "@agentable/tsconfig/tooling",
"compilerOptions": {
"lib": ["ES2025", "ESNext.Disposable", "DOM"],
"rootDir": ".",
"types": ["node"],
},
"include": ["*.config.ts", "scripts/**/*.ts"],
}Set rootDir, include, and environment-specific ambient types in every leaf project. Bundled and
published source uses runtime-correct .js specifiers. Node.js directly executes tooling source, so
the tooling preset allows relative .ts specifiers instead.
License
This project is licensed under the MIT License - see the LICENSE file for details.
