sindresorhus/eslint-plugin-unicorn

Rule proposal: Doc comment asterisk prefix style

Closed

#1,607 opened on Nov 11, 2021

 (3 comments) (2 reactions) (0 assignees)JavaScript (468 forks)user submission
help wantednew rule

Repository metrics

Stars
 (5,022 stars)
PR merge metrics
 (Avg merge 1d 16h) (399 merged PRs in 30d)

Description

Description

I prefer not using asterisk prefix on doc comments as I find them noisy and they also make it much harder to edit comments.

I'm aware you can almost get this with the JSDoc ESLint plugin, but it's a bit heavy to add that just for this and doc comments do not necessarily need to be JSDoc, so this rule would be more general.

Fail

/**
 * Add two numbers.
 * @param {number} num1 The first number.
 * @param {number} num2 The second number.
 * @returns {number} The sum of the two numbers.
 */

Pass

/**
Add two numbers.
@param {number} num1 The first number.
@param {number} num2 The second number.
@returns {number} The sum of the two numbers.
*/

(Notice how */ moved too)

Contributor guide