New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: disable esModuleInterop #183
Conversation
BREAKING CHANGE: esModuleInterop causes synthetic imports to leak from libraries to their users. Users must compile with allowSyntheticImports as well if they use a library that uses this flag. This has been causing a lot of churn in libraries that use gts.
Codecov Report
@@ Coverage Diff @@
## master #183 +/- ##
=======================================
Coverage 98.15% 98.15%
=======================================
Files 12 12
Lines 652 652
Branches 55 55
=======================================
Hits 640 640
Misses 12 12
Continue to review full report at Codecov.
|
@@ -4,7 +4,6 @@ | |||
"allowUnreachableCode": false, | |||
"allowUnusedLabels": false, | |||
"declaration": true, | |||
"esModuleInterop": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to disable synthetic default imports as well? Or am I getting my compiler flag wires crossed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No.. esModuleInterop implicitly enables synthetic imports. See here: https://www.typescriptlang.org/docs/handbook/compiler-options.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We explicitly turn it on here tho: https://github.com/google/ts-style/pull/183/files#diff-19e170b73889957f2d2c69de5a7a5d7aL3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
D'oh.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BREAKING CHANGE: Similar to google#183, also disable synthetic imports.
BREAKING CHANGE: Similar to #183, also disable synthetic imports.
BREAKING CHANGE: esModuleInterop causes synthetic imports to leak from
libraries to their users. Users must compile with allowSyntheticImports
as well if they use a library that uses this flag.
This has been causing a lot of churn in libraries that use gts.