-
Notifications
You must be signed in to change notification settings - Fork 13
fix: typecheck tests using strict tsc mode #231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: typecheck tests using strict tsc mode #231
Conversation
|
View your CI Pipeline Execution ↗ for commit 09fe21a
☁️ Nx Cloud last updated this comment at |
f18b09a
to
569aad4
Compare
569aad4
to
09fe21a
Compare
🔍 Preview Deployment: Website✅ Deployment successful! 🔗 Preview URL: https://pr-231.pgflow.pages.dev 📝 Details:
_Last updated: _ |
🔍 Preview Deployment: Playground✅ Deployment successful! 🔗 Preview URL: https://pr-231--pgflow-demo.netlify.app 📝 Details:
_Last updated: _ |
Merge activity
|
### TL;DR Improved TypeScript type checking with stricter validation and fixed map return type inference in the Flow DSL. ### What changed? - Added a new `typecheck-strict.sh` script that performs two-pass type checking: 1. Project-wide type check 2. Individual file checks to catch unused `@ts-expect-error` directives - Updated project.json files to use the new script for type checking - Made `test:types` a dependency of the main `test` target in multiple packages - Fixed type inference issues in the Flow DSL's map method by using `AwaitedReturn<THandler>[]` instead of `any[]` - Added new type tests in `map-return-type-inference.test-d.ts` to verify proper type inference - Cleaned up and improved existing type tests ### How to test? 1. Run the type checking with the new script: ```bash ./scripts/typecheck-strict.sh ``` 2. Run the type tests to verify the fixed map return type inference: ```bash pnpm nx test:types dsl ``` 3. Verify that the main test command now includes type checking: ```bash pnpm nx test dsl pnpm nx test client pnpm nx test core ``` ### Why make this change? The Flow DSL had a type inference bug where map step return types were incorrectly inferred as `any[]` instead of preserving the specific return type structure. This made it difficult to catch type errors in subsequent steps that used the map output. The new strict type checking process also helps catch unused `@ts-expect-error` directives, which can hide real type errors when they're no longer needed.
TL;DR
Improved TypeScript type checking with stricter validation and fixed map return type inference in the Flow DSL.
What changed?
typecheck-strict.sh
script that performs two-pass type checking:@ts-expect-error
directivestest:types
a dependency of the maintest
target in multiple packagesAwaitedReturn<THandler>[]
instead ofany[]
map-return-type-inference.test-d.ts
to verify proper type inferenceHow to test?
Run the type checking with the new script:
Run the type tests to verify the fixed map return type inference:
Verify that the main test command now includes type checking:
Why make this change?
The Flow DSL had a type inference bug where map step return types were incorrectly inferred as
any[]
instead of preserving the specific return type structure. This made it difficult to catch type errors in subsequent steps that used the map output. The new strict type checking process also helps catch unused@ts-expect-error
directives, which can hide real type errors when they're no longer needed.