-
-
Notifications
You must be signed in to change notification settings - Fork 75
Breaking: Change how interface node gets converted (fixes #201) #241
Conversation
LGTM |
interface B<C, D> { }
interface A extends B<string, number> { } Never mind, it's covered by |
I should change my tests to use extends. I thought interfaces implement other interfaces, but that's a mistake. Maybe change the nose type to TSInterafceExtends? |
@@ -0,0 +1,3 @@ | |||
interface Foo implements Bar { |
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.
It's not a parse error, but this is invalid TypeScript
Interface declaration cannot have 'implements' clause.
@@ -0,0 +1,3 @@ | |||
interface Foo<T> implements Bar<J> { |
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.
See comment about this being invalid TypeScript
When this is updated to use extends, we could go for |
On the whole, I definitely like the change, we may even want to look at refactoring the body in a future PR. Flow uses |
Can't. Unlike a class, an interface can extend many other interfaces or classes. |
How about Then we could even capture the semantically invalid |
I'd be fine with using heritage. I'll also change the heritage node to TSInterfaceExtends but it could be TSInterfaceHeritage. |
d2d5935
to
b6302c4
Compare
LGTM |
@JamesHenry I changed implements property to heritage.Also changed the node type to TSInterfaceHeritage |
This commit create an TSInterfaceDeclration and TSInterfaceBody node when converting typescript interface
b6302c4
to
59bbd0d
Compare
LGTM |
LGTM 👍 |
This commit create an TSInterfaceDeclration and TSInterfaceBody node when converting typescript interface