Future: Possibly more automated type compilation #3157
Labels
good first issue
Should be easier for first time contributors
help welcome
Could use help from community
package/build
Issues relating to npm or packaging
parser
I’m proposing the inverse: define your types in your code.
Indeed: write them in JavaScript. No need to add a manual
index.d.ts
: typescript can compile javascript and generate thatindex.d.ts
.Here’s a smaller example: words/levenshtein-edit-distance@2c3d890.
Lowlight is a bit more involved.
A bit more complex is
unist-util-select
: syntax-tree/unist-util-select@4c1b02e.And quite complex is xdm: https://github.com/wooorm/xdm.
I am not a fan of typescript. I personally don’t really love types either. But they are somewhat useful — especially for newcomers to a giant ecosystem (unified).
I think types through jsdoc in javascript is rather nice: code is directly runnable, no building needed. But everything is still type checked by typescript (and I like
type-coverage
to ensure everything is completely typed).It ensures
.d.ts
are kept up to date and workSome more info here: https://github.com/voxpelli/types-in-js
Originally posted by @wooorm in #3131 (comment)
The text was updated successfully, but these errors were encountered: