Skip to content
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

Compiler Option: noEmitOnError #91

Closed
use-strict opened this issue Oct 27, 2015 · 9 comments
Closed

Compiler Option: noEmitOnError #91

use-strict opened this issue Oct 27, 2015 · 9 comments
Labels

Comments

@use-strict
Copy link
Contributor

I'm using the noEmitOnError option in tsconfig.json and I get a bunch of Typescript emitted no output for ... errors each time there is an error in one of my TypeScript files. It propagates to dependent files and it's getting really annoying, considering TypeScript errors are already properly reported. Can we remove this error or maybe suppress it if noEmitOnError is true?

@jbrantly
Copy link
Member

I agree this needs to be looked at. If you don't mind I'm going to hijack your issue a little bit to make it part of the effort to evaluate all compiler options in detail.

Another part of this, I believe, is being able to fail a build. For example, if webpack is being run as part of a larger build process, people want to be able to get an error code out of webpack if there is a TS error so that the build fails. I think that the right way to handle that is using noEmitOnError.

@jbrantly jbrantly changed the title "Typescript emitted no output" error Compiler Option: noEmitOnError Oct 27, 2015
@use-strict
Copy link
Contributor Author

I'm probably going to work around this at the moment by removing the noEmitOnError option which is not really crucial, or I could do a regex and remove those errors from my side. I already have to process and format them in a way the IDE can understand.

@jbrantly
Copy link
Member

Out of curiosity, when you process the errors are you making use of the undocumented error information that's provided? I threw that stuff on there to help people who are processing the raw errors but I have no clue if people actually use it.

@use-strict
Copy link
Contributor Author

I will have to double-check from work, tomorrow, but most likely I am using those properties. I'm formatting all errors to match the output pattern of tsc. I also have a modified pattern configured in VSCode, which allows WEBPACK|TSLINT in place of TS#### error codes. This way the IDE maps errors/warnings coming from ts/ts-loader, tslint or webpack itself (there are also some legacy JS files in the project).

I'm also relying on some undocumented properties on the webpack error objects too, and that isn't really production quality, but it worked so far. Being able to include the tasks.json setup in the project itself also allows for a seamless build from VSCode.

@basarat
Copy link
Member

basarat commented Oct 28, 2015

Note : noEmitOnError can slow down builds as TypeScript will validate the entire project even if emitting a single file.

@use-strict
Copy link
Contributor Author

@basarat , I didn't know that. Thanks!

@jbrantly , looks like I'm using both rawMessage and location.

@stale
Copy link

stale bot commented Jan 19, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

1 similar comment
@stale
Copy link

stale bot commented Mar 20, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Mar 20, 2019
@stale
Copy link

stale bot commented Mar 27, 2019

Closing as stale. Please reopen if you'd like to work on this further.

@stale stale bot closed this as completed Mar 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants