Skip to content

Commit

Permalink
Add TypeScript config that checks module resolution
Browse files Browse the repository at this point in the history
- `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.
  • Loading branch information
wojtekmaj committed Jul 12, 2023
1 parent b5941d0 commit 243c566
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -21,8 +21,9 @@
"postinstall": "husky install",
"prepack": "yarn clean && yarn build",
"prettier": "prettier --check . --cache",
"test": "yarn lint && yarn tsc && yarn prettier && yarn unit",
"test": "yarn lint && yarn tsc && yarn tsc:node16 && yarn prettier && yarn unit",
"tsc": "tsc --noEmit",
"tsc:node16": "tsc --project tsconfig.node16.json --noEmit",
"unit": "vitest"
},
"keywords": [
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
@@ -1,6 +1,6 @@
import AsyncButton from './AsyncButton.js';
import AsyncButton from './AsyncButton';

export type { AsyncButtonProps } from './AsyncButton.js';
export type { AsyncButtonProps } from './AsyncButton';

export { AsyncButton };

Expand Down
8 changes: 8 additions & 0 deletions tsconfig.node16.json
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"moduleResolution": "node16",
"skipLibCheck": true
},
"exclude": ["src/**/*.spec.ts", "src/**/*.spec.tsx"]
}

0 comments on commit 243c566

Please sign in to comment.