Install @total-typescript/tsconfig
mainInstall the package as a development dependency to use its pre-configured TypeScript configurations in your project.
npm install --save-dev @total-typescript/tsconfigrepository·main·Indexed 22 days ago
https://github.com/total-typescript/tsconfigA collection of curated TypeScript configurations based on Total TypeScript's TSConfig Cheat Sheet. It provides pre-configured base settings for various project types, including apps and libraries, with specific paths for bundler or tsc transpilation and DOM or non-DOM environments.
Install the package as a development dependency to use its pre-configured TypeScript configurations in your project.
npm install --save-dev @total-typescript/tsconfigTo use a configuration, identify your project type and add the corresponding extends property to your tsconfig.json.
Are you using tsc to transpile .ts to .js?
/tsc/ path prefix./bundler/ path prefix.Does your code run in the DOM?
/dom/ segment./no-dom/ segment.What is the project structure?
/app./library./library-monorepo.// Example: Building an app that runs in the DOM with an external bundler
{
"extends": "@total-typescript/tsconfig/bundler/dom/app"
}The base configurations do not cover certain specific options. You can override or add these in your local tsconfig.json under compilerOptions.
jsx: Set this if your app uses JSX (e.g., "jsx": "react-jsx").outDir: Set this if you are using tsc and want to specify the output directory for compiled files.// Configuring JSX
{
"extends": "@total-typescript/tsconfig/bundler/dom/app",
"compilerOptions": {
"jsx": "react-jsx"
}
}
// Configuring outDir for tsc
{
"extends": "@total-typescript/tsconfig/tsc/no-dom/library",
"compilerOptions": {
"outDir": "dist"
}
}Select the appropriate configuration path based on your environment and project type.
// If using 'tsc' to transpile:
// DOM
"extends": "@total-typescript/tsconfig/tsc/dom/app",
"extends": "@total-typescript/tsconfig/tsc/dom/library",
"extends": "@total-typescript/tsconfig/tsc/dom/library-monorepo",
// No DOM (e.g. Node.js)
"extends": "@total-typescript/tsconfig/tsc/no-dom/app",
"extends": "@total-typescript/tsconfig/tsc/no-dom/library",
"extends": "@total-typescript/tsconfig/tsc/no-dom/library-monorepo"
// If using an external bundler (Vite, Remix, etc):
// DOM
"extends": "@total-typescript/tsconfig/bundler/dom/app",
"extends": "@total-typescript/tsconfig/bundler/dom/library",
"extends": "@total-typescript/tsconfig/bundler/dom/library-monorepo",
// No DOM (e.g. Node.js)
"extends": "@total-typescript/tsconfig/bundler/no-dom/app",
"extends": "@total-typescript/tsconfig/bundler/no-dom/library",
"extends": "@total-typescript/tsconfig/bundler/no-dom/library-monorepo"