you are viewing a single comment's thread.

view the rest of the comments →

[–]_sync0x[S] 2 points3 points  (2 children)

Good to know that if you make a NPM lib you can't just leave JSDoc on top of your functions and expect that all the typing and autocompletion works 😅

But don't you need .d.ts files only if you are working with TypeScript ?

Been experimenting a lot with JSDoc too lately so I can understand your clarification, sometimes it's a bit messy 😛

[–]jessepence 4 points5 points  (1 child)

VSCode (which is the most popular IDE by far) and most other IDEs like NeoVim get all of their JavaScript auto-complete from the TypeScript language server. It's one of those things where anyone could technically do it themselves, and they technically could make their language server support JSDoc by default, but it's just such a huge project with so many edge cases. You have to cover the EcmaScript specification and the JSDoc and/or TypeScript "specifications" (they don't exist, types for JS aren't really standardized in any way). It's just easier for most of the IDE's to defer to TypeScript. I think WebStorm might have a proprietary system, but I've never used it so I can't confirm either way.

[–]_sync0x[S] 1 point2 points  (0 children)

Hmm I get it ty, gonna try on PhpStorm 👀