-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
--noEmit hides 'declaration' related errors #37769
Comments
What part of your build pipeline is actually producing |
|
@RyanCavanaugh Well ideally, all of the packages I build with tsc will emit js and .d.ts files. For distribution to npm. @sheetalkamat I'm interpreting noEmit as a dry run... in my use case I just want to check my code for type errors with the same build configuration that I will use in the actual build. |
Declaration emit errors are produced as part of producing declaration files themselves; basically you only see declaration emit errors iff declaration files are being made. This is the intended behavior since some code is fine when it's not making a .d.ts but needs extra annotations or local aliases to make a valid .d.ts. We could take a separate suggestion for some mode to "act as if" we're generating these files, but there'd need to be some compelling scenario for it since this generally don't seem to be something people need. |
This issue has been marked as 'Question' and has seen no recent activity. It has been automatically closed for house-keeping purposes. If you're still waiting on a response, questions are usually better suited to stackoverflow. |
TypeScript Version: 3.8.3
Search Terms:
noEmit, declaration
Code
Expected behavior:
My tsconfig contains
compilerOptions.declaration: true
.When I run tsc, the above code (correctly) emits compile time error:
I would expect running tsc with --noEmit would return the same errors, since all other configuration options are identical, we just want to skip producing our outputs. This is a common use case for tasks that watch for ts compile-time errors.
Actual behavior:
When I run it tsc with
--noEmit
, these errors are now hidden.Practical impact of this is that I have vscode reporting errors inline that my project-wide error watcher does not pick up.
This causes me anxiety.
Playground Link:
N/A
Related Issues:
#30355
This case demonstrates that the error should be occurring whenever
declaration: true
... this leads me to believe that the error being hidden whennoEmit: true
is an unintended side effect.The text was updated successfully, but these errors were encountered: