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: preserve function params type if possible #14694

Merged
merged 2 commits into from Jun 27, 2022

Conversation

magic-akari
Copy link
Contributor

@magic-akari magic-akari commented Jun 26, 2022

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

@liuxingbaoyu liuxingbaoyu added PR: Bug Fix 🐛 area: typescript labels Jun 26, 2022
Copy link
Member

@nicolo-ribaudo nicolo-ribaudo left a comment

I dislike hard-coding TS/Flow AST info in "plain JS" plugins, but until we have something like #9545 this is the best we can do.

@nicolo-ribaudo
Copy link
Member

nicolo-ribaudo commented Jun 26, 2022

Can you also add a test for function point({ x, y }: Point = {})?

@magic-akari
Copy link
Contributor Author

magic-akari commented Jun 27, 2022

Can you also add a test for function point({ x, y }: Point = {})?

Sure. I dont' think there is anything to do if the function parameter doesn't exist.
Or should we add a param placeholder? not a good idea.

@magic-akari
Copy link
Contributor Author

magic-akari commented Jun 27, 2022

Since the function param with default value does not count in function length, we should never add param placeholder for it.

@nicolo-ribaudo
Copy link
Member

nicolo-ribaudo commented Jun 27, 2022

Oh right, I don't know what I was thinking

@nicolo-ribaudo nicolo-ribaudo merged commit 767c7b4 into babel:main Jun 27, 2022
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: typescript PR: Bug Fix 🐛
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants