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

LimitHandler typing uses type object for options #641

Closed
Thodor12 opened this issue Nov 2, 2023 · 3 comments · Fixed by #642
Closed

LimitHandler typing uses type object for options #641

Thodor12 opened this issue Nov 2, 2023 · 3 comments · Fixed by #642
Labels
released Status: Up for grabs Issues that are ready to be worked on by anyone Type: Bug Something isn't working as documented

Comments

@Thodor12
Copy link

Thodor12 commented Nov 2, 2023

Relevant line: https://github.com/octokit/plugin-throttling.js/blob/main/src/types.ts#L6

The object type is not readable, even though the examples show doing things like "options.method" or "options.url", but with Typescript, none of this works:

2023-11-02 19_02_38-Window

tsconfig.json:

{
  "compilerOptions": {
    "strict": true,
    "jsx": "react-jsx",
    "jsxImportSource": "react",
    "allowSyntheticDefaultImports": true,
    "noErrorTruncation": true
  }
}

And relevant package versions:

    "@octokit/auth-token": "^4.0.0",
    "@octokit/plugin-throttling": "^8.1.2",
    "@octokit/rest": "^20.0.2",
@wolfy1339 wolfy1339 added the Type: Bug Something isn't working as documented label Nov 2, 2023
@CatChen
Copy link

CatChen commented Nov 6, 2023

I haven't upgraded this dependency since 5.2.0 because of this. The options is still constructed from a known structure and it even adds retryCount for backward compatibility, but it's no longer typed.

@wolfy1339
Copy link
Member

Thank you for bringing this up to our attention. I have created a PR to fix this problem and add proper types for the options parameter

Feel free to look it over and leave a review
#642

@wolfy1339 wolfy1339 moved this from 🔥 Backlog to 🏗 In progress in 🧰 Octokit Active Nov 7, 2023
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in 🧰 Octokit Active Nov 18, 2023
Copy link
Contributor

🎉 This issue has been resolved in version 8.1.3 🎉

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 Status: Up for grabs Issues that are ready to be worked on by anyone Type: Bug Something isn't working as documented
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants