Skip to content

Commit 2b7f6b7

Browse files
authored
Merge branch 'master' into fix-634
2 parents 381b9d6 + 592c2cc commit 2b7f6b7

38 files changed

+251
-130
lines changed

__tests__/src/rules/autocomplete-valid-test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ ruleTester.run('autocomplete-valid', rule, {
5454
{ code: '<input type="text" autocomplete="invalid name" />;', errors: invalidAutocomplete },
5555
{ code: '<input type="text" autocomplete="home url" />;', errors: invalidAutocomplete },
5656
{ code: '<Bar autocomplete="baz"></Bar>;', errors: invalidAutocomplete, options: [{ inputComponents: ['Bar'] }] },
57+
{ code: '<input type={isEmail ? "email" : "text"} autocomplete="none" />;', errors: invalidAutocomplete },
5758

5859
// FAILED "autocomplete-appropriate"
5960
{ code: '<input type="date" autocomplete="email" />;', errors: inappropriateAutocomplete },

docs/rules/accessible-emoji.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# [Deprecated] accessible-emoji
22

3-
Emoji have become a common way of communicating content to the end user. To a person using a screenreader, however, he/she may not be aware that this content is there at all. By wrapping the emoji in a `<span>`, giving it the `role="img"`, and providing a useful description in `aria-label`, the screenreader will treat the emoji as an image in the accessibility tree with an accessible name for the end user.
4-
5-
#### Resources
6-
1. [Léonie Watson](http://tink.uk/accessible-emoji/)
3+
Emoji have become a common way of communicating content to the end user. To a person using a screenreader, however, they may not be aware that this content is there at all. By wrapping the emoji in a `<span>`, giving it the `role="img"`, and providing a useful description in `aria-label`, the screenreader will treat the emoji as an image in the accessibility tree with an accessible name for the end user.
74

85
## Rule details
96

@@ -21,3 +18,9 @@ This rule takes no arguments.
2118
<span>🐼</span>
2219
<i role="img" aria-label="Panda">🐼</i>
2320
```
21+
22+
## Accessibility guidelines
23+
- [WCAG 1.1.1](https://www.w3.org/WAI/WCAG21/Understanding/non-text-content.html)
24+
25+
### Resources
26+
- [Léonie Watson, Accessible Emoji](http://tink.uk/accessible-emoji/)

docs/rules/alt-text.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22

33
Enforce that all elements that require alternative text have meaningful information to relay back to the end user. This is a critical component of accessibility for screenreader users in order for them to understand the content's purpose on the page. By default, this rule checks for alternative text on the following elements: `<img>`, `<area>`, `<input type="image">`, and `<object>`.
44

5-
#### Resources
6-
1. [axe-core, object-alt](https://dequeuniversity.com/rules/axe/3.2/object-alt)
7-
2. [axe-core, image-alt](https://dequeuniversity.com/rules/axe/3.2/image-alt)
8-
3. [axe-core, input-image-alt](https://dequeuniversity.com/rules/axe/3.2/input-image-alt)
9-
4. [axe-core, area-alt](https://dequeuniversity.com/rules/axe/3.2/area-alt)
10-
115
## How to resolve
126
### `<img>`
137
An `<img>` must have the `alt` prop set with meaningful text or as an empty string to indicate that it is an image for decoration.
@@ -141,3 +135,12 @@ function Foo(props) {
141135

142136
<input type="image" {...props} />
143137
```
138+
139+
## Accessibility guidelines
140+
- [WCAG 1.1.1](https://www.w3.org/WAI/WCAG21/Understanding/non-text-content.html)
141+
142+
### Resources
143+
- [axe-core, object-alt](https://dequeuniversity.com/rules/axe/3.2/object-alt)
144+
- [axe-core, image-alt](https://dequeuniversity.com/rules/axe/3.2/image-alt)
145+
- [axe-core, input-image-alt](https://dequeuniversity.com/rules/axe/3.2/input-image-alt)
146+
- [axe-core, area-alt](https://dequeuniversity.com/rules/axe/3.2/area-alt)

docs/rules/anchor-has-content.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
Enforce that anchors have content and that the content is accessible to screen readers. Accessible means that it is not hidden using the `aria-hidden` prop. Refer to the references to learn about why this is important.
44

5-
#### References
6-
1. [axe-core, link-name](https://dequeuniversity.com/rules/axe/3.2/link-name)
7-
85
## Rule details
96

107
This rule takes one optional object argument of type object:
@@ -51,3 +48,9 @@ return (
5148
<a />
5249
<a><TextWrapper aria-hidden /></a>
5350
```
51+
## Accessibility guidelines
52+
- [WCAG 2.4.4](https://www.w3.org/WAI/WCAG21/Understanding/link-purpose-in-context)
53+
- [WCAG 4.1.2](https://www.w3.org/WAI/WCAG21/Understanding/name-role-value)
54+
55+
### Resources
56+
- [axe-core, link-name](https://dequeuniversity.com/rules/axe/3.2/link-name)

docs/rules/anchor-is-valid.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,6 @@ This button element can now also be used inline in text.
128128

129129
Once again we stress that this is an inferior implementation and some users will encounter difficulty to use your website, however, it will allow a larger group of people to interact with your website than the alternative of ignoring the rule's warning.
130130

131-
132-
### References
133-
1. [WebAIM - Introduction to Links and Hypertext](http://webaim.org/techniques/hypertext/)
134-
1. [Links vs. Buttons in Modern Web Applications](https://marcysutton.com/links-vs-buttons-in-modern-web-applications/)
135-
1. [Using ARIA - Notes on ARIA use in HTML](https://www.w3.org/TR/using-aria/#NOTES)
136-
137131
## Rule details
138132

139133
This rule takes one optional object argument of type object:
@@ -221,4 +215,12 @@ Invalid `href` attribute:
221215
<a href="javascript:void(0)" />
222216
<a href={"javascript:void(0)"} />
223217
<a href={`javascript:void(0)`} />
224-
```
218+
```
219+
220+
## Accessibility guidelines
221+
- [WCAG 2.1.1](https://www.w3.org/WAI/WCAG21/Understanding/keyboard)
222+
223+
### Resources
224+
- [WebAIM - Introduction to Links and Hypertext](http://webaim.org/techniques/hypertext/)
225+
- [Links vs. Buttons in Modern Web Applications](https://marcysutton.com/links-vs-buttons-in-modern-web-applications/)
226+
- [Using ARIA - Notes on ARIA use in HTML](https://www.w3.org/TR/using-aria/#NOTES)

docs/rules/aria-activedescendant-has-tabindex.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ Because an element with `aria-activedescendant` must be tabbable, it must either
1414
have an inherent `tabIndex` of zero or declare a `tabIndex` of zero with the `tabIndex`
1515
attribute.
1616

17-
#### References
18-
1. [MDN](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-activedescendant_attribute)
19-
2017
## Rule details
2118

2219
This rule takes no arguments.
@@ -44,3 +41,9 @@ This rule takes no arguments.
4441
<div aria-activedescendant={someID} tabIndex="-1" />
4542
<input aria-activedescendant={someID} tabIndex={-1} />
4643
```
44+
45+
## Accessibility guidelines
46+
General best practice (reference resources)
47+
48+
### Resources
49+
- [MDN, Using the aria-activedescendant attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-activedescendant_attribute)

docs/rules/aria-props.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,6 @@ This rule takes no arguments.
2020
<div id="address_label">Enter your address</div>
2121
<input aria-labeledby="address_label">
2222
```
23+
24+
## Accessibility guidelines
25+
- [WCAG 4.1.2](https://www.w3.org/WAI/WCAG21/Understanding/name-role-value)

docs/rules/aria-proptypes.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
ARIA state and property values must be valid.
44

5-
#### References
6-
1. [Spec](https://www.w3.org/TR/wai-aria/#states_and_properties)
7-
2. [AX_ARIA_04](https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_aria_04)
8-
95
## Rule details
106

117
This rule takes no arguments.
@@ -22,3 +18,9 @@ This rule takes no arguments.
2218
<span aria-hidden="yes">foo</span>
2319
```
2420

21+
## Accessibility guidelines
22+
- [WCAG 4.1.2](https://www.w3.org/WAI/WCAG21/Understanding/name-role-value)
23+
24+
### Resources
25+
- [ARIA Spec, States and Properties](https://www.w3.org/TR/wai-aria/#states_and_properties)
26+
- [Chrome Audit Rules, AX_ARIA_04](https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_aria_04)

docs/rules/aria-role.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
Elements with ARIA roles must use a valid, non-abstract ARIA role. A reference to role definitions can be found at [WAI-ARIA](https://www.w3.org/TR/wai-aria/#role_definitions) site.
44

5-
[AX_ARIA_01](https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_aria_01)
6-
[DPUB-ARIA roles](https://www.w3.org/TR/dpub-aria-1.0/)
7-
85
## Rule details
96

107
This rule takes one optional object argument of type object:
@@ -37,3 +34,10 @@ For the `ignoreNonDOM` option, this determines if developer created components a
3734
<div role=""></div> <!-- Bad: An empty ARIA role is not allowed -->
3835
<Foo role={role}></Foo> <!-- Bad: ignoreNonDOM is set to false or not set -->
3936
```
37+
38+
## Accessibility guidelines
39+
- [WCAG 4.1.2](https://www.w3.org/WAI/WCAG21/Understanding/name-role-value)
40+
41+
### Resources
42+
- [Chrome Audit Rules, AX_ARIA_01](https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_aria_01)
43+
- [DPUB-ARIA roles](https://www.w3.org/TR/dpub-aria-1.0/)

docs/rules/aria-unsupported-elements.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
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.
44

5-
#### References
6-
1. [AX_ARIA_12](https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_aria_12)
7-
85
## Rule details
96

107
This rule takes no arguments.
@@ -21,3 +18,9 @@ This rule takes no arguments.
2118
<meta charset="UTF-8" aria-hidden="false" />
2219
```
2320

21+
## Accessibility guidelines
22+
- [WCAG 4.1.2](https://www.w3.org/WAI/WCAG21/Understanding/name-role-value)
23+
24+
### Resources
25+
- [Chrome Audit Rules, AX_ARIA_12](https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_aria_12)
26+
- [DPUB-ARIA roles](https://www.w3.org/TR/dpub-aria-1.0/)

0 commit comments

Comments
 (0)