Permalink
January 18, 2023 20:50
Newer
100644
31 lines (21 sloc)
926 Bytes
Ignoring revisions in .git-blame-ignore-revs.
1
# jsx-a11y/role-has-required-aria-props
2
3
💼 This rule is enabled in the following configs: ☑️ `recommended`, 🔒 `strict`.
4
5
<!-- end auto-generated rule header -->
6
7
Elements with ARIA roles must have all required attributes for that role.
8
9
## Rule details
10
11
This rule takes no arguments.
12
13
### Succeed
14
```jsx
15
<!-- Good: the checkbox role requires the aria-checked state -->
16
<span role="checkbox" aria-checked="false" aria-labelledby="foo" tabindex="0"></span>
17
```
18
19
### Fail
20
21
```jsx
22
<!-- Bad: the checkbox role requires the aria-checked state -->
23
<span role="checkbox" aria-labelledby="foo" tabindex="0"></span>
24
```
25
26
## Accessibility guidelines
27
- [WCAG 4.1.2](https://www.w3.org/WAI/WCAG21/Understanding/name-role-value)
28
29
### Resources
30
- [ARIA Spec, Roles](https://www.w3.org/TR/wai-aria/#roles)
31
- [Chrome Audit Rules, AX_ARIA_03](https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_aria_03)