@stackonward/tsconfig
v0.0.2
Published
Shared TypeScript configurations
Readme
@stackonward/tsconfig
Strict TypeScript configuration presets for shared ESM, Node.js, Vue, and React projects.
Install
pnpm add --save-dev @stackonward/tsconfig typescriptPresets
| Preset | Purpose |
| ----------------------------- | --------------------------------------------------------------------- |
| @stackonward/tsconfig/base | Strict ES2022 and NodeNext defaults with declarations and source maps |
| @stackonward/tsconfig/node | NodeNext source-to-dist compilation |
| @stackonward/tsconfig/vue | Bundler resolution, DOM libraries, Vue JSX, and no emit |
| @stackonward/tsconfig/react | Bundler resolution, DOM libraries, React JSX, and no emit |
Node.js usage
Create a project-root tsconfig.json and keep project-relative paths in the
consumer config:
{
"extends": "@stackonward/tsconfig/node",
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist"
},
"include": ["src/**/*.ts"]
}Vue usage
{
"extends": "@stackonward/tsconfig/vue",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["src/*"],
"~/*": ["src/*"]
}
},
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"]
}React usage
{
"extends": "@stackonward/tsconfig/react",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
}
},
"include": ["src/**/*.ts", "src/**/*.tsx"]
}TypeScript resolves relative paths from the config file that declared them.
Keep rootDir, outDir, include, and application aliases explicit in the
consumer's project-root config when they describe consumer-owned directories.
Shared guarantees
All presets enable strict checking, consistent file-name casing,
noUncheckedIndexedAccess, noImplicitOverride, JSON modules, declaration
maps, and source maps. Framework presets use noEmit; the framework build owns
artifact generation.
Compatibility
- TypeScript projects that support the ES2022, NodeNext, and Bundler compiler options used by the selected preset
- Vue and React types are supplied by the consuming framework project
- JSON configuration exports; no runtime dependency
License
MIT
