-
-
Notifications
You must be signed in to change notification settings - Fork 935
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
Make the TypeScript types strict and better #758
Comments
The work I did at #700 (comment) will need to be rebased. I will probably need some pointers about how to resolve some of the remaining issues. Is that something you'd be able to help with / is it worth doing that? |
@IssueHunt has funded $180.00 to this issue.
|
@paulmelnikow I'm not sure how much my review will help. Making Got strict was more over my current TS knowledge than I realized. |
Would it be helpful to incrementally add the parts for which I was able to identify good types? |
Yes, definitely. |
Out of curiosity, why did you remove noImplicitReturns from the top post instead of checking it off? It's nice to feel like progress has been made. Also the second bullet isn't done, but could reference #760 which made significant progress. |
This removes `noUnusedParameters: false`, one of the tasks in the checklist at sindresorhus#758. After reading these documents, it seems like either `_` or e.g. `_unusedRequest` is a good replacement name which silences the errors for these parameters - microsoft/TypeScript#24249 - microsoft/TypeScript#9458
@paulmelnikow It was only half of the bullet point, so was easier to remove it than to move it to a new one and check it, but done now. |
Ah, I gotcha. Thanks! |
I'm working on:
|
I understand the TS migration is still a wip (big fan), but at this time do consumers of this lib still need to use @types/got? |
@mastermatt Yes |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I would love to help out with this issue, even though I'm a bit of a TS n00b. What would be the best bullet point to work on? |
@ejmartin504 You could remove the |
Hello! I'd like to help out with this issue, with making the project strict and fulfill the list. What do I need to do to get started? 😄 |
@vladfrangu the comment above yours
|
To prevent any duplicate work, I just want to make it clear that @vladfrangu is currently working on this issue :) |
@vladfrangu Have you had the chance to do some more work on it? |
I haven't really had a lot of free time recently, which sucks a lot, and I'm so sorry about that! I'll check out what needs to be done when I get back in around 2 weeks to get the project to compile with strict mode (on the latest TS version too). I'll keep you up to date as much as I can! |
Sounds good. Thank you :) |
This is still up for grabs. |
Hey! I can work on this issue next week. I guess a good first PR would be to make the source code strict mode compatible? |
Yes, just keep in mind that is harder than it looks. There have been multiple attempts already, which have improved the types a lot, but still not managed to make it 100% strict. |
@pmmmwh I think ⬆️ is the only thing left to resolve this issue. |
I'm starting to work on this. I'll ask if I hit any road blockers, but I don't think there will be much. |
@pmmmwh Still insterested in finishing this? |
@sindresorhus has rewarded $162.00 to @pmmmwh. See it on IssueHunt
|
We have successfully transitioned to TypeScript, but we have not yet enabled strict mode. Although some of the files have strict types, there's still a lot of work to properly type everything.
If you want to take on this issue, it's expected that you have deep TypeScript understanding and experience. It's not an easy issue. Comment if you decide to start on this to prevent duplicate work.
I suggest the following order of fixing things (can be multiple PRs):
"strict": false,
in tsconfig.json and properly type what's required just to get it to compile ($ npm test
should pass).noImplicitReturns
from tsconfig.json and fix any errors.noUnusedParameters
from tsconfig.json and fix any errors.// @ts-ignore
comments and fix the errors.readonly
and const assertions wherever possible: https://devblogs.microsoft.com/typescript/announcing-typescript-3-4/IssueHunt Summary
pmmmwh has been rewarded.
Backers (Total: $180.00)
Submitted pull Requests
Tips
The text was updated successfully, but these errors were encountered: