@williamthorsen/tsconfig 0.0.0 → 0.1.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/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ ISC License
2
+
3
+ Copyright (c) 2023-2026 William Thorsen
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
6
+
7
+ The software is provided "as is" and the author disclaims all warranties with regard to this software including all implied warranties of merchantability and fitness. In no event shall the author be liable for any special, direct, indirect, or consequential damages or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortious action, arising out of or in connection with the use or performance of this software.
package/README.md CHANGED
@@ -1 +1,69 @@
1
- Placeholder for `@williamthorsen/tsconfig` — awaiting first release.
1
+ # @williamthorsen/tsconfig
2
+
3
+ Shared TypeScript base config for Node-only projects. Composes [`@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
+
5
+ <!-- section:release-notes -->
6
+ ## Release notes — v0.1.0 (2026-07-23)
7
+
8
+ ### 🎉 Features
9
+
10
+ - 🚨 **Breaking:** Publish a shared TypeScript config on a Node 24 floor (#108)
11
+
12
+ Introduces `@williamthorsen/tsconfig`, a published baseline that Node-only TypeScript projects can extend. It pairs the strictest available TypeScript settings with additional Node and build options. A consumer is left to declare its own ambient types, path aliases, JSX, and file globs.
13
+
14
+ `@williamthorsen/eslint-config-typescript` now requires Node 24 or later.
15
+ <!-- /section:release-notes -->
16
+
17
+ ## Installation
18
+
19
+ ```shell
20
+ pnpm add -D @williamthorsen/tsconfig
21
+ ```
22
+
23
+ `@tsconfig/strictest` comes along as a dependency; it does not need to be installed separately.
24
+
25
+ ## Quick start
26
+
27
+ ```jsonc
28
+ {
29
+ "extends": "@williamthorsen/tsconfig/tsconfig.base.json",
30
+ "compilerOptions": {
31
+ "types": ["node"],
32
+ },
33
+ "include": ["src/"],
34
+ }
35
+ ```
36
+
37
+ ## What the base sets
38
+
39
+ Everything from `@tsconfig/strictest`, plus the Node and build options strictest omits:
40
+
41
+ | Option | Value |
42
+ | ---------------------------- | ------------ |
43
+ | `allowImportingTsExtensions` | `true` |
44
+ | `lib` | `["ES2025"]` |
45
+ | `module` | `"NodeNext"` |
46
+ | `moduleDetection` | `"force"` |
47
+ | `noEmit` | `true` |
48
+ | `removeComments` | `true` |
49
+ | `target` | `"ES2025"` |
50
+
51
+ `target` and `lib` are pinned to a Node 24 floor.
52
+
53
+ ## What the consumer owns
54
+
55
+ The base deliberately declares none of these:
56
+
57
+ - **`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.
58
+ - **`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.
59
+ - **`jsx`** — meaningless for the many consumers with no JSX at all.
60
+
61
+ `include` and `exclude` are likewise the consumer's, since only it knows its own layout.
62
+
63
+ ## Emitting
64
+
65
+ 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.
66
+
67
+ ## License
68
+
69
+ ISC
package/package.json CHANGED
@@ -1,4 +1,44 @@
1
1
  {
2
2
  "name": "@williamthorsen/tsconfig",
3
- "version": "0.0.0"
4
- }
3
+ "version": "0.1.0",
4
+ "description": "Shared TypeScript base config for Node-only projects",
5
+ "keywords": [
6
+ "tsconfig",
7
+ "typescript"
8
+ ],
9
+ "homepage": "https://github.com/williamthorsen/eslint-config/tree/main/packages/tsconfig#readme",
10
+ "bugs": {
11
+ "url": "https://github.com/williamthorsen/eslint-config/issues"
12
+ },
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/williamthorsen/eslint-config.git",
16
+ "directory": "packages/tsconfig"
17
+ },
18
+ "license": "ISC",
19
+ "author": "William Thorsen <william@thorsen.dev> (https://github.com/williamthorsen)",
20
+ "type": "module",
21
+ "exports": {
22
+ "./package.json": "./package.json",
23
+ "./tsconfig.base.json": "./tsconfig.base.json"
24
+ },
25
+ "files": [
26
+ "tsconfig.base.json"
27
+ ],
28
+ "dependencies": {
29
+ "@tsconfig/strictest": "2.0.8"
30
+ },
31
+ "engines": {
32
+ "node": ">=24"
33
+ },
34
+ "publishConfig": {
35
+ "access": "public",
36
+ "registry": "https://registry.npmjs.org"
37
+ },
38
+ "scripts": {
39
+ "build": ":",
40
+ "check": "nmr lint:strict",
41
+ "test": ":",
42
+ "test:coverage": ":"
43
+ }
44
+ }
@@ -0,0 +1,23 @@
1
+ // Base TSConfig for Node-only TypeScript: `@tsconfig/strictest` plus the Node/build options it omits.
2
+ // Consumers set `types`, `paths`, `jsx`, and `include`. Node 24 floor.
3
+ //
4
+ // Every setting deviates from a TypeScript default; a comment says why it can't be dropped.
5
+ {
6
+ "$schema": "https://json.schemastore.org/tsconfig",
7
+ "extends": "@tsconfig/strictest",
8
+ "compilerOptions": {
9
+ // Permit `./foo.ts` specifiers; the build step rewrites them on emit.
10
+ "allowImportingTsExtensions": true,
11
+ // Without this, `lib` follows `target` into the `.full` variant, admitting DOM globals.
12
+ "lib": ["ES2025"],
13
+ // Default is `ES2022` with `Bundler` resolution — wrong for published Node packages.
14
+ "module": "NodeNext",
15
+ // Files with no import or export would otherwise be scripts sharing global scope.
16
+ "moduleDetection": "force",
17
+ // Typecheck-only base; build steps override emit settings.
18
+ "noEmit": true,
19
+ // Inert until a build step clears `noEmit`; keeps published output comment-free.
20
+ "removeComments": true,
21
+ "target": "ES2025",
22
+ },
23
+ }