Skip to content

require-li-container

Reports an <li> whose parent is not a list (<ul>, <ol> or <menu>).

An <li> outside a list is not a list item, so a screen reader announces no list, and the browser draws no marker.

To fix, put the item in a list.

Reported
...
<ul><li>a</li></ul>
<div><li>b</li></div>
angular:
lint:
rules:
require-li-container: warn # off (default), warn, error
html:
lint:
rules:
require-li-container: warn # off (default), warn, error
svelte:
lint:
rules:
require-li-container: warn # off (default), warn, error
vue:
lint:
rules:
require-li-container: warn # off (default), warn, error

Enabled by the presets: html/html-eslint-recommended.

Suppress one line with sudsy-disable-next-line require-li-container in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
html-eslint require-li-container full