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

Feature request: respect 'noEmitOnError' #29

Open
almostintuitive opened this issue Sep 22, 2017 · 3 comments
Open

Feature request: respect 'noEmitOnError' #29

almostintuitive opened this issue Sep 22, 2017 · 3 comments

Comments

@almostintuitive
Copy link

Hi,

It's super nice to see this happening!

noEmitOnError is the one of the main reasons we're using TypeScript.
It'd be great if the packager would fail the build if there's a type error - that's currently the expected way according to everyone who's working on this project.

We'd be happy to even submit a PR for this. Will/would it be accepted?

Thank you!

@ds300
Copy link
Owner

ds300 commented Sep 22, 2017

This was already discussed in #15

I would very much like to be able to provide this as an option. If you can overcome the following problems I'd gladly accept a PR for the feature:

  • How to configure react-native-typescript-transformer to enable/disable this feature (I think it should be opt-in)
  • How to make sure that if you change file A and it creates a type error in file B which didn't change, that the error is reported properly.

@almostintuitive
Copy link
Author

almostintuitive commented Sep 26, 2017

  • I think "noEmitOnError" would be a great option, that's already a valid compiler flag

  • This may be solved by the way this will be implemented anyway. AFAIK, we won't be able to use .transpileModule, since that method does not report type errors/warnings.
    So far, my conclusion is that because of the differences between the behaviour of tsc and transpileModule, we'll need to run tsc in some way, and then collect the compiled module, rather than calling methods on the public API. is this also your understanding?

For reference, there are quite a few issues on the TS repo documenting the difference between tsx and transpileModule
microsoft/TypeScript#4864

@henrikra
Copy link

I think the workaround for this problem which is here #15 (comment) should be mentioned in README etc because this prevents developer to commit shit to the code base :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants