Closed mathieutu closed 2 years ago
Hum actually --strict
seems to not work with build
at all. Investigating on that.
And for the emitDeclarationOnly
, we can add --emitDeclarationOnly false
About putting ...process.argv.slice(2)
first makes more sense and I think it would solve the issue with first command line argument
.
I believe that noEmit
option makes the plugin run a bit faster (if noEmit
is set to false in tsconfig), because we don't really need the file output and we only care about errors
The idea about cache is really great and it would actually speed up the process of tsc-scrict
by 50%. I found the --listFiles
option for the tsc
and we would actually need to run tsc
once and the difference between tsc-strict
and tsc
would be negligible. I'll make a PR for it.
Thanks for investigating
Btw. 13000 ts files is hell a lot :D
And about the noEmit
flag I'm wondering what to do. Initially I've added the noEmit
flag, because some project use babel to compile their projects and they don't have noEmit
flag in their tsconfig
. Without this flag running tsconfig
would generate bunch of js
files unnecessarily (default is false
). So we have three options:
noEmit
resulting in scenario abovetsconfig
provided by youtsconfig
and find if emitDeclarationOnly
is present and don't add noEmit
when it isI think option 3 would be the best in this case, but I'm worring that there would be more cases like that with different flags. What do you think?
Actually I think that we can leave the noEmit like this, and let devs add --emitDeclarationOnly false
if they need.
Also, I found out that the build option is not compatible with any config via console option (including strict), so no need to move anything.
Thanks for the cache thing!
13000 ts files
yep, and it's only the front 😅
Hi,
Because
tsc-strict
ends up to runtsc --strict --noEmit ...process.argv.slice(2)
:it's not compatible with --build option:
it's not compatible with
emitDeclarationOnly
option:Maybe passing the process.argv before strict could be enough for the build option, but I don't know if the noEmit option is really required.
Also, for the record, I've a project with 13106 ts files, and tsc-strict is very longer than tsc (mainly because of the Looking for strict files step). Maybe a cache could be considered?
I'm ready to do the PR when we agree on what to do.
Thanks for your package!