From 1d17e4cacc71ecd9ae0c9c33f0d4eaa80fef7e36 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sat, 18 Jul 2026 14:48:21 +0200 Subject: [PATCH] chore(a11y): add lint rule flagging icon-only buttons without accessible name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BaseButton renders a bare button and does not enforce a name, so icon-only usages without aria-label are announced as just "button" — the a11y audit found this pattern regenerating across the codebase (42 current instances, including the TipTap bubble menu where v-tooltip provides no accessible name). The new vikunja/icon-button-accessible-name rule flags icon-only BaseButton/XButton usages that have no aria-label, aria-labelledby, title, visible text, or sr-only text; unknown child components are assumed to render text to avoid false positives. Set to 'warn' until the existing instances get aria-labels, then raise to 'error'. Claude-Session: https://claude.ai/code/session_018prq5WqRL38EGhPNQKqZUP --- .../icon-button-accessible-name.js | 118 ++++++++++++++++++ frontend/eslint.config.js | 11 ++ 2 files changed, 129 insertions(+) create mode 100644 frontend/eslint-rules/icon-button-accessible-name.js diff --git a/frontend/eslint-rules/icon-button-accessible-name.js b/frontend/eslint-rules/icon-button-accessible-name.js new file mode 100644 index 000000000..ca39772bf --- /dev/null +++ b/frontend/eslint-rules/icon-button-accessible-name.js @@ -0,0 +1,118 @@ +/** + * Flags icon-only buttons without an accessible name. + * + * BaseButton renders a bare