Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release CLI v31.2.0 #20

Merged
merged 13 commits into from
Mar 20, 2024
Merged

Release CLI v31.2.0 #20

merged 13 commits into from
Mar 20, 2024

Conversation

timkendrick
Copy link
Contributor

No description provided.

… nodes

Currently, any nodes that are replaced by Babel transforms will lose any comments that were attached to the original node.

This is due to Babel's AST spec representing comments via `.leadingComments` / `.trailingComments` arrays, while the Recast printer assumes comments are combined into a single `.comments` array (which contains various custom AST node types used to represent the various different types of comments): benjamn/recast#159

When Recast is used to print the transformed Babel AST, for any newly-created nodes it only consults the `.comments` property, ignoring the existing `.leadingComments` / `.trailingComments` properties: https://github.com/benjamn/recast/blob/1413bdf5a34eef39f021941e7411975fe6f12d2b/lib/comments.ts#L339-L344
@timkendrick timkendrick merged commit 948c75d into main Mar 20, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant