react-native-typescript-transformer icon indicating copy to clipboard operation
react-native-typescript-transformer copied to clipboard

Feature request: respect 'noEmitOnError'

Open almostintuitive opened this issue 6 years ago • 3 comments

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!

almostintuitive avatar Sep 22 '17 12:09 almostintuitive

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.

ds300 avatar Sep 22 '17 13:09 ds300

  • 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 https://github.com/Microsoft/TypeScript/issues/4864

almostintuitive avatar Sep 26 '17 12:09 almostintuitive

I think the workaround for this problem which is here https://github.com/ds300/react-native-typescript-transformer/issues/15#issuecomment-331355513 should be mentioned in README etc because this prevents developer to commit shit to the code base :D

henrikra avatar Jan 30 '18 12:01 henrikra