-
-
Notifications
You must be signed in to change notification settings - Fork 75
fix: wrap interface in ExportNamedDeclaration if necessary (fixes #269 #270
fix: wrap interface in ExportNamedDeclaration if necessary (fixes #269 #270
Conversation
Thanks for the pull request, @despairblue! I took a look to make sure it's ready for merging and found some changes are needed:
Can you please update the pull request to address these? (More information can be found in our pull request guide.) |
713a5cc
to
b4283af
Compare
LGTM |
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.
Can you use fixExports() from nodeUtils. It will wrap the node in export and handles default case as well. Take a look at function declaration or class declaration for examples.
To check if an interface is abstract:
nodeUtils.hasModifier(SyntaxKind.AbstractKeyword, node)
Should do the trick. I think we can just have a property called abstract
.
Thanks
b4283af
to
9b1a98a
Compare
LGTM |
@soda0289 done. The diffs for the other tests are a bit bigger because I used Abstract interfaces are not valid TypeScript btw. But I think they added the test to make sure the parser can handle that, so they can output a useful error message like |
@despairblue Thanks for making the changes. If abstract interfaces are not valid typescript I'm not sure we should support them or the very least only set |
I'm happy with whatever choice you make. That said, my understanding is that this is an AST to AST converter, so it should convert the AST as accurately as possible and should not make assumptions about it's semantics as a program. But again, it's your choice, we just would need to blacklist some tests from the typescript test suite, no biggie :) |
@soda0289 @JamesHenry is there anything I can do to help this get in? I could remove the |
I'm fine with using abstract. I think we are also going to change classes to use a property |
@despairblue There will be quite a few changes coming to the AST as we try to align with the AST from the new typescript babylon plugin. You can check the issues here: |
No description provided.