TIL you can express pretty much all typescript type syntax in JSDoc comments: https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html
This gives you all the IDE benefits of typescript, but you don't need a compile step to run your code.
miniblog.
Related Posts
Today I learnt about Solargraph, an LSP for Ruby which includes an impressive amount of type inference and type checking! https://solargraph.org/guides/type-checking
Type signatures are parsed from doc comments, similar to JSDoc with TypeScript.
I feel like in-code docs are an underexplored design space.
Do you use comments or string literals? Before the function (e.g. JSDoc) or inside it (e.g. Python)?
Which is best? Which is the easiest to write, has the easiest tooling, or the most readable (code/HTML) artifacts?
semantic-release is neat: https://www.npmjs.com/package/semantic-release It can diff jsdoc to decide if your release is a breaking change!