Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upIncorrect multi-line ternary operator indentation #521
Comments
This comment has been minimized.
This comment has been minimized.
|
This looks like a bug in eslint-plugin-react. Can you re-open this issue there? |
feross
closed this
May 16, 2016
This comment has been minimized.
This comment has been minimized.
|
Ah, you're right. Linking in yannickcr/eslint-plugin-react#454 for future reference. |
This comment has been minimized.
This comment has been minimized.
|
Cool, thanks for sharing that link. |
lock
bot
locked as resolved and limited conversation to collaborators
May 10, 2018
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
tvervest commentedMay 16, 2016
I ran into this issue while working with React views and ternary operators. If the react element is multi-lined, I wrap it in parentheses and put the element itself on an indented newline, for better readability.
However, when I do this I get a warning on the opening
litag, statingExpected indentation of 8 space characters, but found 10. (react/jsx-indent). Shouldn't this be correct? It seems very strange to me that thelielement should be on the same depth as the?character of the ternary operator.Example:
Incorrect (according to
standard):Correct (according to
standard):