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/jsx-boolean-value.md
+7-5Lines changed: 7 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -6,27 +6,29 @@
6
6
7
7
## Rule Details
8
8
9
-
This rule takes one argument. If it is `"always"` then it warns whenever an attribute is missing its value. If `"never"` then it warns if an attribute has a `true` value. The default value of this option is `"never"`.
9
+
This rule takes two arguments. If the first argument is `"always"` then it warns whenever an attribute is missing its value. If `"never"` then it warns if an attribute has a `true` value. The default value of this option is `"never"`.
10
10
11
-
The following patterns are considered warnings when configured `"never"`:
11
+
The second argument is optional: if provided, it must be an object with a `"never"` property (if the first argument is `"always"`), or an `"always"` property (if the first argument is `"never"`). This property’s value must be an array of strings representing prop names.
12
+
13
+
The following patterns are considered warnings when configured `"never"`, or with `"always", { "never": ["personal"] }`:
12
14
13
15
```jsx
14
16
var Hello =<Hello personal={true} />;
15
17
```
16
18
17
-
The following patterns are not considered warnings when configured `"never"`:
19
+
The following patterns are not considered warnings when configured `"never"`, or with `"always", { "never": ["personal"] }`:
18
20
19
21
```jsx
20
22
var Hello =<Hello personal />;
21
23
```
22
24
23
-
The following patterns are considered warnings when configured `"always"`:
25
+
The following patterns are considered warnings when configured `"always"`, or with `"never", { "always": ["personal"] }`:
24
26
25
27
```jsx
26
28
var Hello =<Hello personal />;
27
29
```
28
30
29
-
The following patterns are not considered warnings when configured `"always"`:
31
+
The following patterns are not considered warnings when configured `"always"`, or with `"never", { "always": ["personal"] }`:
0 commit comments