You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We recently upgraded our Typescript to make use of optional chaining and null coalescing, our setup works fine to generate the end-user script but we're having problems with wallaby.
In our toolchain, we use typescript with the ESNEXT target, meaning that typescript itself won't transpile optional chaining and null coalescing. We then feed typescript's output into Babel, to transpile everything with a specific config (with optional chaining and null coalescing plugins). As I said, this whole process works outside of wallaby.
We used to use Babel in our wallaby.js as a pre-processor, but that doesnt work anymore since from what I understand, wallaby fails at the instrumentalization phase (before pre-processing)
When I tried to use Babel as a compiler after typescript, but it doesnt seem to do anyting.
I attached a minimalist version of our config to reproduce our situation.
Thanks for reporting the issue and for the sample. While different to your production build, a quick fix for you to use with Wallaby should be to change your Wallaby compilers override to override the TypeScript target from esnext to es2017 (see below). Is there any reason this won't work for you? In the meantime, we'll looks at updating Wallaby to support the optional chaining operator to support this scenario.
...
compilers: {'test/**/*.ts': w.compilers.typeScript({target: 'es2017',orderFilesByReferenceComments: false,noImplicitAny: false}),'src/**/*.ts': w.compilers.typeScript({target: 'es2017',orderFilesByReferenceComments: true,noImplicitAny: false}),/* doesn't transpile ?? and ?., but this exact babel config does it outside of wallaby */'src/**/*.js': w.compilers.babel(babelCfg),},
...
Issue description or question
We recently upgraded our Typescript to make use of optional chaining and null coalescing, our setup works fine to generate the end-user script but we're having problems with wallaby.
In our toolchain, we use typescript with the ESNEXT target, meaning that typescript itself won't transpile optional chaining and null coalescing. We then feed typescript's output into Babel, to transpile everything with a specific config (with optional chaining and null coalescing plugins). As I said, this whole process works outside of wallaby.
We used to use Babel in our wallaby.js as a pre-processor, but that doesnt work anymore since from what I understand, wallaby fails at the instrumentalization phase (before pre-processing)
When I tried to use Babel as a compiler after typescript, but it doesnt seem to do anyting.
I attached a minimalist version of our config to reproduce our situation.
Thanks for all the great work and software!
wallaby-typescript-babel.zip
The text was updated successfully, but these errors were encountered: