Rules Hub
Code Ruleset
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
A passing test run doesn't prove the code type-checks
Test runners (Vitest/Jest via esbuild/swc) transpile by stripping types without checking them, so a green test suite can hide type errors. Run the project's typecheck (tsc) separately before treating a change as done.
Bad example
| 1 | pnpm test # green -> assume the change is safe to push |
Explanation (EN)
Transpilation can run tests successfully while declarations and caller types remain invalid.
Objašnjenje (HR)
Good example
| 1 | pnpm test && pnpm run typecheck # tsc actually validates the types |
Explanation (EN)
Objašnjenje (HR)
Notes (EN)
When a test runner transpiles TypeScript without checking it, run the existing project type-check command separately on the changed state.
Exceptions / Tradeoffs (EN)
Reuse a passing integrated type-check from the same inputs; do not invent a typecheck script or add unrelated hooks.