Skip to content

a11y-no-redundant-roles warning misidentifies an implicit role #9261

Open
@uiu490

Description

@uiu490

Describe the bug

The a11y-no-redundant-roles warning correctly identifies that < a href="http://somelink.com" role="link"> has a redundant role because an anchor tag with an href has an implicit role (link) in HTML5. However, the redundant role warning should not appear when < a role="link"> html is used, because HTML5 does not implicitly assign the link role to anchor tags without hrefs.

Reproduction

"< a role="link"></ a>"

A11y: Redundant role 'link' svelte(a11y-no-redundant-roles)

Logs

No response

System Info

System:
    OS: macOS 13.5.2
    CPU: (8) arm64 Apple M1
    Memory: 1.55 GB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.17.1 - /usr/local/bin/node
    npm: 9.6.7 - /usr/local/bin/npm
  Browsers:
    Chrome: 117.0.5938.92
    Safari: 16.6
  npmPackages:
    svelte: ^3.46.0 => 3.57.0

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions