Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ross Solomon
committed
May 20, 2017
1 parent
29c659e
commit f01b82d
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Validate closing tag location in JSX (react/jsx-closing-tag-location) | ||
|
||
Enforce the closing tag location for multiline JSX elements. | ||
|
||
**Fixable:** This rule is automatically fixable using the `--fix` flag on the command line. | ||
|
||
## Rule Details | ||
|
||
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. | ||
|
||
The following patterns are considered warnings: | ||
|
||
```jsx | ||
<Hello> | ||
marklar | ||
</Hello> | ||
``` | ||
|
||
```jsx | ||
<Hello> | ||
marklar</Hello> | ||
``` | ||
|
||
The following are not considered warnings: | ||
|
||
```jsx | ||
<Hello> | ||
marklar | ||
</Hello> | ||
``` | ||
|
||
```jsx | ||
<Hello>marklar</Hello> | ||
``` | ||
|
||
## When not to use | ||
|
||
If you do not care about closing tag JSX alignment then you can disable this rule. |