a11y: gate Svelte accessibility warnings as CI errors#3682
Open
ardiewen wants to merge 2 commits into
Open
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Accessibility triageNo 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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— runssvelte-checkand exits non-zero only ona11y_*codes (--fail-on-warningsis unusable — the repo has 173 unrelated warnings — and Svelte 5'swarningFilteronly suppresses, can't escalate).check:a11ynpm script + acheck-a11yCI 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