Commit 19b5a41
authored
Modernize tsconfig.json for Node.js module resolution (#1528)
- Switch `module` and `moduleResolution` to `nodenext` to align with modern Node.js library publishing and ES module resolution semantics.
- Bump `target` and `lib` to `es2022`. The project's existing `engines` floor (`node >= 20.20.2`) guarantees full ES2022 runtime support, so targeting es2022 is safe and lets type-checking reflect modern language features instead of nodenext's floating `target: esnext`.
- Add `"types": ["node"]` so raw `tsc --noEmit` resolves Node globals (Buffer, setTimeout, child_process, events, AbortSignal) without relying on tsd's implicit @types/node injection.
- Refactor a top-level `await` in test/types/index.test-d.ts into an async IIFE, since nodenext classifies the file as CommonJS where top-level await is illegal.
- Remove stale boilerplate section-label comments (`Strict Type-Checking Options`, `Additional Checks`) carried over from the original generated tsconfig template.
Fix: #15271 parent fce926b commit 19b5a41
2 files changed
Lines changed: 14 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
414 | 414 | | |
415 | 415 | | |
416 | 416 | | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
423 | 426 | | |
424 | 427 | | |
425 | 428 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
7 | 6 | | |
8 | | - | |
9 | 7 | | |
10 | 8 | | |
11 | 9 | | |
12 | 10 | | |
13 | 11 | | |
14 | | - | |
| 12 | + | |
| 13 | + | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
| |||
0 commit comments