You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before: CI ran lint, test, and build on affected projects, but never ran TypeScript type checking. Type errors that didn't break the build (e.g. in spec files or in code paths not exercised by tests) could slip through and only surface later.
After: CI also runs nx affected -t typecheck on every pull request, gating merges on a clean type check across affected projects. It uses the same --parallel and --base/--head PR-SHA inputs as the existing affected steps.
How: Adds a Typecheck step to .github/workflows/ci.yaml, placed after Lint (both are static-analysis gates). The typecheck target already exists in the workspace — it is inferred by the @nx/js/typescript and @nx/vite plugins in nx.json (typecheckTargetName: "typecheck"), so no per-project config is needed. The step mirrors the structure of the surrounding Lint/Test/Build steps exactly.
Not run locally beyond confirming the typecheck target resolves for workspace projects; the step will execute on CI.
Test: wstrzyknąłem czysty błąd typu (nie składniowy) do packages/utils/src/lib/addPrefix.ts:
const_typeErrorProbe: number="this is a string not a number"
nx run @leancodepl/utils:build:
[vite:dts] ... src/lib/addPrefix.ts:19:9 - error TS2322: Type 'string' is not assignable to type 'number'.
✓ built in 1.48s
NX Successfully ran target build ... (exit 0)
Czyli vite-plugin-dts (v4.5.4, skonfigurowany z tsconfigPath: tsconfig.lib.json) wypisuje diagnostykę TS jako log, ale build i tak kończy się sukcesem (exit 0) i emituje dist/. Domyślnie nie przerywa builda na błędach typów.
nx run @leancodepl/utils:typecheck:
src/lib/addPrefix.ts(19,9): error TS2322: Type 'string' is not assignable to type 'number'.
NX Running target typecheck ... failed (exit 1)
typecheckłapie błąd i kończy się niezerowym kodem.
Wniosek: build transpiluje/emituje nawet przy błędach typów (tylko je loguje), więc osobna bramka typecheck realnie dokłada pokrycie — szczególnie dla błędów w ścieżkach nieuruchamianych przez testy oraz w plikach spec, które build w ogóle pomija (tsconfig.lib.json wyklucza *.spec.*/*.test.*). PR ma sens, można mergować.
Zmiana testowa była tylko lokalna i została cofnięta.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Sebastian Konowrocki · Slack thread
Before: CI ran lint, test, and build on affected projects, but never ran TypeScript type checking. Type errors that didn't break the build (e.g. in spec files or in code paths not exercised by tests) could slip through and only surface later.
After: CI also runs
nx affected -t typecheckon every pull request, gating merges on a clean type check across affected projects. It uses the same--paralleland--base/--headPR-SHA inputs as the existing affected steps.How: Adds a
Typecheckstep to.github/workflows/ci.yaml, placed afterLint(both are static-analysis gates). Thetypechecktarget already exists in the workspace — it is inferred by the@nx/js/typescriptand@nx/viteplugins innx.json(typecheckTargetName: "typecheck"), so no per-project config is needed. The step mirrors the structure of the surroundingLint/Test/Buildsteps exactly.Not run locally beyond confirming the
typechecktarget resolves for workspace projects; the step will execute on CI.Generated by Claude Code