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

#29 respect noEmitOnError #75

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

simonhoss
Copy link

Hi

This is a implementation to respect the noEmitOnError config. If any problem exists (not only syntax errors) it will report the first error and stop compiling.

Please review and give me feedback.

Greets

@henrikra
Copy link

So if I get compile error does it show red screen on my app or something?

@simonhoss
Copy link
Author

It shows an error on the react-native packager, but I was not able to make a build without errors. It seems that createProgram is a bit different than tsc -p tsconfig.json or maybe my tsconfig.json is wrong?!

@henrikra
Copy link

Can you show Gif/video of the this feature?

@mvdam
Copy link

mvdam commented Aug 7, 2018

@simonhoss I was able to fix the Unexpected moduleResolution: node error by using

const moduleResolution = compilerOptions.moduleResolution === 'node'
  ? ts.ModuleResolutionKind.NodeJs
  : ts.ModuleResolutionKind.Classic

const program = ts.createProgram([filename], {
  ...compilerOptions,
  moduleResolution
})

(Source)

But after this it will throw Cannot find global type 'Array'.. It really looks like the ts.createProgram() takes a different type of compiler options then ts.transpileModule().

I will also try to find a solution for this somewhere this week because we really need this! Please let me know if you know more (already).

@mvdam
Copy link

mvdam commented Aug 8, 2018

I found a solution and made a PR for this (on top of the changes of @simonhoss -> simonhoss#1). If you guys can provide some feedback that would be great!

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

Successfully merging this pull request may close these issues.

3 participants