Skip to content

Conversation

JLHwung
Copy link
Contributor

@JLHwung JLHwung commented Mar 31, 2025

Q                       A
Fixed Issues?
Patch: Bug Fix?
Major: Breaking Change? Yes
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link babel/website#3075
Any Dependency Changes?
License MIT

This PR is sprung off from #17163. Here we applied more constraints on variable declarator validations in Babel 8.

@JLHwung JLHwung added PR: Breaking Change 💥 A type of pull request used for our changelog categories for next major release PR: Needs Docs labels Mar 31, 2025
@babel-bot
Copy link
Collaborator

babel-bot commented Mar 31, 2025

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

@nicolo-ribaudo
Copy link
Member

Does this play well with TypeScript's declare const a: number;?

@JLHwung
Copy link
Contributor Author

JLHwung commented Mar 31, 2025

Does this play well with TypeScript's declare const a: number;?

Good catch. Currently no. The VariableDeclaration does not accept declare as a builder parameter as builders generally don't take typescript parameters into account, so we should either: 1) accept declare as a builder parameter and respect that in the validator or 2) remove Identifier from the withoutInit validtor.

Co-authored-by: Nicolò Ribaudo <hello@nicr.dev>
@JLHwung
Copy link
Contributor Author

JLHwung commented Apr 2, 2025

Docs PR is ready: babel/website#3075 PTAL

@JLHwung JLHwung merged commit 4d39e9d into babel:main Apr 2, 2025
55 checks passed
@JLHwung JLHwung deleted the harden-variable-declarator-validations branch April 2, 2025 18:43
@JLHwung JLHwung mentioned this pull request Apr 16, 2025
@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 3, 2025
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 3, 2025
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 PR: Breaking Change 💥 A type of pull request used for our changelog categories for next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants