I am trying to use jsDoc for my mobx-state-tree powered app but it does not react the way I want.
Visual studio code does not show me the right properties of the corresponding type:
jsDoc is a huge help when it comes to refactoring and keeping js code bug free! But how can I make use of it in this case?
I found this, but it seems it's not really used by anyone: https://github.com/Feverqwe/mst-jsdoc-gen
I really wonder how other devs are dealing with this!
The problem is that your jsDoc is not referring to the instance of the type, but to the type itself.
Try this instead:
/**
* @param {typeof Step.Type} step
*/
async applyStep(step){}
Or this (as pointed out in the typescript section of the docs):
/**
* @param {Instance<typeof Step>} step
*/
async applyStep(step){}