Skip to content

Commit b1e2d88

Browse files
committed
Add TypeScript config that checks module resolution
- `compilerOptions.skipLibCheck` is set to `true` to get around Vite issues. See vitejs/vite#11552 for details. - `exclude` is set to `["src/**/*.spec.ts", "src/**/*.spec.tsx"]` to get around @testing-library/user-event issues. See https://github.com/testing-library/react-testing-library/issues/1224 for details.
1 parent 225086b commit b1e2d88

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"prettier": "yarn workspaces foreach run prettier",
1717
"test": "yarn workspaces foreach run test",
1818
"tsc": "yarn workspaces foreach run tsc",
19+
"tsc:node16": "yarn workspaces foreach run tsc:node16",
1920
"unit": "yarn workspaces foreach run unit"
2021
},
2122
"devDependencies": {

package/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@
2121
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
2222
"prepack": "yarn clean && yarn build",
2323
"prettier": "prettier --check . --cache",
24-
"test": "yarn lint && yarn tsc && yarn prettier && yarn unit",
24+
"test": "yarn lint && yarn tsc && yarn tsc:node16 && yarn prettier && yarn unit",
2525
"tsc": "tsc --noEmit",
26+
"tsc:node16": "tsc --project tsconfig.node16.json --noEmit",
2627
"unit": "vitest",
2728
"watch": "yarn build-esm --watch & yarn build-cjs --watch & yarn build-cjs-package"
2829
},

package/tsconfig.node16.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"moduleResolution": "node16",
5+
"skipLibCheck": true
6+
},
7+
"exclude": ["src/**/*.spec.ts", "src/**/*.spec.tsx"]
8+
}

0 commit comments

Comments
 (0)