Skip to content

Commit 35025de

Browse files
committed
Update jsx-indent documentation
1 parent 9d74b89 commit 35025de

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

docs/rules/jsx-indent.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@ The following patterns are considered warnings:
3131
## Rule Options
3232

3333
It takes an option as the second parameter which can be `"tab"` for tab-based indentation or a positive number for space indentations.
34+
To enable checking the indentation of attributes, use the third parameter to turn on the `checkAttributes` option (default is false).
3435

3536
```js
3637
...
37-
"react/jsx-indent": [<enabled>, 'tab'|<number>]
38+
"react/jsx-indent": [<enabled>, 'tab'|<number>, {checkAttributes: <boolean>}]
3839
...
3940
```
4041

@@ -52,6 +53,14 @@ The following patterns are considered warnings:
5253
<App>
5354
<Hello />
5455
</App>
56+
57+
// [2, 2, {checkAttributes: true}]
58+
<App render={
59+
<Hello render={
60+
(bar) => <div>hi</div>
61+
}
62+
/>
63+
</App>
5564
```
5665
5766
The following patterns are **not** warnings:
@@ -75,6 +84,14 @@ The following patterns are **not** warnings:
7584
<App>
7685
<Hello />
7786
</App>
87+
88+
// [2, 2, {checkAttributes: false}]
89+
<App render={
90+
<Hello render={
91+
(bar) => <div>hi</div>
92+
}
93+
/>
94+
</App>
7895
```
7996
8097
## When not to use

0 commit comments

Comments
 (0)