-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
BUG? Typescript export namespace nested Multiple exports of name
#1300
Comments
I'm not familiar with how namespaces work (since that's not a concept that exists in javascript) but clearly it seems like one is a sibling of M, and one is nested under M. Do you think the rule should understand namespaces, or do you think it should ignore them? |
it will be translated to
If namespaces can be parsed as above it will be resolved. |
In that case, there's only one export - API - and all the others are just object properties. So, it seems like this plugin should ignore everything but the top-level one. |
yes, it's ok. |
@ljharb I'm experiencing this and happy to try and submit a PR to fix it. I'll start poking around the codebase anyway, but if you had any suggestions of what would need to change to enable this then that would help. Thanks! |
I guess we could add a check to Would something like this be a terrible idea? function addNamed(name, node) {
if (node.parent.type !== 'Program') return
... // rest of the code
} |
I'm not very knowledgeable on this part of the code; but it doesn't seem like skipping any top-level named export would be ideal :-) |
@ljharb that example would do the opposite, but I'm sure it'll break something else instead. Was just hoping for some pointers of how this sort of thing would usually be approached. I'll see if I can take a proper look sometime in the next week 😀 |
[fix] `export`: Support typescript namespaces Fixes #1300.
import/export
But they are not the same
User
The text was updated successfully, but these errors were encountered: