Closed remcohaszing closed 3 years ago
nice!
btw, I quite like the jsdoc based approach in xdm. Should we start moving towards that everywhere?
btw, I quite like the jsdoc based approach in xdm. Should we start moving towards that everywhere?
I haven’t tried this myself. I have seen other project maintainers struggle with this in the wild. TBH it feels like if you do that, you might as well write the code using TypeScript instead.
btw, I quite like the jsdoc based approach in xdm. Should we start moving towards that everywhere?
I'm open to adopting it more broadly.
I haven’t tried this myself. I have seen other project maintainers struggle with this in the wild.
I've run into this to some extent. JSDoc TS + TS strict mode is not an easy mix to get working. Dropping TS strict mode loses some internal checking, but makes the JSDoc TS transition more approachable and still has the same outward facing API.
files
were missing
Should I add "types/*.d.ts"
for this, and to the whole gfm
extensions to support both the syntax and html extensions?
Yes, adding "types/*.d.ts"
seems right.
I’m also wondering if it should be "types": "types"
then instead of "types": "types/index.d.ts"
. :thinking:
I dunno! We do have syntax as the default, so my guess is that types
has to match that, instead of pointing to a folder?
Actually neither appears to work. Moving the type definitions to the project root does seem to work.
I’m unsure what would be a proper solution.
/cc @ChristianMurphy
Actually neither appears to work. Moving the type definitions to the project root does seem to work.
I assume this comment relates to: https://github.com/micromark/micromark-extension-gfm-strikethrough/blob/main/types/html.d.ts ? If so, yeah, we've run into this a few times. If a file other than index needs to be typed, the typings need to be moved to the root.
Another option is https://github.com/micromark/micromark-extension-gfm-strikethrough/pull/2#issuecomment-788986945 Which means that the types can be encoded in the JS files, automatically generated at the root level, and gitignored but included in the published package.
Title says all. :)