Open jflatow opened 1 year ago
Ok interesting, I took a peek and it looks like swc
which is used in this module doesn't support type-checking, so it would have to go through an alternate path of either trying to use deno::tsc
(not sure if this is exposed) or potentially stc
. I expect it would only make sense to use the same method that deno
uses itself, which is through the deno::tsc
(https://github.com/denoland/deno/blob/main/cli/tools/check.rs#L136).
In any case, a programmatic API to perform type-checking with Deno probably wouldn't be part of deno_emit
.
And if you need to do it right now as a replacement for deno bundle
, then deno check
works.
How difficult would it be to add a compiler option to check TypeScript input code? If reasonable, I wouldn't mind taking a stab at adding it myself.