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

Add JSDoc-based TypeScript checks + first-class types #47

Merged
merged 5 commits into from
Apr 21, 2023
Merged

Conversation

mourner
Copy link
Owner

@mourner mourner commented Apr 19, 2023

This is just an experiment to see what it would take to add TypeScript checks and first-class types to a library of mine without going all the way of converting the code. The result is pretty nice — it even caught a ligitimate bug! (Fixed in f3d24b3)

JSDoc TS syntax is a little verbose for my liking, but seems like an acceptable tradeoff, and is heavily endorsed by @Rich-Harris.

@mourner
Copy link
Owner Author

mourner commented Apr 21, 2023

@mfedderly does this look good to you as the author of the types on DefinitelyTyped? The first-class types would supersede your work, but would make it easier to keep the types up to date and maintained going forward.

@mourner mourner merged commit eaca470 into main Apr 21, 2023
2 checks passed
@mourner mourner deleted the typescript branch April 21, 2023 08:55
@mfedderly
Copy link

This is the first I've actually really looked at the JSDoc TS syntax, but it looks pretty reasonable. Its a nice alternative to a handwritten index.d.ts to keep things accessible to JS devs when you don't want to go full typescript.

I think we're supposed to turn the DefinitelyTyped ones into stubs once the upstream package gets types added (https://github.com/DefinitelyTyped/DefinitelyTyped#removing-a-package). Let me know if you want me to do that after you do the next release of flatbush.

@mourner
Copy link
Owner Author

mourner commented Jun 1, 2023

@mfedderly just released a new version with the first-class types, so will appreciate help with removing the package from DefinitelyTyped 🙏

@mfedderly
Copy link

Working on it now. microsoft/DefinitelyTyped-tools#682 is a prerequisite for the DefinitelyTyped PR.

@mfedderly
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants