-
Notifications
You must be signed in to change notification settings - Fork 244
/
README.md
409 lines (287 loc) · 8.57 KB
/
README.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
## 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
<!-- AUTO -->
### Recommended <kbd><a href="./bases/recommended.json">tsconfig.json</a></kbd>
Install:
```sh
npm install --save-dev @tsconfig/recommended
yarn add --dev @tsconfig/recommended
```
Add to your `tsconfig.json`:
```json
"extends": "@tsconfig/recommended/tsconfig.json"
```
### Bun <kbd><a href="./bases/bun.json">tsconfig.json</a></kbd>
Install:
```sh
npm install --save-dev @tsconfig/bun
yarn add --dev @tsconfig/bun
```
Add to your `tsconfig.json`:
```json
"extends": "@tsconfig/bun/tsconfig.json"
```
### Create React App <kbd><a href="./bases/create-react-app.json">tsconfig.json</a></kbd>
Install:
```sh
npm install --save-dev @tsconfig/create-react-app
yarn add --dev @tsconfig/create-react-app
```
Add to your `tsconfig.json`:
```json
"extends": "@tsconfig/create-react-app/tsconfig.json"
```
### Cypress <kbd><a href="./bases/cypress.json">tsconfig.json</a></kbd>
Install:
```sh
npm install --save-dev @tsconfig/cypress
yarn add --dev @tsconfig/cypress
```
Add to your `tsconfig.json`:
```json
"extends": "@tsconfig/cypress/tsconfig.json"
```
### Deno <kbd><a href="./bases/deno.json">tsconfig.json</a></kbd>
Install:
```sh
npm install --save-dev @tsconfig/deno
yarn add --dev @tsconfig/deno
```
Add to your `tsconfig.json`:
```json
"extends": "@tsconfig/deno/tsconfig.json"
```
### Docusaurus v2 <kbd><a href="./bases/docusaurus.json">tsconfig.json</a></kbd>
Install:
```sh
npm install --save-dev @tsconfig/docusaurus
yarn add --dev @tsconfig/docusaurus
```
Add to your `tsconfig.json`:
```json
"extends": "@tsconfig/docusaurus/tsconfig.json"
```
### Ember <kbd><a href="./bases/ember.json">tsconfig.json</a></kbd>
Install:
```sh
npm install --save-dev @tsconfig/ember
yarn add --dev @tsconfig/ember
```
Add to your `tsconfig.json`:
```json
"extends": "@tsconfig/ember/tsconfig.json"
```
### Next.js <kbd><a href="./bases/next.json">tsconfig.json</a></kbd>
Install:
```sh
npm install --save-dev @tsconfig/next
yarn add --dev @tsconfig/next
```
Add to your `tsconfig.json`:
```json
"extends": "@tsconfig/next/tsconfig.json"
```
### Node LTS <kbd><a href="./bases/node-lts.json">tsconfig.json</a></kbd>
Install:
```sh
npm install --save-dev @tsconfig/node-lts
yarn add --dev @tsconfig/node-lts
```
Add to your `tsconfig.json`:
```json
"extends": "@tsconfig/node-lts/tsconfig.json"
```
### Node 10 <kbd><a href="./bases/node10.json">tsconfig.json</a></kbd>
Install:
```sh
npm install --save-dev @tsconfig/node10
yarn add --dev @tsconfig/node10
```
Add to your `tsconfig.json`:
```json
"extends": "@tsconfig/node10/tsconfig.json"
```
### Node 12 <kbd><a href="./bases/node12.json">tsconfig.json</a></kbd>
Install:
```sh
npm install --save-dev @tsconfig/node12
yarn add --dev @tsconfig/node12
```
Add to your `tsconfig.json`:
```json
"extends": "@tsconfig/node12/tsconfig.json"
```
### Node 14 <kbd><a href="./bases/node14.json">tsconfig.json</a></kbd>
Install:
```sh
npm install --save-dev @tsconfig/node14
yarn add --dev @tsconfig/node14
```
Add to your `tsconfig.json`:
```json
"extends": "@tsconfig/node14/tsconfig.json"
```
### Node 16 <kbd><a href="./bases/node16.json">tsconfig.json</a></kbd>
Install:
```sh
npm install --save-dev @tsconfig/node16
yarn add --dev @tsconfig/node16
```
Add to your `tsconfig.json`:
```json
"extends": "@tsconfig/node16/tsconfig.json"
```
### Node 17 <kbd><a href="./bases/node17.json">tsconfig.json</a></kbd>
Install:
```sh
npm install --save-dev @tsconfig/node17
yarn add --dev @tsconfig/node17
```
Add to your `tsconfig.json`:
```json
"extends": "@tsconfig/node17/tsconfig.json"
```
### Node 18 <kbd><a href="./bases/node18.json">tsconfig.json</a></kbd>
Install:
```sh
npm install --save-dev @tsconfig/node18
yarn add --dev @tsconfig/node18
```
Add to your `tsconfig.json`:
```json
"extends": "@tsconfig/node18/tsconfig.json"
```
### Node 19 <kbd><a href="./bases/node19.json">tsconfig.json</a></kbd>
Install:
```sh
npm install --save-dev @tsconfig/node19
yarn add --dev @tsconfig/node19
```
Add to your `tsconfig.json`:
```json
"extends": "@tsconfig/node19/tsconfig.json"
```
### Node 20 <kbd><a href="./bases/node20.json">tsconfig.json</a></kbd>
Install:
```sh
npm install --save-dev @tsconfig/node20
yarn add --dev @tsconfig/node20
```
Add to your `tsconfig.json`:
```json
"extends": "@tsconfig/node20/tsconfig.json"
```
### Nuxt <kbd><a href="./bases/nuxt.json">tsconfig.json</a></kbd>
Install:
```sh
npm install --save-dev @tsconfig/nuxt
yarn add --dev @tsconfig/nuxt
```
Add to your `tsconfig.json`:
```json
"extends": "@tsconfig/nuxt/tsconfig.json"
```
### React Native <kbd><a href="./bases/react-native.json">tsconfig.json</a></kbd>
Install:
```sh
npm install --save-dev @tsconfig/react-native
yarn add --dev @tsconfig/react-native
```
Add to your `tsconfig.json`:
```json
"extends": "@tsconfig/react-native/tsconfig.json"
```
### Remix <kbd><a href="./bases/remix.json">tsconfig.json</a></kbd>
Install:
```sh
npm install --save-dev @tsconfig/remix
yarn add --dev @tsconfig/remix
```
Add to your `tsconfig.json`:
```json
"extends": "@tsconfig/remix/tsconfig.json"
```
### Strictest <kbd><a href="./bases/strictest.json">tsconfig.json</a></kbd>
Install:
```sh
npm install --save-dev @tsconfig/strictest
yarn add --dev @tsconfig/strictest
```
Add to your `tsconfig.json`:
```json
"extends": "@tsconfig/strictest/tsconfig.json"
```
### Svelte <kbd><a href="./bases/svelte.json">tsconfig.json</a></kbd>
Install:
```sh
npm install --save-dev @tsconfig/svelte
yarn add --dev @tsconfig/svelte
```
Add to your `tsconfig.json`:
```json
"extends": "@tsconfig/svelte/tsconfig.json"
```
> **NOTE**: After `@tsconfig/[email protected]`, you should add `/// <reference types="svelte" />` to a `d.ts` or a `index.ts`(entry) file to prevent typescript error.
### Taro <kbd><a href="./bases/taro.json">tsconfig.json</a></kbd>
Install:
```sh
npm install --save-dev @tsconfig/taro
yarn add --dev @tsconfig/taro
```
Add to your `tsconfig.json`:
```json
"extends": "@tsconfig/taro/tsconfig.json"
```
### Vite React <kbd><a href="./bases/vite-react.json">tsconfig.json</a></kbd>
Install:
```sh
npm install --save-dev @tsconfig/vite-react
yarn add --dev @tsconfig/vite-react
```
Add to your `tsconfig.json`:
```json
"extends": "@tsconfig/vite-react/tsconfig.json"
```
<!-- /AUTO -->
### 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](https://devblogs.microsoft.com/typescript/announcing-typescript-5-0-rc/#supporting-multiple-configuration-files-in-extends). 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:
```jsonc
// tsconfig.json
{
"extends": ["@tsconfig/strictest/tsconfig", "@tsconfig/node18/tsconfig"]
}
```
You can see the result of the combined configs via `tsc --showConfig`.
### What about `@tsconfig/esm`?
We deprecated it in favour of setting [module/moduleResolution](https://github.com/tsconfig/bases/pull/197) to node/bundler.
### Contributing
```sh
git clone https://github.com/tsconfig/bases.git tsconfig-bases
cd tsconfig-bases
```
Then edit the tsconfig.json files in [`bases/`](./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:
```sh
deno run --allow-read --allow-run --allow-env --allow-write --allow-net scripts/generate-recommend.ts
```
### Developing
Create a set of npm packages via:
```sh
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:
```sh
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](https://deno.land) 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.