Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

no-redundant-roles does not detect nullish attributes #1321

Open
@ouuan

Description

@ouuan

For example, I have an<a> tag that is sometimes disabled:

<a  :href="disabled?undefined:'https://example.com'"  :aria-disabled="disabled"  role="link">  maybe disabled</a>

The w3c specification requires arole="link" when it the link is disabled:https://www.w3.org/TR/html-aria/#example-communicate-a-disabled-link-with-aria

But now this plugin does not know that thehref is sometimes not set and reports an error forno-redundant-roles.

I'm not familiar with ESLint plugin development, but I'm wondering if this can be fixed by using type information and checking whether the attribute type can be nullish. Alternatively, maybe there can be an option to treat allv-bind attributes as possibly not satisfying the aria constraint, which does not rely on typing information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp