Skip to content

Commit 3daf129

Browse files
Add split typecheck scripts for build and tests (#1539)
yarn typescript did not check the tests folder before. This PR aims to resolve that. ## Summary - add `typecheck`, `typecheck:build`, and `typecheck:tests` scripts - keep build-only typechecks for Vite compile/type flows - add `tsconfig.tests.json` and update docs ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-1539-Add-split-typecheck-scripts-for-build-and-tests-2ea6d73d365081f890cfdb1a0a861fbd) by [Unito](https://www.unito.io)
1 parent 1459202 commit 3daf129

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
```bash
2626
yarn lint # Check & auto-fix ESLint issues
2727
yarn format # Auto-format code
28-
yarn typescript # TypeScript type checking
28+
yarn typecheck # TypeScript type checking (all)
2929
```
3030

3131
### Development
@@ -145,7 +145,7 @@ This project must maintain exceptionally high type standards. The `any` type mus
145145
## Before Committing
146146

147147
1. Use `yarn format` to ensure consistent formatting
148-
1. Run `yarn lint` and `yarn typescript` to check code quality
148+
1. Run `yarn lint` and `yarn typecheck` to check code quality
149149
1. Run `yarn test:unit` to ensure unit tests pass
150150
1. Consider running `yarn test:e2e` for UI changes
151151

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,12 @@
5252
"test:unit": "vitest run",
5353
"todesktop:afterPack": "./scripts/todesktop/afterPack.cjs",
5454
"todesktop:beforeInstall": "./scripts/todesktop/beforeInstall.cjs",
55-
"typescript": "tsc -p tsconfig.build.json",
55+
"typecheck": "tsc -p tsconfig.json",
56+
"typecheck:build": "tsc -p tsconfig.build.json",
57+
"typecheck:tests": "tsc -p tsconfig.tests.json",
5658
"verify:build": "node scripts/verifyBuild.js",
57-
"vite:compile": "yarn run typescript && vite build && vite build --config vite.preload.config.ts",
58-
"vite:types": "yarn run typescript && vite build --config vite.types.config.ts && node scripts/prepareTypes.js",
59+
"vite:compile": "yarn run typecheck:build && vite build && vite build --config vite.preload.config.ts",
60+
"vite:types": "yarn run typecheck:build && vite build --config vite.types.config.ts && node scripts/prepareTypes.js",
5961
"release:types": "node scripts/releaseTypes.js",
6062
"update:frontend": "node scripts/updateFrontend.js"
6163
},

tsconfig.tests.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"include": ["tests/**/*", "playwright.config.ts", "playwright.setup.ts"]
4+
}

0 commit comments

Comments
 (0)