or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

configuration.mdindex.mdrules.mdutilities.md
tile.json

rules.mddocs/

Accessibility Rules

Comprehensive set of 23 ESLint rules for Vue.js accessibility compliance, covering ARIA usage, keyboard navigation, form labeling, media accessibility, and interactive elements.

Capabilities

Rule Structure

Each accessibility rule follows the standard ESLint rule format with Vue.js-specific template analysis.

/**
 * Standard ESLint rule module structure
 */
interface Rule {
  meta: {
    type: "problem" | "suggestion" | "layout";
    docs: {
      url: string;
    };
    messages: Record<string, string>;
    schema?: JSONSchema4[];
  };
  create(context: Rule.RuleContext): Rule.RuleListener;
}

Image and Media Rules

Rules ensuring proper alternative text and media accessibility.

alt-text

/**
 * Ensures images and media have appropriate alternative text
 * Applies to: img, object, area, input[type="image"]
 */
"vuejs-accessibility/alt-text": Rule;

Checks that img, object, area, and input[type="image"] elements have proper alternative text through alt, aria-label, or aria-labelledby attributes.

media-has-caption

/**
 * Requires video/audio elements to have captions or alternatives
 * Applies to: audio, video
 */
"vuejs-accessibility/media-has-caption": Rule;

iframe-has-title

/**
 * Ensures iframe elements have a descriptive title attribute
 * Applies to: iframe
 */
"vuejs-accessibility/iframe-has-title": Rule;

Content and Labeling Rules

Rules ensuring elements have accessible content and proper labeling.

anchor-has-content

/**
 * Requires anchor elements to have accessible content
 * Applies to: a
 */
"vuejs-accessibility/anchor-has-content": Rule;

heading-has-content

/**
 * Requires heading elements to have accessible content
 * Applies to: h1, h2, h3, h4, h5, h6
 */
"vuejs-accessibility/heading-has-content": Rule;

form-control-has-label

/**
 * Ensures form controls have accessible labels
 * Applies to: input, textarea, select
 */
"vuejs-accessibility/form-control-has-label": Rule;

label-has-for

/**
 * Ensures label elements are properly associated with form controls
 * Applies to: label
 */
"vuejs-accessibility/label-has-for": Rule;

ARIA Rules

Rules for proper ARIA attribute usage and validation.

aria-props

/**
 * Validates ARIA properties are spelled correctly
 * Applies to: All elements with aria-* attributes
 */
"vuejs-accessibility/aria-props": Rule;

aria-role

/**
 * Ensures ARIA roles are valid and supported
 * Applies to: All elements with role attribute
 */
"vuejs-accessibility/aria-role": Rule;

aria-unsupported-elements

/**
 * Prevents ARIA usage on elements that don't support it
 * Applies to: meta, html, script, style
 */
"vuejs-accessibility/aria-unsupported-elements": Rule;

role-has-required-aria-props

/**
 * Ensures ARIA roles have all required properties
 * Applies to: All elements with role attribute
 */
"vuejs-accessibility/role-has-required-aria-props": Rule;

no-redundant-roles

/**
 * Prevents redundant ARIA roles that match semantic HTML
 * Applies to: Elements with implicit roles
 */
"vuejs-accessibility/no-redundant-roles": Rule;

no-aria-hidden-on-focusable

/**
 * Prevents aria-hidden on focusable elements
 * Applies to: Focusable elements with aria-hidden
 */
"vuejs-accessibility/no-aria-hidden-on-focusable": Rule;

no-role-presentation-on-focusable

/**
 * Prevents presentation role on focusable elements
 * Applies to: Focusable elements with role="presentation" or role="none"
 */
"vuejs-accessibility/no-role-presentation-on-focusable": Rule;

Interaction and Event Rules

Rules ensuring proper keyboard accessibility and event handling.

click-events-have-key-events

/**
 * Requires keyboard event handlers alongside mouse click events
 * Applies to: Elements with @click handlers
 */
"vuejs-accessibility/click-events-have-key-events": Rule;

mouse-events-have-key-events

/**
 * Requires keyboard event handlers alongside mouse events
 * Applies to: Elements with @mouseover or @mouseout handlers
 */
"vuejs-accessibility/mouse-events-have-key-events": Rule;

interactive-supports-focus

/**
 * Requires interactive elements to be focusable
 * Applies to: Elements with interactive roles or event handlers
 */
"vuejs-accessibility/interactive-supports-focus": Rule;

no-static-element-interactions

/**
 * Prevents interaction handlers on non-interactive elements
 * Applies to: Non-interactive elements with event handlers
 */
"vuejs-accessibility/no-static-element-interactions": Rule;

tabindex-no-positive

/**
 * Prevents positive tabindex values which disrupt natural tab order
 * Applies to: Elements with tabindex attribute
 */
"vuejs-accessibility/tabindex-no-positive": Rule;

Problematic Pattern Rules

Rules preventing accessibility-problematic patterns and attributes.

no-access-key

/**
 * Prevents use of accesskey attribute which can conflict with screen readers
 * Applies to: Elements with accesskey attribute
 */
"vuejs-accessibility/no-access-key": Rule;

no-autofocus

/**
 * Prevents use of autofocus attribute which can be disorienting
 * Applies to: Elements with autofocus attribute
 */
"vuejs-accessibility/no-autofocus": Rule;

no-distracting-elements

/**
 * Prevents use of distracting elements like marquee and blink
 * Applies to: marquee, blink elements
 */
"vuejs-accessibility/no-distracting-elements": Rule;

no-onchange

/**
 * Prevents onchange without onblur for accessibility
 * Applies to: Elements with @change handlers
 */
"vuejs-accessibility/no-onchange": Rule;

Rule Configuration Options

Many rules accept configuration options to customize their behavior:

{
  "vuejs-accessibility/alt-text": ["error", {
    "elements": ["img", "object", "area", "input[type=\"image\"]"],
    "img": ["Image", "Picture"],
    "object": ["Object", "Embed"],
    "area": ["Area"],
    "input[type=\"image\"]": ["InputImage"]
  }]
}

Rule Documentation URLs

All rules provide documentation links following the pattern: https://vue-a11y.github.io/eslint-plugin-vuejs-accessibility/rules/{rule-name}.html