Add variable declarator validation changelog#3075
Merged
JLHwung merged 2 commits intobabel:mainfrom Apr 3, 2025
Merged
Conversation
✅ Deploy Preview for babel-next ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for babel ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
liuxingbaoyu
reviewed
Apr 2, 2025
|
|
||
| __Migration__: Call `t.identifier` with a valid name. | ||
|
|
||
| - Reject invalid variable declarator in `t.variableDeclaration` builder ([#10917](https://github.com/babel/babel/pull/10917), [#17217](https://github.com/babel/babel/pull/17217)) |
Member
There was a problem hiding this comment.
#10917 was copied accidentally?
Contributor
Author
There was a problem hiding this comment.
Nope. It is intentional. This feature was first introduced in #10917: https://github.com/babel/babel/pull/10917/files#diff-64d1d669cf9d0cd3344a526b186c9f7496ac14237a47573926ea505c4bcc8df3R1024
liuxingbaoyu
reviewed
Apr 2, 2025
Comment on lines
+949
to
+952
| // highlight-error-next-line | ||
| t.variableDeclaration("var", [ | ||
| t.variableDeclarator(t.arrayPattern([t.identifier("x")])) | ||
| ]); |
Member
There was a problem hiding this comment.
Maybe highlight these three lines?
Contributor
Author
There was a problem hiding this comment.
Currently we don't have highlight-error block. I will see if I can add it.
Member
There was a problem hiding this comment.
We can also copy the comment three times. :)
nicolo-ribaudo
approved these changes
Apr 3, 2025
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Docs PR for babel/babel#17217