Search Terms
Suggestion
Change esModuleInterop from being an opt-in to instead be an opt-out, taking one step further towards deprecating the non-esModuleInterop mode and make esModuleInterop the only supported mode going forward (which has to be the long term goal).
Use Cases
When Typescript 2.7 introduced esModuleInterop almost 3 years ago it emphasized clearly that:
We highly recommend applying it both to new and existing projects.
esModuleInterop is also a recommended option to set in tsconfig.json and when one runs tsc --init it gets set to true automatically.
However, the fact that it still is opt-in makes that non-esModuleInterop mode is still very prevalent, which kind of works against the very problems it was meant to fix – as rather than having just the pre-esModuleInterop functionality, modules now have to try to make things work across both options – and on top of that increasingly have to work with TS-validated JS.
All in all, that causes problems: fastify/env-schema#17
And is hard to wrap ones head around: https://github.com/fox1t/modules-playground
Even if one really tries: fox1t/modules-playground#3
Checklist
My suggestion meets these guidelines:
Search Terms
Suggestion
Change
esModuleInteropfrom being an opt-in to instead be an opt-out, taking one step further towards deprecating the non-esModuleInteropmode and makeesModuleInteropthe only supported mode going forward (which has to be the long term goal).Use Cases
When Typescript 2.7 introduced
esModuleInteropalmost 3 years ago it emphasized clearly that:esModuleInteropis also a recommended option to set intsconfig.jsonand when one runstsc --initit gets set totrueautomatically.However, the fact that it still is opt-in makes that non-
esModuleInteropmode is still very prevalent, which kind of works against the very problems it was meant to fix – as rather than having just the pre-esModuleInteropfunctionality, modules now have to try to make things work across both options – and on top of that increasingly have to work with TS-validated JS.All in all, that causes problems: fastify/env-schema#17
And is hard to wrap ones head around: https://github.com/fox1t/modules-playground
Even if one really tries: fox1t/modules-playground#3
Checklist
My suggestion meets these guidelines:
esModuleInterop, but it would make it easier to get TypeScript and JavaScript code to stay compatible with one anotheresModuleInterop, but it would make it easier to get TypeScript and JavaScript code to stay compatible with one anotherDo not cause substantial breaking changes from TypeScript 1.0.