Fix indent for closing bracket (eslint rule react/jsx-closing-bracket-location)#299
Open
MartinCura wants to merge 2 commits intoorktes:masterfrom
Open
Fix indent for closing bracket (eslint rule react/jsx-closing-bracket-location)#299MartinCura wants to merge 2 commits intoorktes:masterfrom
MartinCura wants to merge 2 commits intoorktes:masterfrom
Conversation
Follow eslint rule jsx-closing-bracket-location [1] by not decreasing indent on a lonely closing bracket. More info in PR. [1] https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-closing-bracket-location.md
Decrease the indentation when inserting simply '/>', so that in the flow of typing it aligns with the opening bracket for a multi-line self-closing element. Check PR for more info.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow eslint rule react/jsx-closing-bracket-location [1] by decreasing indent for a lonely closing bracket and not doing so for its next line. Fixes #129, fixes #210, fixes #284.
If a multi-line element is self-closing, the closing bracket should be aligned with the opening bracket. And because of this, there's no need to decrease the indent on the next line (less so automatically each time one types anything).
For example, under the previous behaviour:
If one where to correct it manually, the next line would be problematic:
New behaviour:
Checked for test regressions ✔️
Previous fix in #131 was rollbacked.
Anything i can help with so that this is merged, please tell me!
[1] https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-closing-bracket-location.md