63
loading...
This website collects cookies to deliver better user experience
@angular-eslint
repo includes a number of linting rules that can help enforce accessibility best practices within Angular component templates.@Component
decorator, or ones set using @HostBinding
decorators.role
and aria-*
attributes used are valid.<img>
, <object>
, <area>
and <input>
(of type 'image'
) to make sure they have descriptive text. <img>
elements must have an alt
attribute<object>
elements must have either a title
or aria-label
attribute<area>
elements must have either an alt
or aria-label
attribute<input>
elements with type='image'
must have either an alt
or aria-label
attribute[innerText]
, [innerHtml]
or [outerHTML]
, or use of aria-label
or title
attributes. label
elements to either be associated with an input element via the for
attribute, or to contain a <button>
, <input>
, <meter>
, <output>
, <progress>
, <select>
, or <textarea>
element.{
"controlComponents": [],
"labelComponents": [],
"labelAttributes": []
}
controlComponents
- Specify components to treat as input elements (in addition to ones mentioned above)labelComponents
- Specify components to treat as label elements (in addition to label
)labelAttributes
- Specify attributes that can satisfy label being associated with an input element (in addition to for
and htmlFor
)tabindex
is only ever being set to 0
(element is tab focusable) or -1
(element is not tab focusable), and not a positive value that interferes with the automatic tab order of elements.keyup
, keydown
or keypress
)mouseout
event handler to also handle blur
events, and any element with a mouseover
event handler to also handle focus
events.