Skip to content

linter: INTERACTIVE_ROLES and NON_INTERACTIVE_ROLES don't consider ancestor abstract class roles #21765

@mehm8128

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?

In #17817, some helper methods such as is_interactive_role are introduced but INTERACTIVE_ROLES and NON_INTERACTIVE_ROLES are partially wrong.

eslint-plugin-jsx-a11y calculates them using roles (from aria-query) and role.superClass.some((classes) => includes(classes, 'widget')).
https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/8f75961d965e47afb88854d324bd32fafde7acfe/src/util/isNonInteractiveElement.js#L42-L59

For example, super classes of grid role are calculated as:

[
  [ 'roletype', 'widget', 'composite' ],
  [ 'roletype', 'structure', 'section', 'table' ]
]

grid has widget role as its ancestor abstract class role, so grid is interactive role.
But INTERACTIVE_ROLES doesn't include it and NON_INTERACTIVE_ROLES does.
This can be applicable to other roles such as tablist role.

We should consider ancestor abstract class roles.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Priority

    None yet

    Effort

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions