-
-
Notifications
You must be signed in to change notification settings - Fork 169
Closed
Labels
Description
Motivation
A new rule called no-hyphen-before-returns-description
Current behavior
Doesn't exist currently.
Desired behavior
It would warn and hopefully auto-fix if there is a hyphen in the returns description.
Alternatives considered
#623 is requesting the opposite, that a hyphen should exist before the description in a returns statement. However, IntelliSense, in at least VS Code which is one of the mostly used editors, renders the dash which makes it look "wrong". The dash is there in e.g. @param as a delimiter for identifier names, but JSDoc does not show it as part of @returns, see https://jsdoc.app/tags-returns.html.
Example of VS Code IntelliSense (code completion) for the following function:
/**
* Some test function.
*
* @param {boolean} cool - If this is cool or not
*
* @returns {string} Current coolness.
*/
function coolness(cool) {
return cool ? 'Very cool' : 'Not cool at all';
}
