swc doesn't do type checking, so while useful in some cases it's not really a replacement for tsc.
Does node do static type checking?
Re:Why Tcl?
by a_wild_dandan on Wednesday June 21, 2023 @11:01AM
(#36419362)
Nope! `node` is just a binary that executes JS code (e.g. the above code, mod a few syntax choice tweaks). Since JS has no static types, `node` has no types to check.
Other languages can be compiled (perhaps "transpiled") to JS, some of which have static type mechanisms. One of those other languages, TypeScript, has static types. There are tools to compile TypeScript into JS: `swc`, `tsc`, etc. There are also tools to statically type check TypeScript (`deno`, `tsc`, etc).
Personally, I use `swc` for speedy TS compilation. I use my IDE's `tsc` language server for the separate job of highlighting type issues. But everyone has their preferred workflow!
It sucks that your compiler's slow! Check out `swc` if you prefer speedy compilation.