Skip to content

useSingleJsDocAsterisk

¥Summary

¥How to configure

biome.json
{
"linter": {
"rules": {
"correctness": {
"useSingleJsDocAsterisk": "error"
}
}
}
}

¥Description

强制 JSDoc 注释行以单个星号开头,第一个星号除外。

¥Enforce JSDoc comment lines to start with a single asterisk, except for the first one.

此规则确保 JSDoc 代码块中除第一行外的每一行都以一个星号 (*) 开头。JSDoc 注释中不需要额外的星号,而且星号通常是误加的。

¥This rule ensures that every line in a JSDoc block, except the opening one, starts with exactly one asterisk (*). Extra asterisks are unnecessary in JSDoc comments and are often introduced by mistake.

双星号 (**) 仍然允许使用,因为它们标记粗体文本的开始。

¥Double asterisks (**) are still allowed, because they mark the start of bold text.

¥Examples

¥Invalid

/**
** Description
*/
code-block.js:2:1 lint/correctness/useSingleJsDocAsterisk  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

JSDoc comment line should start with a single asterisk.

1 │ /**
> 2 │ ** Description
^^^^^^^^^^^^^^
3 │ */
4 │

In JSDoc comments, extra asterisks beyond the first are unnecessary and are often added by mistake.

Unsafe fix: Remove additional asterisks.

2 │ **·Description
-
/**
* Description
* */
code-block.js:3:1 lint/correctness/useSingleJsDocAsterisk  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

JSDoc comment line should end with a single asterisk.

1 │ /**
2 │ * Description
> 3 │ * */
^^^^
4 │

In JSDoc comments, extra asterisks beyond the first are unnecessary and are often added by mistake.

Unsafe fix: Remove additional asterisks.

3 │ *·*/
--
/** @ts-ignore **/
code-block.js:1:1 lint/correctness/useSingleJsDocAsterisk  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

JSDoc comment line should end with a single asterisk.

> 1 │ /** @ts-ignore **/
^^^^^^^^^^^^^^^^^^
2 │

In JSDoc comments, extra asterisks beyond the first are unnecessary and are often added by mistake.

Unsafe fix: Remove additional asterisks.

1 │ /**·@ts-ignore·**/
-

¥Valid

/**
* Description
* @public
*/
/** @ts-ignore */
/**
* **Bold** text
*/

¥Related links