Skip to content

lint: a11y-lint React .tsx components, and guard against a11y rules going dark #114

Open

Description

@jvcorredor

Problem

The reviews of PR #113 found two gaps in lint coverage. Neither was introduced by #113.

  1. .tsx components get no a11y linting, and never did. eslint-plugin-astro's flat/jsx-a11y-recommended rules (astro/jsx-a11y/*) return {} unless parserServices.isAstro. So they're enabled on .tsx files but do nothing there. 46 of the 75 non-config source files are .tsx. Running eslint-plugin-jsx-a11y-x's recommended config on **/*.tsx finds 5 real issues today:
    • Newsletter.tsx:91 anchor-is-valid
    • catalyst/combobox.tsx:67 no-autofocus
    • catalyst/listbox.tsx:24 no-autofocus
    • catalyst/link.tsx:18 anchor-has-content
    • catalyst/sidebar.tsx:117 heading-has-content
  2. a11y rules disappear silently if the optional peer is missing. With eslint-plugin-jsx-a11y-x removed from node_modules, lint stays green and --print-config shows 0 jsx-a11y rules, with no config error.

Proposed fix

  1. Add eslint-plugin-jsx-a11y-x's flat recommended config for **/*.tsx in eslint.config.js.
  2. Fix the issues it reports in our own components. For the Catalyst UI kit (which AGENTS.md says to treat as vendored), use targeted, justified disables rather than edits.
  3. Add a CI canary that fails if a11y rules aren't active, e.g. a committed fixture with one known violation that must make eslint exit non-zero, or a --print-config | grep -q jsx-a11y/alt-text step.
  4. Update the AGENTS.md lint line to say which file types are covered.

Parent

#90

Activity

  1. added
    enhancement
    on Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions