3 ms·
I tried JSDoc. I liked it at first but soon it became unusable. Even putting aside how verbose it is, the problem is the IDE support was not working. Trying to
by AltruisticGapHN 6y ago
I tried JSDoc. I liked it at first but soon it became unusable.
Even putting aside how verbose it is, the problem is the IDE support was not working. Trying to document eg. Vue props with JSDoc, there was no completion.
Seems to me JSDoc in VSCode was working great for vanilla JS, but as soon as you use Vue, there are so many completions that were not recognised that it defeats the purpose. I mean, the IDE autocomplete where the IDE knows what members are in a given object, makes the work of typing the code all worth it. If it works only half the time, then it becomes pointless.
TypeScript is ok, but as soon as you have to do like DOM manipulation, then you get into the rabbit hole :) Figuring out all the ways those DOM apis are dclared, why they have many signatures sometimes for the same function...
Then again I suppose that's how you really learn TS.
Like if you wanted to declare an array with a default value in a Vue prop with JSDoc:
props: {
items: {
/\* @type {{ new(): string[] }} \*/
type: Array,
default: function() { return [] }
It took some time to figure out how to do it with JSDoc (eg. above you can't use arrow function to declare the default value.
Then you need to figure all kind of shenanigans with Vetur/eslint... just wasn't worth the hassle, may as well use TS.
- franklyt 6y agoYour problem might be that VSC is not an “IDE”, so you’re only going to get the support you ask out of it. Webstorm might suit you better.