eslint-plugin-jsdoc icon indicating copy to clipboard operation
eslint-plugin-jsdoc copied to clipboard

Bug: require-returns-check even when missing

Open kkmuffme opened this issue 3 years ago • 0 comments

the require-returns-check stops at the first occurence of "return". However all functions (except void/undefined) need a return statement at the end of the function too, otherwise the function can return void.

/**
 * @param {string} message
 * @return {Boolean}
 */
function abc( message ) {
    if ( message ) {
        return true;
    }
    // give an error, since technically a return is needed here, since it's not void
}

kkmuffme avatar Jun 18 '22 14:06 kkmuffme