-
-
Notifications
You must be signed in to change notification settings - Fork 75
Breaking: Add .body to TSModuleBlock nodes (fixes #217) #218
Conversation
Since the node is specific to typescript we should prefix it with TS. |
Thanks for the pull request, @flying-sheep! 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.) |
@Pajn Will this change mess up the prettier work that has been completed? |
d914870
to
5678034
Compare
LGTM |
OK, all done |
5678034
to
c09f76c
Compare
LGTM |
No, modules are not started yet so it's fine. Also more similarity with ESTree is nicer there as well so 👍 |
@flying-sheep Looks like a namespace can also have import statements. We should update those as well. declare namespace 'Baz' {
import {Bar} from 'bar';
} |
namespaces already convert to please check the modified test file ( |
@flying-sheep Sorry missed that. Is there a test for declared modules? I don't see any tests that failed. We should have one for declared modules to ensure we don't break anything in the future. |
c09f76c
to
e51a510
Compare
LGTM |
there’s one for shorthand declared modules (without body), so i added a full one. with import statement for good measure |
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.
Thanks! 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.
LGTM, thanks!
Seems like we have a couple of breaking changes we can look to merge now, so we should get them in together |
And another #233 😄 |
I'm pretty sure Since we have more freedom here, should we call the node |
@azz Being able to declare an ambient module name for the tsc is a useful feature for providing type information for 3rd party code. Namespace, however, cannot be used for this functionality. E.g. the difference here: And AST confirmation (see the parseDiagnostics - those are parse errors): Reference for shorthand ambient module declarations: https://github.com/Microsoft/TypeScript/wiki/What's-new-in-TypeScript#shorthand-ambient-module-declarations |
@JamesHenry I was aware of the difference, but I was not aware that |
I’ll probably have to fix some tests and don’t know if just choosing the name “ModuleBlock” is OK.