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
+29-28Lines changed: 29 additions & 28 deletions
Original file line number
Diff line number
Diff line change
@@ -47,15 +47,16 @@ _Note: This is experimental and subject to change._
47
47
48
48
The `react` config includes rules which target specific HTML elements. You may provide a mapping of custom components to an HTML element in your `eslintrc` configuration to increase linter coverage.
49
49
50
-
For each component, you may specify a `default` and/or `props`. `default` may make sense if there's a 1:1 mapping between a component and an HTML element. However, if the HTML output of a component is dependent on a prop value, you can provide a mapping using the `props` key. To minimize conflicts and complexity, this currently only supports the mapping of a single prop type.
50
+
By default, these eslint rules will check the "as" prop for underlying element changes. If your repo uses a different prop name for polymorphic components provide the prop name in your `eslintrc` configuration under `polymorphicPropName`.
|[a11y-aria-label-is-well-formatted](docs/rules/a11y-aria-label-is-well-formatted.md)|[aria-label] text should be formatted as you would visual text. | ⚛️ |||
88
-
|[a11y-no-generic-link-text](docs/rules/a11y-no-generic-link-text.md)| disallow generic link text ||| ❌ |
89
-
|[array-foreach](docs/rules/array-foreach.md)| enforce `for..of` loops over `Array.forEach`| ✅ |||
|[require-passive-events](docs/rules/require-passive-events.md)| enforce marking high frequency event handlers as passive | 🔍 |||
106
-
|[role-supports-aria-props](docs/rules/role-supports-aria-props.md)| Enforce that elements with explicit or implicit roles defined contain only `aria-*` properties supported by that `role`. | ⚛️ |||
107
-
|[unescaped-html-literal](docs/rules/unescaped-html-literal.md)| disallow unescaped HTML literals | 🔍 |||
|[a11y-aria-label-is-well-formatted](docs/rules/a11y-aria-label-is-well-formatted.md)|[aria-label] text should be formatted as you would visual text. | ⚛️ |||
87
+
|[a11y-no-generic-link-text](docs/rules/a11y-no-generic-link-text.md)| disallow generic link text ||| ❌ |
88
+
|[a11y-no-visually-hidden-interactive-element](docs/rules/a11y-no-visually-hidden-interactive-element.md)| Ensures that interactive elements are not visually hidden | ⚛️ |||
89
+
|[a11y-svg-has-accessible-name](docs/rules/a11y-svg-has-accessible-name.md)| SVGs must have an accessible name | ⚛️ |||
90
+
|[array-foreach](docs/rules/array-foreach.md)| enforce `for..of` loops over `Array.forEach`| ✅ |||
|[require-passive-events](docs/rules/require-passive-events.md)| enforce marking high frequency event handlers as passive | 🔍 |||
107
+
|[role-supports-aria-props](docs/rules/role-supports-aria-props.md)| Enforce that elements with explicit or implicit roles defined contain only `aria-*` properties supported by that `role`. | ⚛️ |||
108
+
|[unescaped-html-literal](docs/rules/unescaped-html-literal.md)| disallow unescaped HTML literals | 🔍 |||
# Ensures that interactive elements are not visually hidden (`github/a11y-no-visually-hidden-interactive-element`)
2
+
3
+
💼 This rule is enabled in the ⚛️ `react` config.
4
+
5
+
<!-- end auto-generated rule header -->
6
+
7
+
## Rule Details
8
+
9
+
This rule guards against visually hiding interactive elements. If a sighted keyboard user navigates to an interactive element that is visually hidden they might become confused and assume that keyboard focus has been lost.
10
+
11
+
Note: we are not guarding against visually hidden `input` elements at this time. Some visually hidden inputs might cause a false positive (e.g. some file inputs).
12
+
13
+
### Why do we visually hide content?
14
+
15
+
Visually hiding content can be useful when you want to provide information specifically to screen reader users or other assitive technology users while keeping content hidden from sighted users.
16
+
17
+
Applying the following css will visually hide content while still making it accessible to screen reader users.
Copy file name to clipboardExpand all lines: lib/configs/react.js
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,8 @@ module.exports = {
10
10
rules: {
11
11
'jsx-a11y/role-supports-aria-props': 'off',// Override with github/role-supports-aria-props until https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/issues/910 is resolved
0 commit comments