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

[BUG]: Typechecking fails for external code with exactOptionalPropertyTypes: true #461

Closed
1 task done
ammubhave opened this issue Sep 24, 2024 · 5 comments · Fixed by #462
Closed
1 task done

[BUG]: Typechecking fails for external code with exactOptionalPropertyTypes: true #461

ammubhave opened this issue Sep 24, 2024 · 5 comments · Fixed by #462
Labels
released Type: Bug Something isn't working as documented

Comments

@ammubhave
Copy link
Contributor

ammubhave commented Sep 24, 2024

What happened?

When typescript is used with the option exactOptionalPropertyTypes: true, most code that consumes this library fails to typecheck if undefined is passed in for the response value.

All optional properties must have explicit | undefined in their type definitions.

Versions

all

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@ammubhave ammubhave added Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented labels Sep 24, 2024
Copy link

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

@ammubhave ammubhave changed the title [BUG]: Typechecking fails for external code with exactOptionalProperty: true [BUG]: Typechecking fails for external code with exactOptionalPropertyTypes: true Sep 24, 2024
@wolfy1339
Copy link
Member

Are you explicitly passing undefined or defining the value at all?

It would be nice to enable this option ourselves across all Octokit repos.

@oscard0m
Copy link
Member

Are you explicitly passing undefined or defining the value at all?

It would be nice to enable this option ourselves across all Octokit repos.

I would be happy to give it a try to this. After trying to read a bit about this I got this blog post where it gives good points to enabling this option in out TS Config.

@wolfy1339 would it be ok if I give it a try? If yes, I will create an issue in https://github.com/octokit/tsconfig and we can discuss the plan there.

@wolfy1339
Copy link
Member

Sure, go ahead

@wolfy1339 wolfy1339 removed the Status: Triage This is being looked at and prioritized label Sep 24, 2024
@wolfy1339 wolfy1339 moved this from 🆕 Triage to 🏗 In progress in 🧰 Octokit Active Sep 24, 2024
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in 🧰 Octokit Active Sep 24, 2024
Copy link

🎉 This issue has been resolved in version 6.1.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Type: Bug Something isn't working as documented
Projects
Archived in project
3 participants