use-list
Prompt to use list element when a bullet character is at the start of a text node.
❌ Examples of incorrect code for this rule
<div>
•Apple<br />
•Banana<br />
•Citrus
</div>
✅ Examples of correct code for this rule
<ul>
<li>Apple</li>
<li>Banana</li>
<li>Citrus</li>
</ul>
Interface
{
"use-list": string[]
}
Specify the characters of the bullet that you expect to interpret as a list. It expects an array of code points. Default value is Bullets.
It executes after decoding character references to be a code point. For example, it decodes "•"
to be "•"
. Note: You must specify a code point instead of the character reference you need. It supports the surrogate pair code points.
Options
{
"use-list": {
"options": {
"spaceNeededBullets"?: string[]
"noPrev"?: boolean
"prevElement"?: boolean
"prevComment"?: boolean
"prevCodeBlock"?: boolean
}
}
}
Property | Type | Default Value | Description |
---|---|---|---|
spaceNeededBullets | string[] | "["-", "*", "+"]" | Bullets that require space to detect as a list item. |
noPrev | boolean | true | Consider it a list if the text containing characters is the first child of the element. |
prevElement | boolean | true | Consider it a list even if the text containing characters appears as the node following the element. |
prevComment | boolean | true | Consider it a list even if the text containing characters appears as the node following a comment. |
prevCodeBlock | boolean | false | Consider it a list even if the text containing characters appears as the node following a special block. |
Default Severity
warning