-
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
base: 10-06-chore-consolidate-migrations-and-finalize
Are you sure you want to change the base?
fix: typecheck tests using strict tsc mode #231
Conversation
|
cat > "$TEMP_CONFIG" <<EOF | ||
{ | ||
"extends": "./tsconfig.typecheck.json", | ||
"include": ["$file"] | ||
} | ||
EOF |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The JSON file path in the include
array isn't properly escaped, which could cause syntax errors if the file path contains special characters like spaces or quotes. Consider using a JSON-aware tool like jq
to generate valid JSON:
cat > "$TEMP_CONFIG" <<EOF
{
"extends": "./tsconfig.typecheck.json",
"include": [$(echo "$file" | jq -R .)]
}
EOF
Alternatively, if jq
isn't available, escape backslashes and quotes in the path:
ESCAPED_PATH=$(echo "$file" | sed 's/\\/\\\\/g' | sed 's/"/\\"/g')
cat > "$TEMP_CONFIG" <<EOF
{
"extends": "./tsconfig.typecheck.json",
"include": ["$ESCAPED_PATH"]
}
EOF
cat > "$TEMP_CONFIG" <<EOF | |
{ | |
"extends": "./tsconfig.typecheck.json", | |
"include": ["$file"] | |
} | |
EOF | |
cat > "$TEMP_CONFIG" <<EOF | |
{ | |
"extends": "./tsconfig.typecheck.json", | |
"include": [$(echo "$file" | jq -R .)] | |
} | |
EOF |
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
|
Command | Status | Duration | Result |
---|---|---|---|
nx affected -t lint typecheck test --parallel -... |
❌ Failed | 6m 42s | View ↗ |
☁️ Nx Cloud last updated this comment at 2025-10-06 18:57:53
UTC
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.