Skip to content

Commit 00a2ed4

Browse files
authored
chore: Configure TypeScript to use source files during development (#194)
Closes #174 Apparently `"moduleResolution": "Node16"` sets stricter rules on TS and VScode can't link to the sources, it needs the build files. This PR reverts the default tsconfig to `"moduleResolution": "Node"` and applies `Node16` on build. Unfortunately I've set resolution to `Node16` for `yarn test:ts` (so `skipLibCheck` works) as with the package reference working TS was asking to include the files from the other packages as well, and since it doesn't allow referencing files while ignoring them during type-checking, it will throw errors if they aren't included. Also ref: microsoft/TypeScript#40431
1 parent c1d41d2 commit 00a2ed4

File tree

8 files changed

+21
-8
lines changed

8 files changed

+21
-8
lines changed

packages/errors/tsconfig.test.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
{
22
"extends": "./tsconfig.json",
33
"compilerOptions": {
4-
"skipLibCheck": true
4+
"skipLibCheck": true,
5+
"module": "Node16",
6+
"moduleResolution": "Node16"
57
},
68
"include": ["./src"],
79
"exclude": ["./vite.config.ts", "./vitest.config.ts"]

packages/extension/tsconfig.test.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
{
22
"extends": "./tsconfig.json",
33
"compilerOptions": {
4-
"skipLibCheck": true
4+
"skipLibCheck": true,
5+
"module": "Node16",
6+
"moduleResolution": "Node16"
57
},
68
"include": ["./src", "./test", "./scripts"],
79
"exclude": ["./vite.config.ts", "./vitest.config.ts"]

packages/kernel/tsconfig.test.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
{
22
"extends": "./tsconfig.json",
33
"compilerOptions": {
4-
"skipLibCheck": true
4+
"skipLibCheck": true,
5+
"module": "Node16",
6+
"moduleResolution": "Node16"
57
},
68
"include": ["./src", "./test"],
79
"exclude": ["./vite.config.ts", "./vitest.config.ts"]

packages/shims/tsconfig.test.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
{
22
"extends": "./tsconfig.json",
33
"compilerOptions": {
4-
"skipLibCheck": true
4+
"skipLibCheck": true,
5+
"module": "Node16",
6+
"moduleResolution": "Node16"
57
},
68
"include": ["./src"],
79
"exclude": ["./vite.config.ts", "./vitest.config.ts"]

packages/streams/tsconfig.test.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
{
22
"extends": "./tsconfig.json",
33
"compilerOptions": {
4-
"skipLibCheck": true
4+
"skipLibCheck": true,
5+
"module": "Node16",
6+
"moduleResolution": "Node16"
57
},
68
"include": ["./src", "./test"],
79
"exclude": ["./vite.config.ts", "./vitest.config.ts"]

packages/utils/tsconfig.test.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
{
22
"extends": "./tsconfig.json",
33
"compilerOptions": {
4-
"skipLibCheck": true
4+
"skipLibCheck": true,
5+
"module": "Node16",
6+
"moduleResolution": "Node16"
57
},
68
"include": ["./src"],
79
"exclude": ["./vite.config.ts", "./vitest.config.ts"]

tsconfig.packages.build.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"extends": "./tsconfig.packages.json",
33
"compilerOptions": {
4+
"module": "Node16",
5+
"moduleResolution": "Node16",
46
"declaration": true,
57
"declarationMap": true,
68
"emitDeclarationOnly": true,

tsconfig.packages.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
"exactOptionalPropertyTypes": true,
55
"forceConsistentCasingInFileNames": true,
66
"lib": ["ES2022"],
7-
"module": "Node16",
8-
"moduleResolution": "Node16",
7+
"moduleResolution": "Node",
98
"noErrorTruncation": true,
109
"noUncheckedIndexedAccess": true,
1110
/**

0 commit comments

Comments
 (0)