Linter: Add a11y-no-autofocus-attribute rule#1487
Open
markokajzer wants to merge 3 commits intomarcoroth:mainfrom
Open
Linter: Add a11y-no-autofocus-attribute rule#1487markokajzer wants to merge 3 commits intomarcoroth:mainfrom
a11y-no-autofocus-attribute rule#1487markokajzer wants to merge 3 commits intomarcoroth:mainfrom
Conversation
marcoroth
reviewed
Mar 24, 2026
javascript/packages/linter/src/rules/a11y-no-autofocus-attribute.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Marco Roth <marco.roth@intergga.ch> Signed-off-by: Marko Kajzer <markokajzer91@gmail.com>
1863dc8 to
95a0dce
Compare
Contributor
Author
|
some issues downloading vscode for the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #177
Linter Rule: No
autofocusattributeRule:
a11y-no-autofocus-attributeDescription
Prevent usage of the
autofocusattribute on HTML elements, Action View Form Tag Helpers and Action View Form Builder methods.Rationale
The
autofocusattribute is a global attribute that indicates an element should be focused on page load. It reduces accessibility by moving users to an element without warning and context.Its use should be limited to form fields that serve as the main purpose of the page, such as a search input on a search page.