useSingleJsDocAsterisk (JavaScript)
Language JavaScript (and super languages)
Summary
Section titled “Summary”- Rule available since:
v2.0.0 - Diagnostic Category:
lint/correctness/useSingleJsDocAsterisk - This rule isn’t recommended, so you need to enable it.
- This rule has an unsafe fix.
- The default severity of this rule is information.
- Sources:
- Same as
jsdoc/no-multi-asterisks
- Same as
How to configure
Section titled “How to configure”{ "linter": { "rules": { "correctness": { "useSingleJsDocAsterisk": "error" } } }}Description
Section titled “Description”Enforce JSDoc comment lines to start with a single asterisk, except for the first one.
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.
Asterisks that are part of the comment content, such as bold or italic text, are still allowed.
Examples
Section titled “Examples”Invalid
Section titled “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·**/
│ -
/** * Description * @public *//** @ts-ignore *//** * **Bold** text *//** * *Italic* text */Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.