jsx conditions formatted strange with tabWidth > 2
See original GitHub issueWith printWidth=2 everything works great, but we use tabWidth=4 and some jsx looks very weird.
Input:
function test() {
return <div>{ a ? <a with-long-attributes="long-value-to-break" and-one-more="test"/> : null }</div>;
}
Output:
function test() {
return (
<div>
{a
? <a
with-long-attributes="long-value-to-break"
and-one-more="test"
/>
: null}
</div>
);
}
Expected:
function test() {
return (
<div>
{a
? <a
with-long-attributes="long-value-to-break"
and-one-more="test"
/>
: null}
</div>
);
}
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Is there a Prettier setting that prevents the automatic wrapping ...
In my opinion it's a nice tool if you have a codebase without proper formatting and you want to reformat it quickly. However,...
Read more >Conditional Rendering - React
Use JavaScript operators like if or the conditional operator to create elements representing the current state, and let React update the UI to...
Read more >prettier/CHANGELOG.md at main - GitHub
The formatting added in Prettier 1.16 would format any function receiving an arrow function and an array literal to match React Hook's documentation....
Read more >A tale of React.js development using Webpack 4. Updated.
How to streamline your development process with webpack v4, ESLint, React 16 ... some weird indentation and press save, it should automatically format...
Read more >nth-child - CSS-Tricks
Keywords “even” and “odd” are straightforward (2, 4, 6, ... ability to select the :nth-child of a subset of elements, using the of...
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
Tried master branch on my project. JSX now looks awesome! Thanks guys!
So I guess this is what @jlongster meant when he said “tabs make this whole project pretty hard” 😃
Well, I had to add a new primitive “align-spaces” for this purpose, and when using tabs I will use always one tab (as was done before).