Centralized Recommendations for TSConfig bases
Hosts TSConfigs for you to extend in your apps, tuned to a particular runtime environment. Owned and improved by the community. Basically Definitely Typed for TSConfigs.
We target the latest versions stable version of TypeScript, note that because we want to be consistent with the versioning the target runtime we can't always do semver releases.
Available TSConfigs
tsconfig.json
RecommendedInstall:
npm install --save-dev @tsconfig/recommended
yarn add --dev @tsconfig/recommended
Add to your tsconfig.json
:
"extends": "@tsconfig/recommended/tsconfig.json"
tsconfig.json
Create React AppInstall:
npm install --save-dev @tsconfig/create-react-app
yarn add --dev @tsconfig/create-react-app
Add to your tsconfig.json
:
"extends": "@tsconfig/create-react-app/tsconfig.json"
tsconfig.json
CypressInstall:
npm install --save-dev @tsconfig/cypress
yarn add --dev @tsconfig/cypress
Add to your tsconfig.json
:
"extends": "@tsconfig/cypress/tsconfig.json"
tsconfig.json
DenoInstall:
npm install --save-dev @tsconfig/deno
yarn add --dev @tsconfig/deno
Add to your tsconfig.json
:
"extends": "@tsconfig/deno/tsconfig.json"
tsconfig.json
Docusaurus v2Install:
npm install --save-dev @tsconfig/docusaurus
yarn add --dev @tsconfig/docusaurus
Add to your tsconfig.json
:
"extends": "@tsconfig/docusaurus/tsconfig.json"
tsconfig.json
EmberInstall:
npm install --save-dev @tsconfig/ember
yarn add --dev @tsconfig/ember
Add to your tsconfig.json
:
"extends": "@tsconfig/ember/tsconfig.json"
tsconfig.json
Next.jsInstall:
npm install --save-dev @tsconfig/next
yarn add --dev @tsconfig/next
Add to your tsconfig.json
:
"extends": "@tsconfig/next/tsconfig.json"
tsconfig.json
Node LTSInstall:
npm install --save-dev @tsconfig/node-lts
yarn add --dev @tsconfig/node-lts
Add to your tsconfig.json
:
"extends": "@tsconfig/node-lts/tsconfig.json"
tsconfig.json
Node 10Install:
npm install --save-dev @tsconfig/node10
yarn add --dev @tsconfig/node10
Add to your tsconfig.json
:
"extends": "@tsconfig/node10/tsconfig.json"
tsconfig.json
Node 12Install:
npm install --save-dev @tsconfig/node12
yarn add --dev @tsconfig/node12
Add to your tsconfig.json
:
"extends": "@tsconfig/node12/tsconfig.json"
tsconfig.json
Node 14Install:
npm install --save-dev @tsconfig/node14
yarn add --dev @tsconfig/node14
Add to your tsconfig.json
:
"extends": "@tsconfig/node14/tsconfig.json"
tsconfig.json
Node 16Install:
npm install --save-dev @tsconfig/node16
yarn add --dev @tsconfig/node16
Add to your tsconfig.json
:
"extends": "@tsconfig/node16/tsconfig.json"
tsconfig.json
Node 17Install:
npm install --save-dev @tsconfig/node17
yarn add --dev @tsconfig/node17
Add to your tsconfig.json
:
"extends": "@tsconfig/node17/tsconfig.json"
tsconfig.json
Node 18Install:
npm install --save-dev @tsconfig/node18
yarn add --dev @tsconfig/node18
Add to your tsconfig.json
:
"extends": "@tsconfig/node18/tsconfig.json"
tsconfig.json
Node 19Install:
npm install --save-dev @tsconfig/node19
yarn add --dev @tsconfig/node19
Add to your tsconfig.json
:
"extends": "@tsconfig/node19/tsconfig.json"
tsconfig.json
Node 20Install:
npm install --save-dev @tsconfig/node20
yarn add --dev @tsconfig/node20
Add to your tsconfig.json
:
"extends": "@tsconfig/node20/tsconfig.json"
tsconfig.json
NuxtInstall:
npm install --save-dev @tsconfig/nuxt
yarn add --dev @tsconfig/nuxt
Add to your tsconfig.json
:
"extends": "@tsconfig/nuxt/tsconfig.json"
tsconfig.json
React NativeInstall:
npm install --save-dev @tsconfig/react-native
yarn add --dev @tsconfig/react-native
Add to your tsconfig.json
:
"extends": "@tsconfig/react-native/tsconfig.json"
tsconfig.json
RemixInstall:
npm install --save-dev @tsconfig/remix
yarn add --dev @tsconfig/remix
Add to your tsconfig.json
:
"extends": "@tsconfig/remix/tsconfig.json"
tsconfig.json
StrictestInstall:
npm install --save-dev @tsconfig/strictest
yarn add --dev @tsconfig/strictest
Add to your tsconfig.json
:
"extends": "@tsconfig/strictest/tsconfig.json"
tsconfig.json
SvelteInstall:
npm install --save-dev @tsconfig/svelte
yarn add --dev @tsconfig/svelte
Add to your tsconfig.json
:
"extends": "@tsconfig/svelte/tsconfig.json"
NOTE: After
@tsconfig/[email protected]
, you should add/// <reference types="svelte" />
to ad.ts
or aindex.ts
(entry) file to prevent typescript error.
tsconfig.json
TaroInstall:
npm install --save-dev @tsconfig/taro
yarn add --dev @tsconfig/taro
Add to your tsconfig.json
:
"extends": "@tsconfig/taro/tsconfig.json"
tsconfig.json
Vite ReactInstall:
npm install --save-dev @tsconfig/vite-react
yarn add --dev @tsconfig/vite-react
Add to your tsconfig.json
:
"extends": "@tsconfig/vite-react/tsconfig.json"
What about combined configs?
Because of previous limitations in the config extension system of TypeScript, this repo used to provide combined configs from a few common bases (like Node + ESM, Node + Strictest and so on).
This issue is now moot since TypeScript v5.0.0, which provides the ability to
extend from multiple configs at once. For instance, if you want
to start from a Node 18 + Strictest base config, you can install both
@tsconfig/node18
and @tsconfig/strictest
packages and extend those configs like so:
// tsconfig.json
{
"extends": ["@tsconfig/strictest/tsconfig", "@tsconfig/node18/tsconfig"]
}
You can see the result of the combined configs via tsc --showConfig
.
@tsconfig/esm
?
What about We deprecated it in favour of setting module/moduleResolution to node/bundler.
Contributing
git clone https://github.com/tsconfig/bases.git tsconfig-bases
cd tsconfig-bases
Then edit the tsconfig.json files in bases/
.
Every morning there is a GitHub Action which deploys any changed bases.
To generate the recommended TSConfig which is generated via tsc --init
, run:
deno run --allow-read --allow-run --allow-env --allow-write --allow-net scripts/generate-recommend.ts
Developing
Create a set of npm packages via:
deno run --allow-read --allow-write --allow-net scripts/create-npm-packages.ts
You can inspect them in the packages/
folder, then they are deployed by passing in the paths to the base files via stdin:
deno run --allow-read --allow-run --allow-env --allow-net scripts/deploy-changed-npm-packages.ts
The rest of the files in this repo are for deploying, which uses Deno 1.0.
If you add a new json file, please run deno run --allow-read --allow-write scripts/update-markdown-readme.ts
to update the README.