{"id":13792882,"url":"https://github.com/total-typescript/tsconfig","last_synced_at":"2025-04-08T19:31:17.593Z","repository":{"id":239593665,"uuid":"799975252","full_name":"total-typescript/tsconfig","owner":"total-typescript","description":"The simplest way to set up your tsconfig.json","archived":false,"fork":false,"pushed_at":"2024-05-14T12:01:04.000Z","size":35,"stargazers_count":632,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-05-23T02:38:59.814Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.totaltypescript.com/tsconfig-cheat-sheet","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/total-typescript.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-13T13:16:05.000Z","updated_at":"2024-08-03T22:07:14.737Z","dependencies_parsed_at":"2024-08-03T22:07:13.884Z","dependency_job_id":"4f09c627-cee9-400e-aece-9aaf827b3537","html_url":"https://github.com/total-typescript/tsconfig","commit_stats":null,"previous_names":["mattpocock/tsconfig"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/total-typescript%2Ftsconfig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/total-typescript%2Ftsconfig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/total-typescript%2Ftsconfig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/total-typescript%2Ftsconfig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/total-typescript","download_url":"https://codeload.github.com/total-typescript/tsconfig/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247912618,"owners_count":21017032,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T22:01:17.320Z","updated_at":"2025-04-08T19:31:17.567Z","avatar_url":"https://github.com/total-typescript.png","language":null,"funding_links":[],"categories":["Uncategorized","Others","miscellaneous"],"sub_categories":["Uncategorized"],"readme":"# `@total-typescript/tsconfig`\n\n`tsconfig.json` can seem extremely scary. But really, it's only 2 or 3 decisions you need to make.\n\nThis package makes those decisions even easier. Based on my [TSConfig Cheat Sheet](https://www.totaltypescript.com/tsconfig-cheat-sheet).\n\n## Setup\n\n1. Install:\n\n```bash\nnpm install --save-dev @total-typescript/tsconfig\n```\n\n2. Choose which `tsconfig.json` you need from the [list](#list-of-tsconfigs) below.\n\n3. Add it to your `tsconfig.json`:\n\n```jsonc\n{\n  // I'm building an app that runs in the DOM with an external bundler\n  \"extends\": \"@total-typescript/tsconfig/bundler/dom/app\"\n}\n```\n\n## List of TSConfigs\n\nThe tricky thing about `tsconfig.json` is there is _not_ a single config file that can work for everyone. But, with two or three questions, we can get there:\n\n### Are You Using `tsc` To Turn Your `.ts` Files Into `.js` Files?\n\n#### Yes\n\nIf yes, use this selection of configs:\n\n```jsonc\n{\n  // My code runs in the DOM:\n  \"extends\": \"@total-typescript/tsconfig/tsc/dom/app\", // For an app\n  \"extends\": \"@total-typescript/tsconfig/tsc/dom/library\", // For a library\n  \"extends\": \"@total-typescript/tsconfig/tsc/dom/library-monorepo\", // For a library in a monorepo\n\n  // My code _doesn't_ run in the DOM (for instance, in Node.js):\n  \"extends\": \"@total-typescript/tsconfig/tsc/no-dom/app\", // For an app\n  \"extends\": \"@total-typescript/tsconfig/tsc/no-dom/library\", // For a library\n  \"extends\": \"@total-typescript/tsconfig/tsc/no-dom/library-monorepo\" // For a library in a monorepo\n}\n```\n\n#### No\n\nIf no, you're probably using an external bundler. Most frontend frameworks, like Vite, Remix, Astro, Nuxt, and others, will fall into this category. If so, use this selection of configs:\n\n```jsonc\n{\n  // My code runs in the DOM:\n  \"extends\": \"@total-typescript/tsconfig/bundler/dom/app\", // For an app\n  \"extends\": \"@total-typescript/tsconfig/bundler/dom/library\", // For a library\n  \"extends\": \"@total-typescript/tsconfig/bundler/dom/library-monorepo\", // For a library in a monorepo\n\n  // My code _doesn't_ run in the DOM (for instance, in Node.js):\n  \"extends\": \"@total-typescript/tsconfig/bundler/no-dom/app\", // For an app\n  \"extends\": \"@total-typescript/tsconfig/bundler/no-dom/library\", // For a library\n  \"extends\": \"@total-typescript/tsconfig/bundler/no-dom/library-monorepo\" // For a library in a monorepo\n}\n```\n\n## Options Not Covered:\n\n### `jsx`\n\nIf your app has JSX, you can set the `jsx` option in your `tsconfig.json`:\n\n```json\n{\n  \"extends\": \"@total-typescript/tsconfig/bundler/dom/app\",\n  \"compilerOptions\": {\n    \"jsx\": \"react-jsx\"\n  }\n}\n```\n\n### `outDir`\n\nMostly relevant for when you're transpiling with `tsc`. If you want to change the output directory of your compiled files, you can set the `outDir` option in your `tsconfig.json`:\n\n```json\n{\n  \"extends\": \"@total-typescript/tsconfig/tsc/no-dom/library\",\n  \"compilerOptions\": {\n    \"outDir\": \"dist\"\n  }\n}\n```\n\n### Framework-Specific Options\n\nI don't yet cover framework-specific options, like `vite`, `next`, `remix`, etc. With enough persuasion, I might add them in the future.\n\n## Why Not Use `@tsconfig/bases`?\n\nThe [`@tsconfig/bases`](https://github.com/tsconfig/bases) package is a great resource for TypeScript configurations. However, I disagree with the idea that there is a single \"recommended\" configuration that works for everyone.\n\nAlso, I wanted a set of `tsconfig.json` files that I controlled so I could use them to keep my [Total TypeScript Course Repos](https://github.com/total-typescript) up to date.\n\nIf you're looking for a great TypeScript course, check out [Total TypeScript](https://www.totaltypescript.com/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftotal-typescript%2Ftsconfig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftotal-typescript%2Ftsconfig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftotal-typescript%2Ftsconfig/lists"}