Skip to content

Commit f01b82d

Browse files
author
Ross Solomon
committed
Add documentation
1 parent 29c659e commit f01b82d

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Validate closing tag location in JSX (react/jsx-closing-tag-location)
2+
3+
Enforce the closing tag location for multiline JSX elements.
4+
5+
**Fixable:** This rule is automatically fixable using the `--fix` flag on the command line.
6+
7+
## Rule Details
8+
9+
This rule checks all JSX multiline elements with children (non-self-closing) and verifies the location of the closing tag. The expectation is that the closing tag is aligned with the opening tag on its own line.
10+
11+
The following patterns are considered warnings:
12+
13+
```jsx
14+
<Hello>
15+
marklar
16+
</Hello>
17+
```
18+
19+
```jsx
20+
<Hello>
21+
marklar</Hello>
22+
```
23+
24+
The following are not considered warnings:
25+
26+
```jsx
27+
<Hello>
28+
marklar
29+
</Hello>
30+
```
31+
32+
```jsx
33+
<Hello>marklar</Hello>
34+
```
35+
36+
## When not to use
37+
38+
If you do not care about closing tag JSX alignment then you can disable this rule.

0 commit comments

Comments
 (0)