Skip to content

a11y: gate Svelte accessibility warnings as CI errors#3682

Open
ardiewen wants to merge 2 commits into
mainfrom
a11y/svelte-a11y-warning-gate
Open

a11y: gate Svelte accessibility warnings as CI errors#3682
ardiewen wants to merge 2 commits into
mainfrom
a11y/svelte-a11y-warning-gate

Conversation

@ardiewen

@ardiewen ardiewen commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Fails CI on Svelte compiler accessibility warnings (a11y_*), so hand-rolled a11y regressions are caught at PR time instead of at the periodic audit.

  • scripts/a11y/assert-no-a11y-warnings.mjs — runs svelte-check and exits non-zero only on a11y_* codes (--fail-on-warnings is unusable — the repo has 173 unrelated warnings — and Svelte 5's warningFilter only suppresses, can't escalate).
  • check:a11y npm script + a check-a11y CI job.
  • CLAUDE.md → Accessibility section (the gate + "compose Holocene primitives, don't hand-roll").

Scope — deliberately thin. The Svelte compiler only analyzes static, single-file markup/ARIA (≈eslint-plugin-jsx-a11y). It reliably catches the single highest-frequency regression — a naked <div>/<tr onclick> with no keyboard path — but not contrast, focus/keyboard behavior, live regions, accessible-name quality, or anything runtime/CSS. Those belong to axe (Storybook/Playwright), keyboard interaction tests, and review. This is one cheap deterministic layer, not the a11y coverage story.

Escape hatch: <!-- svelte-ignore a11y_<code> --> on the preceding line (grep-able for review). Baseline is clean today (0 a11y warnings across 1445 files), so this is green on merge and only trips future regressions.

🤖 Generated with Claude Code

Svelte emits a11y issues as compiler warnings, which svelte-check doesn't
fail on by default — so a regression only surfaces at the periodic audit.
This adds an a11y-scoped gate that fails CI on any `a11y_*` warning while
leaving the repo's unrelated non-a11y warnings untouched.

- scripts/a11y/assert-no-a11y-warnings.mjs — runs svelte-check (machine
  output) and exits non-zero only on `a11y_*` codes. (`--fail-on-warnings`
  is unusable — the repo has 173 non-a11y warnings — and Svelte 5's
  `warningFilter` only suppresses, can't escalate; hence a scoped script.)
- package.json — `check:a11y` script.
- lint-and-test.yml — `check-a11y` job on pull_request.
- CLAUDE.md — Accessibility section: the gate + compose-primitives rule +
  the axe-is-a-floor caveat.

Baseline is clean today (0 a11y warnings across 1445 files), so the gate is
green on merge and only fails future regressions.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
holocene Ready Ready Preview, Comment Jul 16, 2026 7:02pm

Request Review

@github-actions github-actions Bot added a11y Accessibility audit PR a11y:no-fix-doc No A11y-Audit-Ref line; audit team triage labels Jul 16, 2026
@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Accessibility triage

No A11y-Audit-Ref: lines found in the PR body. If this PR closes an audit fix doc, add an A11y-Audit-Ref: <slug> line (one per fix doc). If this is a net-new accessibility finding not yet covered by the audit, coordinate with the audit team via #team-feux so they can add a manifest entry.


See DT-4048 for the triage system design.

The pre-commit lint-staged glob (*.{ts,js}) didn't match the new .mjs, so
it shipped unformatted and failed CI's prettier --check. Format it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a11y:no-fix-doc No A11y-Audit-Ref line; audit team triage a11y Accessibility audit PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant