tsc-strict does not work with emitDeclarationOnly and build option.
See original GitHub issueHi,
Because tsc-strict
ends up to run tsc --strict --noEmit ...process.argv.slice(2)
:
- it’s not compatible with --build option:
tsc-strict -b apps/fr-app/tsconfig.json
🎯 Found 10794 strict files
⠸ Compiling with strict mode...💥 Typescript did not compile due to some errors. Errors: [
"error TS6369: Option '--build' must be the first command line argument."
- it’s not compatible with
emitDeclarationOnly
option:
λ › tsc-strict
🎯 Found 10794 strict files
⠴ Compiling with strict mode...💥 Typescript did not compile due to some errors. Errors: [
"error TS5053: Option 'emitDeclarationOnly' cannot be specified with option 'noEmit'."
]
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!
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
Flag --emitDeclarationOnly not working with tsc --build · ...
I want to watch over the project and just emit declarations files and no JS. --emitDeclarationOnly is mentioned as compiler options in the...
Read more >emitDeclarationOnly - TSConfig Option
TSConfig. emitDeclarationOnly ... An overview of building a TypeScript web app. TSConfig Options. All the configuration options for a project.
Read more >why declaration can not be used together with ...
The reason is for the same reason you can't use const enums in isolated modules: type information. Since isolated modules compiles each file ......
Read more >Compiler Options in MSBuild
Compiler Option MSBuild Property Name Allowed Values
‑‑allowJs Not supported in MSBuild
‑‑allowSyntheticDefaultImports TypeScriptAllowSyntheticDefaultImports boolean
‑‑allowUnreachableCode TypeScriptAllowUnreachableCode boolean
Read more >TypeScript library tips: Rollup your types! | by Martin Hochel
NOTE: this article will not go through how to configure Rollup or how it works in detail. Rollup.js helps us bundle our library...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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!
yep, and it’s only the front 😅
And about the
noEmit
flag I’m wondering what to do. Initially I’ve added thenoEmit
flag, because some project use babel to compile their projects and they don’t havenoEmit
flag in theirtsconfig
. Without this flag runningtsconfig
would generate bunch ofjs
files unnecessarily (default isfalse
). So we have three options:noEmit
resulting in scenario abovetsconfig
provided by youtsconfig
and find ifemitDeclarationOnly
is present and don’t addnoEmit
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?