-
Notifications
You must be signed in to change notification settings - Fork 108
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 JSDoc for createClock #381
Conversation
This improves the generated .d.ts so that createClock may be called without arguments.
Codecov Report
@@ Coverage Diff @@
## master #381 +/- ##
=======================================
Coverage 93.49% 93.49%
=======================================
Files 1 1
Lines 553 553
=======================================
Hits 517 517
Misses 36 36
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Authors: IMHO, generating .d.ts from JSDoc should be considered a very temporary approach. Is there a reason why this was introduced and put in favour of DefnitelyTyped? Now when importing the library it's harder to use than before, since the generated typings are not at all mature. The very first call I made was to I'd love to help, but I noticed that there would be quite a lot of work to fix all the function types etc. To get this working by only improving the JSDoc is going to be harder than any other solution I think. Actually I don't know in which shape DefinitelyTyped is for this repo, but I'm not sure it's a step in the right direction to go from a community managed DefinitelyTyped repo to an auto-generated one that suffers from poor JSDoc conversion. In my book, of course the best way would be to rewrite Sinon in TypeScript. Are contributions for that of interest? The second best is probably to add the d.ts files to source control and manually improve them within this repository. The third best is to rely on DefinitelyTyped. The worst, IMHO, is the current approach... |
Perhaps it can also be noted that the suggest approach for still using DefinitelyTyped does not work perfectly either. If modifying This may be an IDE issue of course, but it still highlights that this library became much harder to use than before. I ended up downgrading to ^6.0.1. :( |
Thanks for the PR! As to your comments, I'll leave that for now (as I'm in a hurry), but you absolutely raise some very valid points. |
Of course. If you are interested in the background you can find most of the reasoning in the discussion here: #220 (comment)
We go from an external repo that is usually out of sync (I have contributed to the DT types several times when stuff I need at work is missing from DT) to one managed by the community and in-sync with our own docs. The main point for us is documenting the types used using JSDoc. The generated TypeScript definitions are a bonus.
Not at all (would not mind a hand rewriting to ESM, though!), but not from bad will 😄 You need maintainers willing to keep it up to date in Typescript - of which there are none. It was hard enough getting contributors before TS was a thing. We have no interest in Babel, bundlers and source maps getting in our way when debugging - I think we all have enough battle scars from the last decade of fighting various generations of such machinery 😸 P.S. No personal grudges against TypeScript. We started using it at work before it was cool (v0.9) 😎 |
This is related to ☝️ : #386 |
This improves the generated .d.ts so that createClock may be called without arguments.
Purpose (TL;DR) - mandatory
Improve .d.ts types for
createClock()
so that it's possible to call it from TypeScript without arguments.The currently generated .d.ts uses JSDoc, which incorrectly specified the two arguments for
createClock()
as mandatory.