[Advice] JSDoc types questions from maintainers' perspectives #120
-
Hey unified/mm team! I have been personally inspired by the maintainers on mindfully when authoring libraries without committing deeply to TS. I understand the general principles for using JSDoc-based TS typings.
My discussion post is to mainly ask for advice from the team on a few things that JSDoc-based typing does not seem to sit well with the principles above:
Thank you so much for your time. Been passively learning from many of you, but figured I'll actively seek some help and get into your mindspace on this topic :) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Exactly.
Yes, though I'd note the caveat that it is not entirely agnostic.
The goal isn't to entirely decouple, it is mostly to avoid compilation/transpiling/bundling.
Which are three common considerations micromark/unified faces (among many others).
It happens, both with non-standard JSDoc, and there are some things which cannot be represented in JSDoc syntax at all, and a handwritten
Taking a step back, I'd personally articulate the principles as: (* other maintainers may articulate these differently)
When/where there is a conflict between them 1 takes precedence over 2, 2 takes precedence over 3, etc. So far I'd say that has been pragmatic enough.
Mostly code review.
Type which are exported AND documented in a
That goes case by case, usually semver patch/fix.
The only major we've had so far is occasionally dropping support for an older version of TypeScript, to enable accurate type checking. |
Beta Was this translation helpful? Give feedback.
-
Can we just have a |
Beta Was this translation helpful? Give feedback.
Exactly.
I'd add that there is complexity, compatibility, and maintenance overhead to compiling/transpiling/bundling code.
If that can be avoided, for example if https://github.com/tc39/proposal-type-annotations becomes standard, we may leverage that syntax.