Open simonhoss opened 6 years ago
So if I get compile error does it show red screen on my app or something?
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?!
Can you show Gif/video of the this feature?
@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).
I found a solution and made a PR for this (on top of the changes of @simonhoss -> https://github.com/simonhoss/react-native-typescript-transformer/pull/1). If you guys can provide some feedback that would be great!
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