Open FauxFaux opened 3 years ago
v2.15.0 should fix this.
Just a note: esModuleInterop: true
is the recommended config, though the legacy mode of false
is what one gets if one leaves it out
Interesting. Maybe worth adding it to https://github.com/microsoft/TypeScript/wiki/Node-Target-Mapping too.
I think we have it turned off because of some compatibility problem with some mocking library, although who knows if that has been fixed over the last years.
Edit: Oh, and 250+ compile errors for turning it on, of course. :)
Version(if relevant): 2.14.9
I'd like to use
type-coverage-core
from our test framework in node. Unfortunately, the import style used in the project is incompatible with the recommended node tsconfig, targetingcommonjs
withoutesModuleInterop
. A script which usestype-coverage-core
causes the whole project's build to fail, as:This can't be ignored with ts-expect-error, but can be worked around with dynamic requires.
It isn't as simple as switching it to the commonjs compatible (but still safe) import syntax, as that's incompatible with your module target.
I humbly request that you switch to targeting commonjs, and disable esModuleInterop, to make the module easier to use from a node application, which I assume to be the most common usecase?
I'm currently working around this by not installing type-coverage-core,
// @ts-expect-error
ing the import, then installing it just to run withts-node
.npx
also fails for us, absolutely no idea why; maybe another bug report when I rule out the rest of our system.skipLibCheck
also works, if you're happy with that.