-
Notifications
You must be signed in to change notification settings - Fork 12.8k
noEmit should be allowed with outDir #7397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Have you considered using |
Yes. I don't want syntax checker to write files whether there are errors or not. |
I am not sure i understood this statement. what is the "syntax checker" here? and who is writing the files? is it tsc? or some other tool? when do you want them to be written? and when not? |
Let's assume I'm the syntax checker, I'm the builder and there are no tools involved. To compile, I just run In addition, I want to see if there are any errors or not, without writing anything to the disk. So I run Obviously there are workarounds for this simple example. I can omit outDir from tsconfig.json, run It feels intuitively better for |
I do not disagree with the original suggestion; I am just wondering why run the compiler twice on the same set of sources? |
@mhegazy I can't answer for the others, but for me this is because I might want to check from the command line that everything is good, but I in fact never use the output I create by running tsc; the actual work happens from (for example in some projects) webpack. if I'm running a commandline check that all is well, there's no point in admitting output in any case, because it's going to get ignored anyway and recompiled when webpack run the TS compiler. You might wonder, why ever bother to compile from the command line, since I'm using a different tool to run the compiler for actual output anyway? Probably the same answer as Anil: for a reason, I occasionally want to check from the command line that I have a clean compile. |
Another use case is for vim-syntastic. It's a linter tool for vim and supports multiple languages. It uses tsc for typescript by default. It's not supposed to compile and write files so it currently uses |
Thanks for the details. PRs are welcomed. The change will be to remove the error check, do not think anything else is required. |
…options combined.
…options combined.
Fix #7397: Remove error checks for noEmit and out* compiler options combined.
And possibly with other
out
variations. Ideally,noEmit
should have priority over output related options.Reasoning: I have a syntax checking script that should not actually write files. My build script relies on
tsconfig.json
which hasoutDir
compiler option set.Syntax check command:
Build command:
tsconfig.json
Error:
error TS5053: Option 'noEmit' cannot be specified with option 'outDir'.
The text was updated successfully, but these errors were encountered: