@foxglove/tsconfig 3.0.0 → 3.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/README.md +11 -6
- package/base.json +3 -0
- package/bundler.json +1 -3
- package/node.json +1 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,6 +20,8 @@ Choose the config that matches your environment:
|
|
|
20
20
|
|
|
21
21
|
### Node.js applications and libraries
|
|
22
22
|
|
|
23
|
+
Uses `module: "NodeNext"` which enforces Node.js ESM rules, where imports must include explicit file extensions (e.g., `import { foo } from "./bar.ts"`).
|
|
24
|
+
|
|
23
25
|
```json
|
|
24
26
|
{
|
|
25
27
|
"extends": "@foxglove/tsconfig/node.json",
|
|
@@ -33,28 +35,31 @@ Choose the config that matches your environment:
|
|
|
33
35
|
|
|
34
36
|
> **Note:** Uses `target: "ESNext"`. For older Node.js versions, set a lower target (e.g., `"ES2022"` for Node 18).
|
|
35
37
|
|
|
36
|
-
> **Cross-platform libraries:** Use `node.json` even if your library will be used in
|
|
38
|
+
> **Cross-platform libraries:** Use `node.json` 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`.
|
|
37
39
|
|
|
38
|
-
###
|
|
40
|
+
### Bundled applications (Vite, Webpack, esbuild, etc)
|
|
39
41
|
|
|
40
|
-
|
|
42
|
+
Uses `module: "Preserve"` which allows extensionless imports (e.g., `import { foo } from "./bar"`, where the bundler handles resolution.
|
|
41
43
|
|
|
42
44
|
```json
|
|
43
45
|
{
|
|
44
46
|
"extends": "@foxglove/tsconfig/bundler.json",
|
|
45
|
-
"include": ["./src/**/*"]
|
|
47
|
+
"include": ["./src/**/*"],
|
|
48
|
+
"compilerOptions": {
|
|
49
|
+
"noEmit": true,
|
|
50
|
+
"lib": ["ESNext", "DOM"]
|
|
51
|
+
}
|
|
46
52
|
}
|
|
47
53
|
```
|
|
48
54
|
|
|
49
55
|
### Base config
|
|
50
56
|
|
|
51
|
-
Provides strict type-checking and modern defaults, but no `module
|
|
57
|
+
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
58
|
|
|
53
59
|
```json
|
|
54
60
|
{
|
|
55
61
|
"extends": "@foxglove/tsconfig/base.json",
|
|
56
62
|
"compilerOptions": {
|
|
57
|
-
"target": "...",
|
|
58
63
|
"module": "...",
|
|
59
64
|
"moduleResolution": "..."
|
|
60
65
|
}
|
package/base.json
CHANGED
package/bundler.json
CHANGED
package/node.json
CHANGED