Skip to content

[eslint-config-airbnb] jsx-a11y/control-has-associated-label config does not ignore td and th HTML elements #3069

Description

@ZeeshanTamboli

At Material UI, we use eslint-config-airbnb, which includes jsx-a11y pre-defined rules. We’re encountering this error for td and th elements:

A control must be associated with a text label  jsx-a11y/control-has-associated-label

Since td and th are non-interactive, they should be added to the ignoreElements list here and not parsed by jsx-a11y plugin.

This is preventing us from bumping eslint-plugin-jsx-a11y: mui/material-ui#39752.

Activity

  1. ljharb commented on Dec 8, 2024

    @ljharb
    Collaborator

    It shouldn’t be preventing anything since you can (and should, in cases like these) be overriding a rule’s config whenever needed.

    The change seems good, however.

  2. AyushSinha-6409 commented on Dec 17, 2024

    @AyushSinha-6409
  3. ljharb commented on Dec 17, 2024

    @ljharb
  4. AyushSinha-6409 commented on Dec 17, 2024

    @AyushSinha-6409
  5. MustakimShaikh01 commented on Dec 2, 2025

    @MustakimShaikh01

    Hi! 👋 I'd like to work on this issue.

    Since the collaborator mentioned "the change seems good" and there is no open PR for this yet, I’d be happy to create a PR that:

    adds td and th to the ignoreElements list in jsx-a11y/control-has-associated-label,

    updates the Airbnb eslint config accordingly, and

    includes tests to ensure the rule no longer flags non-interactive table elements.

    Please let me know if you’re okay with me taking this up.
    Thanks!

    — Mustakim Shaikh

  6. ljharb commented on Dec 2, 2025

    @ljharb
    Collaborator

    Sure, as long as you don't use AI for the contribution, it's more than welcome.

  7. MUSTAKIMSHAIKH2942 commented on Dec 2, 2025

    @MUSTAKIMSHAIKH2942

    Understood — I’ll handle the contribution manually without any AI assistance.
    Thanks for the clarification!

  8. MUSTAKIMSHAIKH2942 commented on Dec 2, 2025

    @MUSTAKIMSHAIKH2942

    Hi, I'm running into the same issue where control-has-associated-label is flagging and even though they're not interactive elements.
    I’m not sure what the correct approach is on my side — should I add my own override with ignoreElements, or is this something that will be updated in the Airbnb config?
    Just want to make sure I'm handling it the right way. Thanks!

  9. ljharb commented on Dec 4, 2025

    @ljharb
    Collaborator

    If you think it's an issue with the rule, please file it on that repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions