-
Notifications
You must be signed in to change notification settings - Fork 557
Description
See #275 (comment).
Our tsconfig.json sets both esModuleInterop
and allowSyntheticDefaultImports
to true.
If users of this library don't set allowSyntheticDefaultImports
to true they'll get compile errors. If we want to catch these compile errors in CI we need to disable both esModuleInterop
(because it forces allowSyntheticDefaultImports
) and allowSyntheticDefaultImports
.
If we disable esModuleInterop
, tsc
will generate broken .js code when using default imports (import foo from 'foo'
) on CommonJS modules (that don't have declarations). When importing such modules, you must explicitly use the CommonJS-style import (import foo = require('foo')
).
Another option is to require users of this library to set allowSyntheticDefaultImports
to true in their project.