Open
Description
Motivation
Currently it's possible to write the following code. Notice the space between
the comment and the function its describing. This is perfectly valid, but is
stylistically bad (in my opinion), and I'd like a rule to prevent (and hopefully
auto-fix) this scenario.
/**
* This is a description of some function!
*/
function someFunction() {
// ...
}
Current behavior
There is no such rule.
Desired behavior
I would like a new rule with the following behavior:
This should be considered an error:
/** This is a description of some function!*/
function someFunction() {}
These should not be considered errors:
/** This is a description of some function! */
// extra comment
function someFunction() {}
/** Standalone comment (e.g. a type definition) */
/** The actual description */
function someFunction() {}
/* Regular block comment */
function someFunction() {}
// Regular line comment
function someFunction() {}
Alternatives considered
This could maybe be done with other rules, but I couldn't find any other rule or combination of rules that would apply specifically to doc comments and not all block comments.