Skip to content

Linter: Implement a11y-nested-interactive-elements rule#1674

Open
joelhawksley wants to merge 2 commits into
marcoroth:mainfrom
joelhawksley:1222
Open

Linter: Implement a11y-nested-interactive-elements rule#1674
joelhawksley wants to merge 2 commits into
marcoroth:mainfrom
joelhawksley:1222

Conversation

@joelhawksley
Copy link
Copy Markdown
Contributor

Implements the a11y-nested-interactive-elements rule from erblint-github's NestedInteractiveElements.

This rule flags interactive elements (<a>, <button>, <input>, <select>, <summary>, <textarea>) that are nested inside other interactive elements. Nesting interactive elements produces invalid HTML, and assistive technologies, such as screen readers, might ignore or respond unexpectedly to such nested controls.

Exceptions:

  • <a> inside <summary> is allowed
  • <input type="hidden"> is not considered interactive

The rule is disabled by default with a severity of error.

Closes #1222

Implements the `a11y-nested-interactive-elements` rule from erblint-github's `NestedInteractiveElements`.

This rule flags interactive elements (`<a>`, `<button>`, `<input>`, `<select>`, `<summary>`, `<textarea>`) that are nested inside other interactive elements. Nesting interactive elements produces invalid HTML, and assistive technologies, such as screen readers, might ignore or respond unexpectedly to such nested controls.

Exceptions:
- `<a>` inside `<summary>` is allowed
- `<input type="hidden">` is not considered interactive

The rule is disabled by default with a severity of `error`.

Closes marcoroth#1222
@marcoroth marcoroth changed the title Implement a11y-nested-interactive-elements linter rule Linter: Implement a11y-nested-interactive-elements rule May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a11y documentation Improvements or additions to documentation linter linter-rule typescript

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Linter: Implement a11y-nested-interactive-elements rule

1 participant