Skip to content

Always pass type argument to .startNode#16417

Merged
nicolo-ribaudo merged 1 commit intobabel:mainfrom
nicolo-ribaudo:unify-ast-definitions
Apr 7, 2024
Merged

Always pass type argument to .startNode#16417
nicolo-ribaudo merged 1 commit intobabel:mainfrom
nicolo-ribaudo:unify-ast-definitions

Conversation

@nicolo-ribaudo
Copy link
Member

Q                       A
Fixed Issues? Fixes #1, Fixes #2
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

I was working on unifying AST type definitions across @babel/parser and @babel/types, and noticed that in many places in @babel/parser variables are typed as N.Node (which is the AST equivalent of any). This PR fixes that.

I plan to eventually open a PR to, when possible, move the type string from finishNode to startNode so that the type can be inferred better.

@nicolo-ribaudo nicolo-ribaudo added PR: Internal 🏠 A type of pull request used for our changelog categories pkg: parser labels Apr 7, 2024
@babel-bot
Copy link
Collaborator

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/56704

@nicolo-ribaudo nicolo-ribaudo merged commit 08b0472 into babel:main Apr 7, 2024
@nicolo-ribaudo nicolo-ribaudo deleted the unify-ast-definitions branch April 7, 2024 18:14
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Jul 8, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: parser PR: Internal 🏠 A type of pull request used for our changelog categories

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants