kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

Enable Vue accessibility linting via eslint-plugin-vuejs-accessibility

Open rtibbles opened this issue 7 months ago • 8 comments

❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Overview

Enable eslint-plugin-vuejs-accessibility in packages/kolibri-format/eslint.config.mjs using the flat/recommended preset at error severity, and remediate the pre-existing violations across the ~612 .vue files in the Kolibri codebase. Includes a minor version bump of kolibri-format.

Complexity: High Target branch: develop

Context

Kolibri has ~612 .vue files but no static accessibility linting today. The Kolibri Design System components (KButton, KModal, etc.) already bake in a11y best practices, but consumer templates can still regress — missing alt text on <img>, interactive <div> without keyboard handlers, labels without associated inputs, unlabelled form controls, and so on.

eslint-plugin-vuejs-accessibility is a static subset of a11y checks. It does not replace runtime/visual audits (screen readers, axe-style tooling), but it catches the most common template-level mistakes at lint time.

kolibri-format (the shared ESLint config at packages/kolibri-format/eslint.config.mjs) is the correct place to add the plugin so both the Kolibri repo and external consumers get the rules.

The Change

Add eslint-plugin-vuejs-accessibility as a dependency of kolibri-format and register it in packages/kolibri-format/eslint.config.mjs:

  • Extend the flat/recommended preset.
  • Raise any rules in the preset that ship at warn to error, so they are consistent with the rest of the Kolibri lint config.

Remediate the resulting violations across all .vue files in the Kolibri codebase.

Bump kolibri-format to a new minor version.

How to Get There

After wiring the plugin and preset, run:

pnpm run lint-frontend:format

Most vuejs-accessibility rules have no autofixer — remediation is manual: adding alt attributes, keyboard event handlers alongside click handlers, for/id wiring on labels, aria-* where semantically appropriate, and so on. Where a violation cannot be fixed without redesign (e.g. a complex custom widget missing role semantics), flag it in the PR discussion rather than silencing with an inline disable.

Out of Scope

  • Runtime a11y testing (axe-core, manual screen-reader passes).
  • Visual/contrast audits.
  • Adding or enabling rules beyond the flat/recommended preset.
  • Redesigning components whose a11y problems can't be fixed at the template level — flag these for follow-up issues rather than resolving them here.

Acceptance Criteria

  • [ ] eslint-plugin-vuejs-accessibility is added as a dependency of kolibri-format
  • [ ] The flat/recommended preset is registered in packages/kolibri-format/eslint.config.mjs
  • [ ] Any preset rules that default to warn are raised to error
  • [ ] pnpm run lint-frontend passes with no new violations across the repo
  • [ ] Violations that cannot be fixed at the template level have follow-up issues filed rather than being silenced with inline disables
  • [ ] kolibri-format has a minor version bump in its package.json
  • [ ] pnpm-lock.yaml is updated for the version bump

References

AI usage

Used Claude Code to draft this issue iteratively. I provided direction on scope and reviewed each section before it was committed. Claude scanned the codebase to gauge the number of .vue files in scope for remediation (~612 files).

rtibbles avatar Apr 22 '26 21:04 rtibbles

Plan: Enable eslint-plugin-vuejs-accessibility in kolibri-format's ESLint flat config and remediate all resulting violations across the ~612 Vue files in the codebase.

  • [ ] Add the dependency and bump the version
  • [ ] Configure the plugin in ESLint flat config
  • [ ] Run lint and catalog all violations
  • [ ] Fix alt-text violations
  • [ ] Fix click-events-have-key-events violations
  • [ ] Fix no-static-element-interactions violations
  • [ ] Fix mouse-events-have-key-events violations
  • [ ] Fix interactive-supports-focus violations
  • [ ] Fix label-has-for violations
  • [ ] Fix remaining violation categories
  • [ ] Handle violations that cannot be fixed at the template level
  • [ ] Final lint verification

status


@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly

How was this generated?
  • Implemented code following the pre-approved plan using test-driven development (red-green-refactor)
  • Ran the project's full test suite and linter before committing
  • For UI changes: captured live screenshots to verify rendering
  • For backend changes: verified with example API/CLI output

rtibblesbot avatar Apr 22 '26 22:04 rtibblesbot

The bot has been waiting for a response for 2 hour(s). It will resume automatically when someone replies.

rtibblesbot avatar Jun 05 '26 23:06 rtibblesbot

PR #14640 is ready for review. All CI checks are passing and there are no outstanding issues to address.

rtibblesbot avatar Jun 06 '26 03:06 rtibblesbot

The bot has been waiting for a response for 2 hour(s). It will resume automatically when someone replies.

rtibblesbot avatar Jun 06 '26 07:06 rtibblesbot

The bot has been waiting for a response for 2 hour(s). It will resume automatically when someone replies.

rtibblesbot avatar Jun 07 '26 21:06 rtibblesbot

The bot has been waiting for a response for 2 hour(s). It will resume automatically when someone replies.

rtibblesbot avatar Jun 23 '26 19:06 rtibblesbot

The bot has been waiting for a response for 2 hour(s). It will resume automatically when someone replies.

rtibblesbot avatar Jun 25 '26 00:06 rtibblesbot

The bot has been waiting for a response for 2 hour(s). It will resume automatically when someone replies.

rtibblesbot avatar Jun 25 '26 06:06 rtibblesbot