How can I add valid JSDoc comments inside functions? Is there a jsconfig.json setting I can use? E.g.
// Doesn't work inside vscode
function arrayMove(index) {
/**
* @param {Number} index
* @return {Array}
*/
// ...
}
instead of
// Works inside vscode
/**
* @param {Number} index
* @return {Array}
*/
function arrayMove(index) {
// ...
}
As far as I know, there's no VS Code setting that makes it understand JSDoc comments inside functions rather than outside-and-before them. (From doing a simple search of VS Code's settings which include "jsdoc" in their names).
And from JSDoc's intro docs, I'm getting the impression that that wouldn't be valid JSDoc anyway:
From a quick skim of JSDoc's configuration docs and commandline argument docs, I didn't see anything that looked like such a setting at the JSDoc level either (if something's not supported/valid in JSDoc, I wouldn't expect it to be supported/valid VS Code's JSDoc IntelliSense either).
I'm guessing you're coming from Python? I say just get used to it.