-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Closed
Labels
Description
Describe the bug
Svelte will always report a warning on <li role="listitem">
. However, this can be a false positive, as under certain conditions the role may not be redundant. According to MDN:
Note: Styling a list with
list-style: none;
in CSS removes the list semantics. Addingrole="listitem"
returns the semantics.
Reproduction
<ul>
<li role="listitem">List item</li>
</ul>
<style>
li {
list-style: none;
}
</style>
Warn: A11y: Redundant role 'listitem' (svelte)
<ul>
<li role="listitem">List item</li>
</ul>
Logs
No response
System Info
System:
OS: macOS 13.4
CPU: (10) arm64 Apple M1 Pro
Memory: 630.22 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.3.0 - /opt/homebrew/bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 9.6.7 - /opt/homebrew/bin/npm
Browsers:
Safari: 16.5
npmPackages:
svelte: ^4.0.0 => 4.0.0
Severity
annoyance