@williamthorsen/tsconfig 0.0.0 → 0.1.1

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,65 @@
1
- Placeholder for `@williamthorsen/tsconfig` — awaiting first release.
1
+ # @williamthorsen/tsconfig
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.
4
+
5
+ <!-- section:release-notes -->
6
+ ## Release notes — v0.1.1 (2026-08-01)
7
+
8
+ ### 🐛 Bug fixes
9
+
10
+ - Inline @tsconfig/strictest instead of extending it (#129)
11
+
12
+ Fixes an issue where, under pnpm, tools that resolve tsconfig files without following symlinks failed to find `@tsconfig/strictest`, breaking lint runs and builds in projects that declare only `@williamthorsen/tsconfig`. Consuming projects no longer need to add `@tsconfig/strictest` to their own `package.json` as a workaround.
13
+ <!-- /section:release-notes -->
14
+
15
+ ## Installation
16
+
17
+ ```shell
18
+ pnpm add -D @williamthorsen/tsconfig
19
+ ```
20
+
21
+ ## Quick start
22
+
23
+ ```jsonc
24
+ {
25
+ "extends": "@williamthorsen/tsconfig/tsconfig.base.json",
26
+ "compilerOptions": {
27
+ "types": ["node"],
28
+ },
29
+ "include": ["src/"],
30
+ }
31
+ ```
32
+
33
+ ## What the base sets
34
+
35
+ Everything `@tsconfig/strictest` sets, plus the Node and build options it omits:
36
+
37
+ | Option | Value |
38
+ | ---------------------------- | ------------ |
39
+ | `allowImportingTsExtensions` | `true` |
40
+ | `lib` | `["ES2025"]` |
41
+ | `module` | `"NodeNext"` |
42
+ | `moduleDetection` | `"force"` |
43
+ | `noEmit` | `true` |
44
+ | `removeComments` | `true` |
45
+ | `target` | `"ES2025"` |
46
+
47
+ `target` and `lib` are pinned to a Node 24 floor.
48
+
49
+ ## What the consumer owns
50
+
51
+ The base deliberately declares none of these:
52
+
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.
56
+
57
+ `include` and `exclude` are likewise the consumer's, since only it knows its own layout.
58
+
59
+ ## Emitting
60
+
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.
62
+
63
+ ## License
64
+
65
+ 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.1",
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
+ "devDependencies": {
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,43 @@
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 Node/build setting deviates from a TypeScript default; a comment says why it can't be dropped.
5
+ // The inlined strictest settings carry no such comments: their rationale belongs to upstream.
6
+ {
7
+ "$schema": "https://json.schemastore.org/tsconfig",
8
+ "compilerOptions": {
9
+ // Inlined from `@tsconfig/strictest`, in upstream's order. Not reached through `extends`, because
10
+ // resolvers that don't realpath pnpm symlinks can't follow the second hop. The root test
11
+ // `__tests__/tsconfig-base.app.test.ts` asserts this block still matches the installed devDependency.
12
+ "strict": true,
13
+ "allowUnusedLabels": false,
14
+ "allowUnreachableCode": false,
15
+ "exactOptionalPropertyTypes": true,
16
+ "noFallthroughCasesInSwitch": true,
17
+ "noImplicitOverride": true,
18
+ "noImplicitReturns": true,
19
+ "noPropertyAccessFromIndexSignature": true,
20
+ "noUncheckedIndexedAccess": true,
21
+ "noUnusedLocals": true,
22
+ "noUnusedParameters": true,
23
+
24
+ "isolatedModules": true,
25
+
26
+ "esModuleInterop": true,
27
+ "skipLibCheck": true,
28
+
29
+ // Permit `./foo.ts` specifiers; the build step rewrites them on emit.
30
+ "allowImportingTsExtensions": true,
31
+ // Without this, `lib` follows `target` into the `.full` variant, admitting DOM globals.
32
+ "lib": ["ES2025"],
33
+ // Default is `ES2022` with `Bundler` resolution — wrong for published Node packages.
34
+ "module": "NodeNext",
35
+ // Files with no import or export would otherwise be scripts sharing global scope.
36
+ "moduleDetection": "force",
37
+ // Typecheck-only base; build steps override emit settings.
38
+ "noEmit": true,
39
+ // Inert until a build step clears `noEmit`; keeps published output comment-free.
40
+ "removeComments": true,
41
+ "target": "ES2025",
42
+ },
43
+ }