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: docs/rules/label-has-associated-control.md
-2
Original file line number
Diff line number
Diff line change
@@ -53,7 +53,6 @@ And the configuration:
53
53
{
54
54
"rules": {
55
55
"jsx-a11y/label-has-associated-control": [ 2, {
56
-
"htmlForAttributes": ["htmlFor", "for"],
57
56
"labelComponents": ["CustomInputLabel"],
58
57
"labelAttributes": ["label"],
59
58
"controlComponents": ["CustomInput"],
@@ -104,7 +103,6 @@ This rule takes one optional object argument of type object:
104
103
}
105
104
```
106
105
107
-
`htmlForAttributes`: is an array of strings that specify the attribute to check for an associated control. Default is `["htmlFor"]`.
108
106
`labelComponents` is a list of custom React Component names that should be checked for an associated control.
109
107
`labelAttributes` is a list of attributes to check on the label component and its children for a label. Use this if you have a custom component that uses a string passed on a prop to render an HTML `label`, for example.
110
108
`controlComponents` is a list of custom React Components names that will output an input element. [Glob format](https://linuxhint.com/bash_globbing_tutorial/) is also supported for specifying names (e.g., `Label*` matches `LabelComponent` but not `CustomLabel`, `????Label` matches `LinkLabel` but not `CustomLabel`).
Copy file name to clipboardExpand all lines: docs/rules/label-has-for.md
-3
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,6 @@ This rule takes one optional object argument of type object:
25
25
{
26
26
"rules": {
27
27
"jsx-a11y/label-has-for": [ 2, {
28
-
"htmlForAttributes": ["htmlFor", "for"],
29
28
"components": [ "Label" ],
30
29
"required": {
31
30
"every": [ "nesting", "id" ]
@@ -36,8 +35,6 @@ This rule takes one optional object argument of type object:
36
35
}
37
36
```
38
37
39
-
The `htmlForAttributes` allows you to specify which prop to check for. This is useful when you want to use a different property instead of `htmlFor`, for example `for`.
40
-
41
38
For the `components` option, these strings determine which JSX elements (**always including**`<label>`) should be checked for having `htmlFor` prop. This is a good use case when you have a wrapper component that simply renders a `label` element (like in React):
0 commit comments