@tofrankie/tsconfig
v0.0.5
Published
A shared tsconfig configuration
Downloads
528
Maintainers
Readme
@tofrankie/tsconfig
A shared TypeScript tsconfig.json presets.
[!IMPORTANT] Before 1.0.0, releases may include breaking changes. Read the CHANGELOG before upgrading.
Quick Start
$ pnpm add typescript @tofrankie/tsconfig -DCreate a tsconfig.json in your project root:
{
"extends": "@tofrankie/tsconfig/react.vite.json",
// add compilerOptions, include, etc. as needed
}Presets
Use @tofrankie/tsconfig/<filename> in extends. When Extra dependencies is not -, add those packages to your project's devDependencies.
| Preset | Purpose (how to choose) | Extra dependencies |
| ---------------------- | -------------------------------------------------------- | ----------------------- |
| strictest.json | Strictest rules | - |
| strict.json | Strict rules | - |
| dom.json | Web App / DOM API | - |
| node.json | Node scripts / services / CLI (@tsconfig/node20) | - |
| lib.json | npm packages to publish (independent of runtime) | - |
| node.lib.json | Node packages to publish | - |
| node.lib.tsdown.json | Node libraries for tsdown (bundler resolution, noEmit) | - |
| react.json | React App (bundler-agnostic) | - |
| react.vite.json | React + Vite | vite |
| react.lib.json | React component libraries to publish | - |
| react.lib.vite.json | React component libraries developed with Vite | vite |
| vue.json | Vue 3 App (bundler-agnostic) | - |
| vue.vite.json | Vue 3 + Vite | vite |
| vue.lib.json | Vue 3 component libraries to publish | - |
| vue.lib.vite.json | Vue 3 component libraries developed with Vite | vite |
| vitest.json | Testing with Vitest | @types/node, vitest |
Dependency relationships between them: DEPENDENCY_GRAPH.
Examples
React + Vite
tsconfig.json
{
"references": [{ "path": "./tsconfig.app.json" }, { "path": "./tsconfig.node.json" }],
"files": []
}tsconfig.app.json
{
"extends": "@tofrankie/tsconfig/react.vite.json",
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo"
},
"include": ["src"]
}tsconfig.node.json
{
"extends": "@tofrankie/tsconfig/node.json",
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo"
},
"include": ["vite.config.ts"]
}Acknowledgements
Thanks to these referenced packages:
@tsconfig/node20@tsconfig/strictest@tsconfig/vite-react@vue/tsconfig
License
MIT
