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
Dont remove export interface
, instead rename it to something else.
#830
Comments
Can't you just import types explicitly as types |
that's not what this issue is about. Sucrase seems to break any code that exports interfaces when converting any typescript code to javascript. In order to not break any compability issues, my suggestion posted above is the only solution. Your suggestion doesn't make sense because sucrase's point is to make stuff work, without needing much changes, nor break anything up. |
@alangpierce could you please look at this issue asap? |
Hi @renhiyama, unfortunately your suggestion of The typical way to avoid the error you're seeing is to ensure that the code is removed on the
Happy to reconsider if I'm overlooking a case where TypeScript (or another tool) emits a |
Due to how Sucrase can't read other related files, it cant remove import statements that imports the interfaces.
So sucrase seems to only remove the exported variable completely, while not removing the imports, hence breaking the code.
The simplest and easiest suggestion I can give is to rename the
export interface <var> {...}
to something like toexport const <var> = 0;
So it doesn't break anything while removing typescript code as expected.The text was updated successfully, but these errors were encountered: