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
|[accessible-emoji](docs/rules/accessible-emoji.md)|Enforce emojis are wrapped in `<span>` and provide screenreader access.|| ❌ |
124
124
|[alt-text](docs/rules/alt-text.md)| Enforce all elements that require alternative text have meaningful information to relay back to end user. | ☑️ 🔒 ||
125
125
|[anchor-ambiguous-text](docs/rules/anchor-ambiguous-text.md)| Enforce `<a>` text to not exactly match "click here", "here", "link", or "a link". |||
126
126
|[anchor-has-content](docs/rules/anchor-has-content.md)| Enforce all anchors to contain accessible content. | ☑️ 🔒 ||
@@ -139,7 +139,7 @@ configuration file by mapping each custom component name to a DOM element type.
139
139
|[img-redundant-alt](docs/rules/img-redundant-alt.md)| Enforce `<img>` alt prop does not contain the word "image", "picture", or "photo". | ☑️ 🔒 ||
140
140
|[interactive-supports-focus](docs/rules/interactive-supports-focus.md)| Enforce that elements with interactive handlers like `onClick` must be focusable. | ☑️ 🔒 ||
141
141
|[label-has-associated-control](docs/rules/label-has-associated-control.md)| Enforce that a `label` tag has a text label and an associated control. | ☑️ 🔒 ||
|[label-has-for](docs/rules/label-has-for.md)|Enforce that `<label>` elements have the `htmlFor` prop.|| ❌ |
143
143
|[lang](docs/rules/lang.md)| Enforce lang attribute has a valid value. |||
144
144
|[media-has-caption](docs/rules/media-has-caption.md)| Enforces that `<audio>` and `<video>` elements must have a `<track>` for captions. | ☑️ 🔒 ||
145
145
|[mouse-events-have-key-events](docs/rules/mouse-events-have-key-events.md)| Enforce that `onMouseOver`/`onMouseOut` are accompanied by `onFocus`/`onBlur` for keyboard-only users. | ☑️ 🔒 ||
@@ -153,7 +153,7 @@ configuration file by mapping each custom component name to a DOM element type.
153
153
|[no-onchange](docs/rules/no-onchange.md)| Enforce usage of `onBlur` over `onChange` on select menus for accessibility. || ❌ |
154
154
|[no-redundant-roles](docs/rules/no-redundant-roles.md)| Enforce explicit role property is not the same as implicit/default role property on element. | ☑️ 🔒 ||
155
155
|[no-static-element-interactions](docs/rules/no-static-element-interactions.md)| Enforce that non-interactive, visible elements (such as `<div>`) that have click handlers use the role attribute. | ☑️ 🔒 ||
|[prefer-tag-over-role](docs/rules/prefer-tag-over-role.md)|Enforces using semantic DOM elements over the ARIA `role` property.|||
157
157
|[role-has-required-aria-props](docs/rules/role-has-required-aria-props.md)| Enforce that elements with ARIA roles must have all required attributes for that role. | ☑️ 🔒 ||
158
158
|[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`. | ☑️ 🔒 ||
159
159
|[scope](docs/rules/scope.md)| Enforce `scope` prop is only used on `<th>` elements. | ☑️ 🔒 ||
Copy file name to clipboardExpand all lines: docs/rules/label-has-for.md
+7-2
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
1
# jsx-a11y/label-has-for
2
2
3
-
❌ This rule is deprecated.
3
+
❌ This rule is deprecated. It was replaced by [`label-has-associated-control`](label-has-associated-control.md).
4
4
5
5
💼 This rule is _disabled_ in the following configs: ☑️ `recommended`, 🔒 `strict`.
6
6
7
7
<!-- end auto-generated rule header -->
8
8
9
-
*This rule was deprecated in v6.1.0. It will no longer be maintained. Please use [`label-has-associated-control`](label-has-associated-control.md) instead.*
9
+
_This rule was deprecated in v6.1.0. It will no longer be maintained._
10
10
11
11
Enforce label tags have associated control.
12
12
@@ -81,13 +81,15 @@ However, if `allowChildren` is set to `true`, no error will be raised. If you wa
81
81
Note that passing props as spread attribute without `htmlFor` explicitly defined will cause this rule to fail. Explicitly pass down `htmlFor` prop for rule to pass. The prop must have an actual value to pass. Use `Label` component above as a reference. **It is a good thing to explicitly pass props that you expect to be passed for self-documentation.** For example:
0 commit comments