@williamthorsen/tsconfig 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,7 +2,15 @@
2
2
 
3
3
  Shared TypeScript base config for Node-only projects. Inlines the settings of [`@tsconfig/strictest`](https://www.npmjs.com/package/@tsconfig/strictest) and adds the Node and build options it leaves out, so a consuming repo declares only what is genuinely its own.
4
4
 
5
- <!-- section:release-notes --><!-- /section:release-notes -->
5
+ <!-- section:release-notes -->
6
+ ## Release notes — v0.3.0 (2026-08-07)
7
+
8
+ ### 🎉 Features
9
+
10
+ - Support explicit resource management for consumers (#148)
11
+
12
+ Adds `ESNext.Disposable` to the libraries recognized by TypeScript in the exported base config. This enables the use of `using` and `await using` declarations.
13
+ <!-- /section:release-notes -->
6
14
 
7
15
  ## Installation
8
16
 
@@ -26,31 +34,31 @@ pnpm add -D @williamthorsen/tsconfig
26
34
 
27
35
  Everything `@tsconfig/strictest` sets, plus the Node and build options it omits:
28
36
 
29
- | Option | Value |
30
- | ---------------------------- | ------------ |
31
- | `allowImportingTsExtensions` | `true` |
32
- | `lib` | `["ES2025"]` |
33
- | `module` | `"NodeNext"` |
34
- | `moduleDetection` | `"force"` |
35
- | `noEmit` | `true` |
36
- | `removeComments` | `true` |
37
- | `target` | `"ES2025"` |
37
+ | Option | Value |
38
+ | ---------------------------- | --------------------------------- |
39
+ | `allowImportingTsExtensions` | `true` |
40
+ | `lib` | `["ES2025", "ESNext.Disposable"]` |
41
+ | `module` | `"NodeNext"` |
42
+ | `moduleDetection` | `"force"` |
43
+ | `noEmit` | `true` |
44
+ | `removeComments` | `true` |
45
+ | `target` | `"ES2025"` |
38
46
 
39
- `target` and `lib` are pinned to a Node 24 floor.
47
+ `target` and `lib` are pinned to a Node 24 floor. `ESNext.Disposable` supplies the explicit-resource-management declarations (`using`, `Disposable`, `DisposableStack`), which Node 24 implements and no numbered lib yet carries.
40
48
 
41
49
  ## What the consumer owns
42
50
 
43
51
  The base declares none of these:
44
52
 
45
- - **`types`** — the ambient type packages in scope. Most Node projects want `["node"]`; declaring it narrows the default, which would otherwise pull in every `@types/*` package installed.
46
- - **`paths`** — TypeScript resolves `baseUrl`-less `paths` relative to the file that _declares_ them, so a path alias set in this package would resolve inside `node_modules`. Aliases must be declared by the config that owns the source tree.
47
- - **`jsx`** — meaningless for the many consumers with no JSX at all.
53
+ - **`types`**: The ambient type packages in scope. Most Node projects want `["node"]`; declaring it narrows the default, which would otherwise pull in every `@types/*` package installed.
54
+ - **`paths`**: TypeScript resolves `baseUrl`-less `paths` relative to the file that _declares_ them, so a path alias set in this package would resolve inside `node_modules`. Aliases must be declared by the config that owns the source tree.
55
+ - **`jsx`**: Meaningless for the many consumers with no JSX at all.
48
56
 
49
57
  `include` and `exclude` are likewise the consumer's, since only it knows its own layout.
50
58
 
51
59
  ## Emitting
52
60
 
53
- The base sets `noEmit: true`, on the assumption that a separate build step owns emit. A consumer that builds with this config directly must override `noEmit` — and, if it keeps `allowImportingTsExtensions`, pair that with `rewriteRelativeImportExtensions` so `./foo.ts` specifiers survive the rewrite.
61
+ The base sets `noEmit: true`, on the assumption that a separate build step owns emit. A consumer that builds with this config directly must override `noEmit` and, if it keeps `allowImportingTsExtensions`, pair that with `rewriteRelativeImportExtensions` so `./foo.ts` specifiers survive the rewrite.
54
62
 
55
63
  ## License
56
64
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@williamthorsen/tsconfig",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "Shared TypeScript base config for Node-only projects",
5
5
  "keywords": [
6
6
  "tsconfig",
@@ -29,7 +29,8 @@
29
29
  // Permit `./foo.ts` specifiers; the build step rewrites them on emit.
30
30
  "allowImportingTsExtensions": true,
31
31
  // Without this, `lib` follows `target` into the `.full` variant, admitting DOM globals.
32
- "lib": ["ES2025"],
32
+ // `ESNext.Disposable` carries the explicit-resource-management declarations; no numbered lib has them.
33
+ "lib": ["ES2025", "ESNext.Disposable"],
33
34
  // Default is `ES2022` with `Bundler` resolution — wrong for published Node packages.
34
35
  "module": "NodeNext",
35
36
  // Files with no import or export would otherwise be scripts sharing global scope.