3 min read
|
Saved February 14, 2026
|
Copied!
Do you care about this?
The article argues that JSDoc is essentially a form of TypeScript, emphasizing that developers can use JSDoc for type declarations without the build step typical of TypeScript. It challenges the "TypeScript vs JSDoc" narrative by highlighting the similarities and shared tooling between the two. The author shares personal insights on using JSDoc effectively in projects.
If you do, here's more
In May 2023, a refactoring pull request from the Svelte repository sparked a heated discussion on Hacker News. This PR seemed to reinforce the views of TypeScript skeptics, including Dan Abramov from React. Rich Harris, a key figure in Svelte, clarified that the move to JSDoc comments for type declarations in JavaScript files wasnโt an anti-TypeScript stance. He emphasized that Svelte remains committed to TypeScript, arguing instead that the shift highlighted a nuanced relationship between the two.
The article challenges the binary view of TypeScript versus JSDoc. It presents the idea that JSDoc is essentially part of TypeScript's ecosystem. TypeScript originated as a tool to enhance JavaScript development, providing features like type safety and IntelliSense. The TypeScript language service also interprets JSDoc comments, allowing developers to benefit from type checking and IntelliSense without necessarily using .ts files.
The author shares personal experience with JSDoc, noting that it can express everything TypeScript can, albeit sometimes with a clunkier syntax. This can push developers to better utilize type inference, which is a positive outcome. He appreciates that navigating to function definitions in JSDoc projects is often more straightforward than in TypeScript, as it leads to actual code instead of type declarations. He concludes that JSDoc offers the same powerful static analysis as TypeScript, but without the overhead of a build step.
Questions about this article
No questions yet.