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

fix: remove TSDeclareFunction from ExportDefaultDeclaration #14591

Merged

Conversation

JLHwung
Copy link
Contributor

@JLHwung JLHwung commented May 25, 2022

Q                       A
Fixed Issues? ExportDefaultDeclaration incorrectly accept TSDeclareFunction as declaration
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

Unlike export declare function f(), export default declare function f() is not valid TS and therefore we should remove it from ExportDefaultDeclaration.

Babel parser throws on export default declare function f(), too.

@babel-bot
Copy link
Collaborator

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

@nicolo-ribaudo nicolo-ribaudo added PR: Spec Compliance 👓 A type of pull request used for our changelog categories area: typescript labels May 25, 2022
@nicolo-ribaudo
Copy link
Member

Did we also support this in the parser?

@JLHwung JLHwung marked this pull request as ready for review May 25, 2022 17:43
@JLHwung
Copy link
Contributor Author

JLHwung commented May 25, 2022

Did we also support this in the parser?

No. Tested on Babel parser 7.13 and it throws "Missing semicolon (1:22)" after declare.

@JLHwung
Copy link
Contributor Author

JLHwung commented May 26, 2022

CI error is not related.

@JLHwung JLHwung merged commit 5f9c532 into babel:main May 26, 2022
@JLHwung JLHwung deleted the remove-tsdeclarefunction-from-export-default branch May 26, 2022 13:27
@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 Aug 26, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: typescript outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Spec Compliance 👓 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants