Skip to main content
Checks that ul and ol elements contain only li elements
Rule IDa11y/list-structure
CategoryAccessibility
ScopePer-page
Severityerror
Weight7/10

Solution

Lists (<ul> and <ol>) should only contain <li> elements as direct children. For custom components, you can also use elements with role=‘listitem’. Move other content inside <li> elements.

Enable / Disable

Disable this rule

squirrel.toml
[rules]
disable = ["a11y/list-structure"]

Disable all Accessibility rules

squirrel.toml
[rules]
disable = ["a11y/*"]

Enable only this rule

squirrel.toml
[rules]
enable = ["a11y/list-structure"]
disable = ["*"]