jsdoc
jsdoc copied to clipboard
await has no effect on this type of expression
I have a async function which I am calling from another function.
After adding the jsdoc documentation comments VSCode started giving below alerts when I call the function which has the jsdoc comments.
await has no effect on this type of expression
If I remove the jsdoc comments, the warning is removed.
Input code
module.exports = {
/**
* @description Calculate the value.
* @param {number} Input value
* @returns {number} output value
*/
testFunction : async function (param) {
try {
// do something
return value;
} catch (err) {
// catch error
}
},
mainFunction : async function () {
try {
// do something
let value = await testFunction(param);
return value;
} catch (err) {
// catch error
}
}
}
JSDoc configuration
Using the default config file.
JSDoc debug output
Your debug output here
Expected behavior
Current behavior
Your environment
| Software | Version |
|---|---|
| JSDoc | |
| Node.js | |
| npm | |
| Operating system |