Registry / testing / eslint-plugin-vuejs-accessibility

eslint-plugin-vuejs-accessibility

JSON →
library2.5.0jsnpmunverified

An ESLint plugin for checking accessibility (a11y) rules in Vue.js single-file components (.vue files). Current stable version is 2.5.0 (released 2025-03-28). It provides a set of rules to enforce WCAG and ARIA best practices, inspired by eslint-plugin-jsx-a11y but tailored for Vue templates. Released under MIT license, actively maintained by the vue-a11y community. Supports ESLint v5–v10, ship TypeScript declarations, and works with both legacy (extends) and flat config formats. Key differentiator vs. other Vue a11y tools: it is the most comprehensive and community-maintained plugin.

testing
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

The default export is the plugin object containing rules and configs. Named exports are not available.

const plugin = require('eslint-plugin-vuejs-accessibility'); // or import plugin from 'eslint-plugin-vuejs-accessibility';

Flat config is supported since v2.3.0. Legacy .eslintrc format still works. The config key for flat is 'flat/recommended' or 'flat/all'.

import plugin from 'eslint-plugin-vuejs-accessibility'; export default [ plugin.configs['flat/recommended'], { rules: { 'vuejs-accessibility/alt-text': 'error' } } ];

Use the plugin prefix 'plugin:vuejs-accessibility/' in extends, not the full npm package name.

module.exports = { extends: ['plugin:vuejs-accessibility/recommended'], rules: { 'vuejs-accessibility/alt-text': 'error' } };

Rules are prefixed with 'vuejs-accessibility/'. Each rule can have severity and options. Refer to docs for individual rule options.

// .eslintrc { 'vuejs-accessibility/click-events-have-key-events': 'warn' }

Shows both flat config (ESLint v9+) and legacy .eslintrc setup for eslint-plugin-vuejs-accessibility v2.5.0.

// Install: npm install --save-dev eslint eslint-plugin-vuejs-accessibility // Use with Flat config (ESLint v9+, recommended): // eslint.config.js import plugin from 'eslint-plugin-vuejs-accessibility'; import globals from 'globals'; export default [ { languageOptions: { globals: { ...globals.browser, ...globals.node } } }, plugin.configs['flat/recommended'], { rules: { 'vuejs-accessibility/alt-text': ['error', { elements: ['img', 'area', 'input[type="image"]'] }], 'vuejs-accessibility/click-events-have-key-events': 'warn' } } ]; // For .eslintrc (legacy, ESLint v8): // .eslintrc.js module.exports = { extends: ['plugin:vuejs-accessibility/recommended'], rules: { 'vuejs-accessibility/alt-text': 'error' } };
Debug
Known footguns
breakingFlat config support was added in v2.3.0. Prior to v2.3.0, only legacy .eslintrc format worked with ESLint v8. ESLint v9 users must use v2.3.0+ and flat config.
deprecatedThe rule 'label-has-for' is deprecated in favor of 'form-control-has-label'. It will be removed in a future major version.
gotchaPeer dependency 'globals' is required and must be >=13.12.1. Missing 'globals' can cause errors in flat config setups.
gotchaWhen using flat config, the config key is 'flat/recommended' (not 'recommended'). Using 'recommended' without 'flat/' will fail.
gotchaRules must be prefixed with 'vuejs-accessibility/' in rule settings. Omitting the prefix causes ESLint to throw 'Definition for rule was not found'.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
9 hits · last 30 days
gptbot
4
ahrefsbot
4
script
1
Resources