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 upstandard and prettier-standard disagree about react/jsx-indent #941
Comments
This comment has been minimized.
This comment has been minimized.
dadamssg
commented
Jun 29, 2017
•
|
Suggestion that may fix the discrepancy:
Or for this particular code, just spit out the children if they don't really need that surrounding div
Or to make it even more concise
|
This comment has been minimized.
This comment has been minimized.
|
Thanks for the suggestion! Actually, The third version works nicely for this particular component (
Of course, it should be possible to work around this by splitting things into separate components (something like |
This comment has been minimized.
This comment has been minimized.
dadamssg
commented
Jun 29, 2017
|
Ah. Yeah, i'm not familiar with prettier but it removing parenthesis around jsx seems questionable to me. Personally, I would raise an issue in the prettier-standard repo. |
This comment has been minimized.
This comment has been minimized.
laduke
commented
Aug 30, 2017
|
Hmm, I don't think parens can save me. If an element has more properties than fit on one line (or more classes),
|
This comment has been minimized.
This comment has been minimized.
stale
bot
commented
May 10, 2018
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
stale
bot
added
the
stale
label
May 10, 2018
stale
bot
closed this
May 17, 2018
This comment has been minimized.
This comment has been minimized.
|
The indentation rules changed (and were much improved!) in |
drdaeman commentedJun 29, 2017
Hi! I'm trying to use
standard(for linting) andprettier-standard(for automatic beautifying) and while it all works great in general, two tools seem to disagree about JSX.Here's a full class I have, after running
prettier-standard:However
standardcomplies aboutreact/jsx-indent("Expected indentation of 8 space characters but found 10" for "{children}" line) and insists on this indentation:I'm not sure how things work under the hood and which package this is actually related to - so maybe I'm reporting this to a wrong project. Can someone please suggest me how to deal with this inconsistency?
Thanks!