You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,7 +74,11 @@ Then configure the rules you want to use under the rules section.
74
74
-[label-uses-for](docs/rules/label-uses-for.md): Enforce that label elements have the htmlFor attribute
75
75
-[redundant-alt](docs/rules/redundant-alt.md): Enforce img alt attribute does not contain the word image, picture, or photo.
76
76
-[no-hash-href](docs/rules/no-hash-href.md): Enforce an anchor element's href prop value is not just #.
77
+
-[no-invalid-aria](docs/rules/no-invalid-aria.md): Enforce all aria-* properties are valid.
77
78
-[valid-aria-role](docs/rules/valid-aria-role.md): Enforce that elements with ARIA roles must use a valid, non-abstract ARIA role.
79
+
-[valid-aria-proptype](docs/rules/valid-aria-proptype.md): Enforce ARIA state and property values are valid.
80
+
-[role-requires-aria](docs/rules/role-requires-aria.md): Enforce that elements with ARIA roles must have all required attributes for that role.
81
+
-[no-unsupported-elements-use-aria](docs/rules/no-unsupported-elements-use-aria.md): Enforce that elements that do not support ARIA roles, states and properties do not have those attributes.
78
82
79
83
## Contributing
80
84
Feel free to contribute! I am currently using [Google Chrome's Audit Rules](https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules) to map out as rules for this plugin.
Elements cannot use an invalid ARIA attribute. This will fail if it finds an `aria-*` property that is not listed in [WAI-ARIA States and Properties spec](https://www.w3.org/TR/wai-aria/states_and_properties#state_prop_def).
4
+
5
+
## Rule details
6
+
7
+
This rule takes no arguments.
8
+
9
+
### Succeed
10
+
```jsx
11
+
<!-- Good: Labeled using correctly spelled aria-labelledby -->
12
+
<div id="address_label">Enter your address</div>
13
+
<input aria-labelledby="address_label">
14
+
```
15
+
16
+
### Fail
17
+
18
+
```jsx
19
+
<!-- Bad: Labeled using incorrectly spelled aria-labeledby -->
Certain reserved DOM elements do not support ARIA roles, states and properties. This is often because they are not visible, for example `meta`, `html`, `script`, `style`. This rule enforces that these DOM elements do not contain the `role` and/or `aria-*` props.
0 commit comments