@foxglove/tsconfig 3.0.0 → 3.2.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
@@ -18,7 +18,13 @@ yarn add -D @foxglove/tsconfig
18
18
 
19
19
  Choose the config that matches your environment:
20
20
 
21
- ### Node.js applications and libraries
21
+ ### Node.js applications and published libraries
22
+
23
+ Uses `module: "NodeNext"`, which enforces Node.js ESM rules.
24
+
25
+ Use `node.json` for published libraries, even if your library will be used in bundled apps. Bundlers consume Node-style packages natively, just remember to avoid Node-specific APIs like `fs` or `process`.
26
+
27
+ Relative imports must include explicit file extensions (e.g., `import { foo } from "./bar.ts"`).
22
28
 
23
29
  ```json
24
30
  {
@@ -31,30 +37,34 @@ Choose the config that matches your environment:
31
37
  }
32
38
  ```
33
39
 
34
- > **Note:** Uses `target: "ESNext"`. For older Node.js versions, set a lower target (e.g., `"ES2022"` for Node 18).
40
+ > [!TIP]
41
+ > `base.json` uses `target: "ESNext"`. For published libraries, you may wish to set a lower target (e.g., `"ES2022"` for Node 18).
35
42
 
36
- > **Cross-platform libraries:** Use `node.json` even if your library will be used in frontend apps. Bundlers consume Node-style packages natively—just avoid Node-specific APIs like `fs` or `process`.
43
+ ### Bundled applications (Webpack, Vite, esbuild, etc)
37
44
 
38
- ### Frontend applications (Vite, Webpack, esbuild, etc)
45
+ Uses `module: "Preserve"`, which enables optimizations for code consumed directly by a bundler.
39
46
 
40
- For bundled apps that run in the browser (not published as packages):
47
+ Supports extensionless relative imports (e.g., `import { foo } from "./bar"`).
41
48
 
42
49
  ```json
43
50
  {
44
51
  "extends": "@foxglove/tsconfig/bundler.json",
45
- "include": ["./src/**/*"]
52
+ "include": ["./src/**/*"],
53
+ "compilerOptions": {
54
+ "noEmit": true,
55
+ "lib": ["ESNext", "DOM"]
56
+ }
46
57
  }
47
58
  ```
48
59
 
49
60
  ### Base config
50
61
 
51
- Provides strict type-checking and modern defaults, but no `module`, `moduleResolution`, or `target` settings. Use this when `node.json` and `bundler.json` don't fit your environment:
62
+ Provides strict type-checking and modern defaults, but no `module` or `moduleResolution` settings. Use this when `node.json` and `bundler.json` don't fit your environment:
52
63
 
53
64
  ```json
54
65
  {
55
66
  "extends": "@foxglove/tsconfig/base.json",
56
67
  "compilerOptions": {
57
- "target": "...",
58
68
  "module": "...",
59
69
  "moduleResolution": "..."
60
70
  }
package/base.json CHANGED
@@ -5,6 +5,9 @@
5
5
  {
6
6
  "$schema": "https://json.schemastore.org/tsconfig",
7
7
  "compilerOptions": {
8
+ // Language
9
+ "target": "ESNext",
10
+
8
11
  // Type checking
9
12
  "strict": true,
10
13
  "noFallthroughCasesInSwitch": true,
@@ -28,7 +31,6 @@
28
31
  // Emit
29
32
  "declaration": true,
30
33
  "declarationMap": true,
31
- "isolatedDeclarations": true,
32
34
  "newLine": "lf",
33
35
  "sourceMap": true,
34
36
 
package/bundler.json CHANGED
@@ -6,8 +6,6 @@
6
6
  "compilerOptions": {
7
7
  // Bundler handles module resolution
8
8
  "module": "Preserve",
9
- "moduleResolution": "Bundler",
10
- "target": "ESNext",
11
- "lib": ["ESNext", "DOM", "DOM.AsyncIterable", "DOM.Iterable"]
9
+ "moduleResolution": "Bundler"
12
10
  }
13
11
  }
package/node.json CHANGED
@@ -6,7 +6,6 @@
6
6
  "compilerOptions": {
7
7
  // Node.js ESM
8
8
  "module": "NodeNext",
9
- "moduleResolution": "NodeNext",
10
- "target": "ESNext"
9
+ "moduleResolution": "NodeNext"
11
10
  }
12
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@foxglove/tsconfig",
3
- "version": "3.0.0",
3
+ "version": "3.2.0",
4
4
  "description": "Base TypeScript configuration for Foxglove projects",
5
5
  "license": "MIT",
6
6
  "repository": {