Repository navigation
Added type-level mapping between aliases and nodes that have that alias. - #9110
Merged
nicolo-ribaudo merged 1 commit intoDec 19, 2018
Merged
Conversation
Collaborator
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/9504/ |
existentialism
approved these changes
Dec 5, 2018
Contributor
Author
|
What's the process for merging PRs? Specifically, how come this has been approved but not yet merged? |
cameron-martin
added a commit
to cameron-martin/DefinitelyTyped
that referenced
this pull request
Dec 19, 2018
This is made possible by babel/babel#9110. When the next version after v7.2.2 is released, the package.json can be updated and the build will no longer fail.
This was referenced Dec 19, 2018
Closed
Merged
7 of 9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The TypeScript types for
Visitorin@babel/traversedo not allow node aliases as properties. These cannot be added with the current contents of the auto-generated TypeScript definitions for@babel/types.Solution
If
@babel/typeshad a type-level mapping between aliases and the node types that have those aliases, e.g:Then the
Visitortype in the TypeScript definitions can be intersected with the following type:This would then allow using aliases as
Visitorproperties when using TypeScript.This PR adds such an
Aliasestype.Concerns
d.tsfiles is not set up. If tests are required then I can set this infrastructure up.$ObjMap. Can somebody confirm what the situation with flow definitions for@babel/traverseare and whether this would be a useful addition to the flow types?