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
# 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