Last } is not on its own line for JSX
See original GitHub issueI sometimes use the following format in JSX:
{booleanValue &&
<div>only show this when booleanValue is true</div>
}
currently prettier outputs this in the following way:
{booleanValue &&
<div>only show this when booleanValue is true</div>}
IMO I think the output should stay in the initial format.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:11
- Comments:6 (1 by maintainers)
Top Results From Across the Web
newlines character ignored by jsx table - Stack Overflow
It's worth noting that white-space: pre will preserve your newlines, but it causes your text to no longer wrap. This means, provided it's...
Read more >Conditional Rendering - React
Conditional rendering in React works the same way conditions work in JavaScript. Use JavaScript operators like if or the conditional operator to create ......
Read more >eslint-plugin-react/jsx-first-prop-new-line.md at master - GitHub
eslint-plugin-react/docs/rules/jsx-first-prop-new-line.md ... This rule checks whether the first property of all JSX elements is correctly placed.
Read more >How To Create Custom Components in React - DigitalOcean
Now each component has its own directory, but not everything is fully independent. The last step is to extract the CSS for Instructions...
Read more >Text - React Native
baseText , but the title provides its own additional styles. ... clip - Lines are not drawn past the edge of the text...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
for what it’s worth, I’ve seen the latter way more often in examples/actual code.
I wouldn’t consider the former an option just because it sort of convolutes two bracket styles. I’d say it’s either your latter or:
but that’s unnecessarily verbose. In short, I’d say it’s right as-is.
Similar behavior has been merged in #2398 , closing