Skip to content

linter: Missing roles and incorrect required properties for role-has-required-aria-props #21944

Description

@mehm8128

What version of Oxlint are you using?

latest

What command did you run?

No response

What does your .oxlintrc.json (or oxlint.config.ts) config file look like?

No response

What happened?

The role-has-required-aria-props rule is missing some ARIA roles (meter, switch) and has incorrect required property lists for others (tab, scrollbar).

Expected vs Actual

Maybe there are other differences from eslint-plugin-jsx-a11y.

Role ARIA 1.2 Required Props oxlint eslint-plugin-jsx-a11y Issue
tab (none) ❌ reports aria-selected ✅ no error incorrect required prop
scrollbar aria-controls, aria-valuenow ❌ reports 5 props (adds aria-orientation, aria-valuemax, aria-valuemin) ✅ reports 2 props extra required props
meter aria-valuenow ❌ no error ✅ reports aria-valuenow missing role
switch aria-checked ❌ no error ✅ reports aria-checked missing role

ARIA 1.2 spec references: tab, scrollbar, meter, switch

Additional note

When multiple required props are missing (e.g. scrollbar), Oxlint emits a separate diagnostic for each prop. eslint-plugin-jsx-a11y consolidates them into a single message:

// oxlint (5 separate messages):
`scrollbar` role is missing required aria props `aria-controls`.
`scrollbar` role is missing required aria props `aria-orientation`.
`scrollbar` role is missing required aria props `aria-valuemax`.
`scrollbar` role is missing required aria props `aria-valuemin`.
`scrollbar` role is missing required aria props `aria-valuenow`.

// eslint-plugin-jsx-a11y (single message):
Elements with the ARIA role "scrollbar" must have the following attributes defined: aria-controls,aria-valuenow

The latter is ideal.

Reproduction

refer to playground

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Fields

    Priority

    None yet

    Effort

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions