I tested this on a big project with mixed ts and js and I encountered some errors.
I had a cjs module doing module.exports = { foo } and the ts module importing it without errors using import { foo } from './my-cjs-module'.
After conversion the ts import wasn't working anymore, this is the reason for this PR.
I also took the time to improve the dev experience with unit tests by removing some manual/duplicate code.
Summary:
module.exports = { foo, bar } should be exported as export { foo, bar }
I tested this on a big project with mixed ts and js and I encountered some errors. I had a cjs module doing
module.exports = { foo }
and the ts module importing it without errors usingimport { foo } from './my-cjs-module'
. After conversion the ts import wasn't working anymore, this is the reason for this PR. I also took the time to improve the dev experience with unit tests by removing some manual/duplicate code.Summary:
module.exports = { foo, bar }
should be exported asexport { foo, bar }