---
title: "Discussion on \"Typescript... or jsdocs ?\" | Hashnode"
description: "Discussion on \"Typescript... or jsdocs ?\". Each time I see an article (like this one) about typescript, they never quite seem to mention jsdocs. Therefore, it always feels like an unfair, one-sided comparison. Let's dive in some of the typical examples.\nType safety\nThis is probably the bigges..."
url: "https://hashnode.com/posts/typescript-or-jsdocs/659fdb0e852d356e199f4a49"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Typescript... or jsdocs ?](https://blog.lekoala.be/typescript-or-jsdocs?utm_source=hashnode&utm_medium=feed)

Each time I see an article (like this one) about typescript, they never quite seem to mention jsdocs. Therefore, it always feels like an unfair, one-sided comparison. Let's dive in some of the typical examples. Type safety This is probably the bigges...

Jan 11, 2024 · 2 min read · blog.lekoala.be  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#typescript](https://hashnode.com/tag/typescript)
-   [#jsdoc](https://hashnode.com/tag/jsdoc)

## Written by

[Thomas Portelange](https://hashnode.com/@lekoala)

@lekoala · Belgium

  
[View profile](https://hashnode.com/@lekoala)

A PHP/JS Web Developer based in Belgium

A Web Developer based in Belgium, specialized in PHP &amp; JS development

## Responses 2

Markdown supported · ⌘↵ to post

[Nenad Vićentić](https://hashnode.com/@nenadvicentic)

[Feb 11, 2025](https://hashnode.com/posts/typescript-or-jsdocs/659fdb0e852d356e199f4a49/comment/67ab50ecf2c4706ea43fe0bc)

While I wholeheartedly agree with you on Tailwind vs modern CSS, this is different case.

All the functionality you are using via JSDocs is enabled and implemented by TypeScript compiler (probably the one built-in into Visual Studio Code?). Using JSDocs gives you only the advantage that you don't have to transpile source files.

But, since you are already using ESBuild for minification and source-maps, you could have used TypeScript syntax, instead of JSDocs as well. Also, your `jsconfig.json` is derivate of `tsconfig.json`.

There is a nice post from Rob Eisenberg how to integrate full TypeScript compiler with ESBuild: "An ESBuild Setup for TypeScript"

Also, if you follow trends, NodeJS can now execute TypeScript files out of the box. For example: `node --experimental-strip-types build/copy-files.mts`. Even ESBuild can handle "simple" TypeScript files without a full TypeScript compiler.

But the point you are right about - mapping types, npm packages, etc... can become quite complicated. Specially because NMP/Node support multiple standard and non-standard JavaScript module types.

So, unlike Tailwind, TypeScript has usefull functionality that does not exist in native JavaScript. And it seems that all the industry is converging on idea that some kind of type notation should exist in JavaScript natively.

[Thomas Portelange](https://hashnode.com/@lekoala)

[Feb 11, 2025](https://hashnode.com/posts/typescript-or-jsdocs/659fdb0e852d356e199f4a49/comment/67ab50ecf2c4706ea43fe0bc#reply-67ab5879922d00330d053450)

While I might just as well use Typescript since I have all the tooling in place, it would bring very little benefits over using a couple of jsdocs tags (for me, and for my use cases, anyway.. i can very well understand in larger projects or with a team that typescript makes more sense). Using typescript also forces you to follow updates or potential breaking changes... one less thing to worry about for me :-) But maybe some day I will see a decisive benefit and decide to switch, who knows :-D

[Nenad Vićentić](https://hashnode.com/@nenadvicentic)

[Feb 12, 2025](https://hashnode.com/posts/typescript-or-jsdocs/659fdb0e852d356e199f4a49/comment/67ab50ecf2c4706ea43fe0bc#reply-67ac5831f1461341b4ef6cbe)

[Thomas Portelange](https://hashnode.com/@lekoala) That's fine. I am not trying to persue you to change coding style that makes you more productive. And you, clearly, do the coding well.

I'm pointing out that both Typescript and JSDoc types are powered by the same TypeScript Language Service in your code editor. Which means that even when using JavaScript with JSDoc types, you are actually using TypeScript engine under the hood. Only in a "light" mode that suits your preferences.

[Thomas Portelange](https://hashnode.com/@lekoala)

[Feb 12, 2025](https://hashnode.com/posts/typescript-or-jsdocs/659fdb0e852d356e199f4a49/comment/67ab50ecf2c4706ea43fe0bc#reply-67ac597b545763d76e194d73)

[Nenad Vićentić](https://hashnode.com/@nenadvicentic) ;-) I might give it a test run and see how it goes in one of my project, i'm really curious to see if that would make me "more productive" but I'm not really sure that will be the case

[Philip Birk-Jensen](https://hashnode.com/@BirkAndMe)

[Jan 13, 2024](https://hashnode.com/posts/typescript-or-jsdocs/659fdb0e852d356e199f4a49/comment/65a2e57d2b55e1c066352a1a)

I have the same philosophy when it comes to bundlers and transpilers.

With the browsers developer tools being so awesome a debugging (and prototyping) environment, I feel having a 1:1 with what I write and the devtools is very strong. I know source maps can mitigate some of this, but for me it's more of a hassle than a benefit.

Anyway, great write up! I have linked to this post in my own recent post (shameless plug incoming) about documenting a callback: [blog.birk-jensen.dk/documenting-a-callback-functi…](https://blog.birk-jensen.dk/documenting-a-callback-function-in-jsdoc.)
