3 ms·
Doesn't JSDoc(which the original post wants to use) also allow you to robustly define interfaces?
by Xelynega 4y ago
Doesn't JSDoc(which the original post wants to use) also allow you to robustly define interfaces?
- graftak 4y agoJsdoc has the same issue as regular comments. It’s not the source of truth but someone’s hopefully up to date version of the truth.
- Xelynega 4y agoAFAIK the only thing jsdoc "can't do" that typescript can is "generic types", which is just syntactic sugar for having a base type that all others inherit from.
- runarberg 4y agoYou’re wrong. TypeScript allows annotating types within JSDoc comments, and knows how to read it. Writing in JavaScript and using TypeScript as a type checker is a perfectly feasible option that many have picked (including this eslint rewrite). https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html https://www.typescriptlang.org/docs/handbook/jsdoc-supported...