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

Handle typescript function overloading in a default export #13605

Merged
merged 2 commits into from Aug 3, 2021

Conversation

tony-go
Copy link
Contributor

@tony-go tony-go commented Jul 27, 2021

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

@tony-go
Copy link
Contributor Author

tony-go commented Jul 27, 2021

I always split my work, as following:

  • Add the test case which fails
  • Add the fix
  • Tag the PR as ready for review

ATM, the error I got with my test seems to be related to the issue

 FAIL  packages/babel-plugin-transform-typescript/test/index.js
  ● babel-plugin-transform-typescript/exports › default function

    TypeError: /Users/tonygorez/projects/babel/packages/babel-plugin-transform-typescript/test/fixtures/exports/default-function/input.ts: Cannot read property 'name' of null

@babel-bot
Copy link
Collaborator

babel-bot commented Jul 27, 2021

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

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jul 27, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit e49774e:

Sandbox Source
babel-repl-custom-plugin Configuration
babel-plugin-multi-config Configuration

@nicolo-ribaudo nicolo-ribaudo added area: typescript pkg: traverse (scope) PR: Bug Fix 🐛 A type of pull request used for our changelog categories labels Jul 27, 2021
@nicolo-ribaudo
Copy link
Member

Tip: in the PR description, don't just write the issue number but write "Fixes #13594": if you include the "Fixes" keyword, when this PR is merged the issue will be automatically closed.

@tony-go
Copy link
Contributor Author

tony-go commented Jul 28, 2021

The CI seems to fail somewhere (babel-old-version). Anyway, I added a check for the node.id for the isTSDeclareFunction case. But I wonder if we shouldn't make a global check... 🤔 with && ?

@tony-go tony-go marked this pull request as ready for review July 28, 2021 09:58
@tony-go
Copy link
Contributor Author

tony-go commented Aug 3, 2021

Friendly ping @JLHwung 🙌

Copy link
Contributor

@JLHwung JLHwung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@nicolo-ribaudo nicolo-ribaudo changed the title feat(plugin-transform-typescript): handle typescript function overloading in a default export Handle typescript function overloading in a default export Aug 3, 2021
@nicolo-ribaudo nicolo-ribaudo merged commit 70c66b3 into babel:main Aug 3, 2021
@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 Nov 3, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 3, 2021
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 pkg: traverse (scope) PR: Bug Fix 🐛 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: babel/traverse cannot handle typescript function overloading in a default export
5 participants