Narzędzia

tooling/typecheck-separately

A TypeScript project runs a separate type check (tsc --noEmit, vue-tsc, svelte-check, astro check) in CI; the bundler does not.

umiarkowanaręcznefe-tooling

Dlaczego

Vite, esbuild, Rolldown, Turbopack and SWC remove types without checking them, so a build succeeds with type errors and they reach production. Editors show errors only in open files.

Poprawka

Add a typecheck script and run it in CI next to lint and tests: tsc --noEmit (or tsc -b for project references), vue-tsc --noEmit for Vue, svelte-check for Svelte, astro check for Astro, ng build for Angular. On TypeScript 7 (the native compiler, no programmatic API yet), tools that call the TypeScript API, such as type-aware typescript-eslint rules, vue-tsc and svelte-check, may need the @typescript/typescript6 compatibility package; check their documentation.

Przykłady

{ "scripts": { "typecheck": "tsc --noEmit", "lint": "eslint .", "test": "vitest run" } }

Źródła

Fakty

Identyfikator
tooling/typecheck-separately
Waga
umiarkowana
Sprawdzanie
ręczne ocenia człowiek; raport podaje to jako listę kontrolną
Dotyczy plików
project
Tylko w projektach z
typescript
Uczy jej skill
fe-tooling Build, lint and format tooling
Od wersji
0.1.0

Plik reguły na GitHubie

Przeczytaj w terminalu

npx github:dawidolko/frontend-skills explain tooling/typecheck-separately