@williamthorsen/tsconfig 0.8.0 → 0.10.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/.readyup/kits/default.js +6 -6
- package/.readyup/manifest.json +11 -11
- package/README.md +16 -22
- package/package.json +3 -2
- package/tsconfig.base.json +6 -5
package/.readyup/kits/default.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @noformat -- @generated. Do not edit. Compiled by rdy. */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
export const __readyupVersion = "0.
|
|
3
|
+
export const __readyupVersion = "0.38.0";
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
// .readyup/kits/default.ts
|
|
@@ -193,10 +193,10 @@ var default_default = defineRdyKit({
|
|
|
193
193
|
fix: `Extend ${BASE_SPECIFIER} from each tsconfig named above, and declare ${PACKAGE_NAME} as a devDependency of each package that names it but cannot resolve it. Adoption: ${ADOPTION_URL}`
|
|
194
194
|
},
|
|
195
195
|
{
|
|
196
|
-
name: "No tsconfig re-declares an option the base already supplies",
|
|
196
|
+
name: "No tsconfig re-declares an option that the base already supplies",
|
|
197
197
|
severity: "recommend",
|
|
198
198
|
check: noRedundantOptions,
|
|
199
|
-
fix: "Delete each option named above:
|
|
199
|
+
fix: "Delete each option named above: The base already supplies it with the same value"
|
|
200
200
|
}
|
|
201
201
|
]
|
|
202
202
|
},
|
|
@@ -207,14 +207,14 @@ var default_default = defineRdyKit({
|
|
|
207
207
|
name: `No tsconfig declares an ES year other than the one ${PACKAGE_NAME} sets`,
|
|
208
208
|
skip: skipUnlessBaseEsYearKnown,
|
|
209
209
|
check: everyEsYearMatchesTheBase,
|
|
210
|
-
fix: "Delete the target or lib declaration named above, so the ES year the base
|
|
210
|
+
fix: "Delete the target or lib declaration named above, so that the ES year set by the base applies"
|
|
211
211
|
},
|
|
212
212
|
{
|
|
213
213
|
name: "The declared Node floor supports the base's ES year",
|
|
214
214
|
severity: "error",
|
|
215
215
|
skip: skipUnlessNodeFloorComparable,
|
|
216
216
|
check: nodeFloorSupportsBaseEsYear,
|
|
217
|
-
fix: "Raise engines.node to a major implementing the base's ES year:
|
|
217
|
+
fix: "Raise engines.node to a major implementing the base's ES year: Below it, code that typechecks fails at runtime"
|
|
218
218
|
}
|
|
219
219
|
]
|
|
220
220
|
},
|
|
@@ -225,7 +225,7 @@ var default_default = defineRdyKit({
|
|
|
225
225
|
name: "No tsconfig's include, exclude, or files names a path outside its own directory",
|
|
226
226
|
skip: skipUnlessSomeTsconfigWasFound,
|
|
227
227
|
check: noEscapingPaths,
|
|
228
|
-
fix: "Declare the field named above in the config that owns the directory, listing every path it needs, since a local declaration replaces the inherited one rather than merging and discards the default exclude of node_modules, bower_components, jspm_packages, and outDir; or prefix each path in the config being extended with ${configDir}, which resolves to the consuming config's directory"
|
|
228
|
+
fix: "Declare the field named above in the config that owns the directory, listing every path that it needs, since a local declaration replaces the inherited one rather than merging and discards the default exclude of node_modules, bower_components, jspm_packages, and outDir; or prefix each path in the config being extended with ${configDir}, which resolves to the consuming config's directory"
|
|
229
229
|
}
|
|
230
230
|
]
|
|
231
231
|
}
|
package/.readyup/manifest.json
CHANGED
|
@@ -11,52 +11,52 @@
|
|
|
11
11
|
"esbuildVersion": "0.28.2",
|
|
12
12
|
"inputs": [
|
|
13
13
|
{
|
|
14
|
-
"hash": "
|
|
14
|
+
"hash": "d1952ca5",
|
|
15
15
|
"kind": "module",
|
|
16
16
|
"path": "kits/default.ts"
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
|
-
"hash": "
|
|
19
|
+
"hash": "cee0fa23",
|
|
20
20
|
"kind": "module",
|
|
21
21
|
"path": "../src/readiness/base-chain.ts"
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
|
-
"hash": "
|
|
24
|
+
"hash": "4f053be6",
|
|
25
25
|
"kind": "module",
|
|
26
26
|
"path": "../src/readiness/classifyChain.ts"
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
|
-
"hash": "
|
|
29
|
+
"hash": "4861e1ce",
|
|
30
30
|
"kind": "module",
|
|
31
31
|
"path": "../src/readiness/es-year.ts"
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
|
-
"hash": "
|
|
34
|
+
"hash": "7e81b592",
|
|
35
35
|
"kind": "module",
|
|
36
36
|
"path": "../src/readiness/findEscapingPaths.ts"
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
|
-
"hash": "
|
|
39
|
+
"hash": "b84db6a6",
|
|
40
40
|
"kind": "module",
|
|
41
41
|
"path": "../src/readiness/findRedundantOptions.ts"
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
|
-
"hash": "
|
|
44
|
+
"hash": "d53de60d",
|
|
45
45
|
"kind": "module",
|
|
46
46
|
"path": "../src/readiness/listSearchDirs.ts"
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
|
-
"hash": "
|
|
49
|
+
"hash": "ecb17b24",
|
|
50
50
|
"kind": "module",
|
|
51
51
|
"path": "../src/readiness/node-floor.ts"
|
|
52
52
|
}
|
|
53
53
|
],
|
|
54
54
|
"name": "default",
|
|
55
55
|
"path": "kits/default.js",
|
|
56
|
-
"readyupVersion": "0.
|
|
56
|
+
"readyupVersion": "0.38.0",
|
|
57
57
|
"source": "kits/default.ts",
|
|
58
|
-
"sourceHash": "
|
|
59
|
-
"targetHash": "
|
|
58
|
+
"sourceHash": "d1952ca5",
|
|
59
|
+
"targetHash": "db184a57"
|
|
60
60
|
}
|
|
61
61
|
]
|
|
62
62
|
}
|
package/README.md
CHANGED
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
# @williamthorsen/tsconfig
|
|
2
2
|
|
|
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.
|
|
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 that it leaves out, so a consuming repo declares only what is genuinely its own.
|
|
4
4
|
|
|
5
5
|
<!-- section:release-notes -->
|
|
6
|
-
## Release notes — v0.
|
|
6
|
+
## Release notes — v0.10.0 (2026-09-29)
|
|
7
7
|
|
|
8
8
|
### 🎉 Features
|
|
9
9
|
|
|
10
|
-
-
|
|
11
|
-
|
|
12
|
-
- Adds an `import-x/resolver` default to `@williamthorsen/eslint-config-typescript`. The default sets `extensionAlias` and is scoped to TypeScript files, so `import-x/no-cycle` reports a cycle among specifiers ending in `.js` and a JavaScript source still resolves `./b.js` to `b.js`.
|
|
13
|
-
- Raises the `typescript` peer range to `>=5.7`, the first version in which a project emitting with `tsc` can write the required spelling.
|
|
14
|
-
- Sets `rewriteRelativeImportExtensions` in `@williamthorsen/tsconfig`'s base, so that a build that clears `noEmit` compiles a TypeScript-extension import.
|
|
15
|
-
|
|
16
|
-
Migration: Upgrade `typescript` to 5.7 or later, rewrite each relative specifier naming a TypeScript file to end in that file's own extension (`./b.ts`, not `./b.js`), and in the tsconfig owning those sources set `allowImportingTsExtensions` alongside `noEmit` or `emitDeclarationOnly`, or set `rewriteRelativeImportExtensions`. Do the rewrite by hand or with a codemod, and do not apply the editor suggestion that `import-x/extensions` offers: it appends the resolved extension rather than replacing the written one, turning `./b.js` into `./b.js.ts`. `docs/migrating-to-v15.md` walks through each step.
|
|
10
|
+
- Rewords the messages that the package's ReadyUp kit reports: The redundant-option check is now named "No tsconfig re-declares an option that the base already supplies", and the fix hints for the redundant-option, ES-year, Node-floor, and escaping-path checks are reworded. (#250)
|
|
17
11
|
<!-- /section:release-notes -->
|
|
18
12
|
|
|
19
13
|
## Installation
|
|
@@ -36,7 +30,7 @@ pnpm add -D @williamthorsen/tsconfig
|
|
|
36
30
|
|
|
37
31
|
## Adopting the base
|
|
38
32
|
|
|
39
|
-
Extend the base from every tsconfig in the repo, not from the root alone. A workspace config
|
|
33
|
+
Extend the base from every tsconfig in the repo, not from the root alone. A workspace config extends it either directly or through a config that does:
|
|
40
34
|
|
|
41
35
|
```jsonc
|
|
42
36
|
// packages/api/tsconfig.json
|
|
@@ -46,9 +40,9 @@ Extend the base from every tsconfig in the repo, not from the root alone. A work
|
|
|
46
40
|
}
|
|
47
41
|
```
|
|
48
42
|
|
|
49
|
-
Every package whose tsconfig names the base by package specifier must also declare it as a devDependency: TypeScript resolves `extends` from the directory of the config that declares it, so a workspace naming a package it does not depend
|
|
43
|
+
Every package whose tsconfig names the base by package specifier must also declare it as a devDependency: TypeScript resolves `extends` from the directory of the config that declares it, so a workspace naming a package on which it does not depend resolves nothing.
|
|
50
44
|
|
|
51
|
-
Once the base is in the chain, delete the options it already supplies with the same value. The inherited value applies either way, and the copy left behind stops tracking the base the next time it changes. An option set to a _different_ value is an override and stays.
|
|
45
|
+
Once the base is in the chain, delete the options that it already supplies with the same value. The inherited value applies either way, and the copy left behind stops tracking the base the next time it changes. An option set to a _different_ value is an override and stays.
|
|
52
46
|
|
|
53
47
|
A package that extends a framework base such as `astro/tsconfigs/base` or `@tsconfig/svelte` has opted out of this one, which is a supported choice.
|
|
54
48
|
|
|
@@ -66,7 +60,7 @@ Everything `@tsconfig/strictest` sets, plus the Node and build options it omits:
|
|
|
66
60
|
| `removeComments` | `true` |
|
|
67
61
|
| `target` | `"ES2025"` |
|
|
68
62
|
|
|
69
|
-
`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
|
|
63
|
+
`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 but the numbered libs do not yet include.
|
|
70
64
|
|
|
71
65
|
## What the consumer owns
|
|
72
66
|
|
|
@@ -80,11 +74,11 @@ The base declares none of these:
|
|
|
80
74
|
|
|
81
75
|
## Emitting
|
|
82
76
|
|
|
83
|
-
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.
|
|
77
|
+
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 that `./foo.ts` specifiers survive the rewrite.
|
|
84
78
|
|
|
85
|
-
## Checking
|
|
79
|
+
## Checking the configuration
|
|
86
80
|
|
|
87
|
-
This package ships a [ReadyUp](https://www.npmjs.com/package/readyup) kit that checks whether
|
|
81
|
+
This package ships a [ReadyUp](https://www.npmjs.com/package/readyup) kit that checks whether the workspace tsconfigs are wired for the installed version. It is a migration aid rather than a CI gate: Only a Node floor too old to run the base's ES year is reported as an error, and everything else caps at a warning.
|
|
88
82
|
|
|
89
83
|
Run it once:
|
|
90
84
|
|
|
@@ -92,7 +86,7 @@ Run it once:
|
|
|
92
86
|
pnpm exec rdy run --from npm:@williamthorsen/tsconfig
|
|
93
87
|
```
|
|
94
88
|
|
|
95
|
-
Or list it in `.config/readyup.config.ts` to include it
|
|
89
|
+
Or list it in `.config/readyup.config.ts` to include it in every `rdy run --packages`:
|
|
96
90
|
|
|
97
91
|
```ts
|
|
98
92
|
import { defineRdyConfig } from 'readyup';
|
|
@@ -102,17 +96,17 @@ export default defineRdyConfig({
|
|
|
102
96
|
});
|
|
103
97
|
```
|
|
104
98
|
|
|
105
|
-
The `readyup >=0.33.0` optional peer names the version the kit is developed and tested
|
|
99
|
+
The `readyup >=0.33.0` optional peer names the version against which the kit is developed and tested. Below 0.33.0, readyup does not report the repo root among a monorepo's workspaces, so the kit supplies the root itself and sweeps every member package alongside it.
|
|
106
100
|
|
|
107
101
|
The kit walks each workspace tsconfig's `extends` chain and reports five things:
|
|
108
102
|
|
|
109
103
|
- **Adoption**: a tsconfig reaching neither this base nor a framework base. A tsconfig naming this base through a specifier that does not resolve is reported separately, as declared but not installed.
|
|
110
|
-
- **Re-declaration**: an option restated with the base's own value. A key that a framework base in the same chain also declares is exempt, since restating it is how a config
|
|
104
|
+
- **Re-declaration**: an option restated with the base's own value. A key that a framework base in the same chain also declares is exempt, since restating it is how a config overrides that base.
|
|
111
105
|
- **Escaping paths**: an `include`, `exclude`, or `files` path resolving outside the directory that holds the tsconfig. A config that is extended hands these fields down resolved against its own directory, so a package inheriting them is governed by paths pointing outside itself; the remedy is a complete local declaration, or `${configDir}` in the config being extended.
|
|
112
|
-
- **ES year**: a `target` or `lib` declaring a year other than the base's, read from the base
|
|
113
|
-
- **Node floor**: an `engines.node` below the major that implements that ES year. This is the one failure `tsc` cannot
|
|
106
|
+
- **ES year**: a `target` or `lib` declaring a year other than the base's, read from the base that the tsconfig extends rather than from a constant compiled into the kit.
|
|
107
|
+
- **Node floor**: an `engines.node` below the major that implements that ES year. This is the one failure that `tsc` cannot report on its own, which is why it alone is an error.
|
|
114
108
|
|
|
115
|
-
The kit runs at the version resolved from
|
|
109
|
+
The kit runs at the version resolved from the project's `node_modules`, so it reports whether the configuration matches that version. It never reports whether that version is current.
|
|
116
110
|
|
|
117
111
|
## License
|
|
118
112
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@williamthorsen/tsconfig",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Shared TypeScript base config for Node-only projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"tsconfig",
|
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@tsconfig/strictest": "2.0.8",
|
|
33
33
|
"esbuild": "0.28.2",
|
|
34
|
-
"readyup": "0.
|
|
34
|
+
"readyup": "0.38.0",
|
|
35
|
+
"vitest": "4.1.11"
|
|
35
36
|
},
|
|
36
37
|
"peerDependencies": {
|
|
37
38
|
"readyup": ">=0.33.0"
|
package/tsconfig.base.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
// Base TSConfig for Node-only TypeScript: `@tsconfig/strictest` plus the Node/build options it omits.
|
|
1
|
+
// Base TSConfig for Node-only TypeScript: `@tsconfig/strictest` plus the Node/build options that it omits.
|
|
2
2
|
// Consumers set `types`, `paths`, `jsx`, and `include`. Node 24 floor.
|
|
3
3
|
//
|
|
4
4
|
// Every Node/build setting deviates from a TypeScript default; a comment says why it can't be dropped.
|
|
5
|
-
// The inlined strictest settings
|
|
5
|
+
// The inlined strictest settings have no such comments: Their rationale belongs to upstream.
|
|
6
6
|
{
|
|
7
7
|
"$schema": "https://json.schemastore.org/tsconfig",
|
|
8
8
|
"compilerOptions": {
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
|
|
29
29
|
// Permit `./foo.ts` specifiers; the build step rewrites them on emit.
|
|
30
30
|
"allowImportingTsExtensions": true,
|
|
31
|
-
//
|
|
32
|
-
//
|
|
31
|
+
// Required alongside `allowImportingTsExtensions` once a build clears `noEmit` and emits with `tsc`,
|
|
32
|
+
// which then rewrites the specifier's extension in output and declarations.
|
|
33
33
|
"rewriteRelativeImportExtensions": true,
|
|
34
34
|
// Without this, `lib` follows `target` into the `.full` variant, admitting DOM globals.
|
|
35
|
-
// `ESNext.Disposable`
|
|
35
|
+
// `ESNext.Disposable` contains the explicit-resource-management declarations; no numbered lib has them.
|
|
36
36
|
"lib": ["ES2025", "ESNext.Disposable"],
|
|
37
37
|
// Default is `ES2022` with `Bundler` resolution: wrong for published Node packages.
|
|
38
38
|
"module": "NodeNext",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"noEmit": true,
|
|
43
43
|
// Inert until a build step clears `noEmit`; keeps published output comment-free.
|
|
44
44
|
"removeComments": true,
|
|
45
|
+
// Default is the latest ES year that the installed TypeScript knows; pin the year that the Node floor implements.
|
|
45
46
|
"target": "ES2025",
|
|
46
47
|
},
|
|
47
48
|
}
|