bracketSpacing doesn't add spaces within JSX codeblocks
See original GitHub issuePrettier v0.19.0 with bracketSpacing
enabled:
function Foo() {
return (
<div>
{foo &&
<p>some very long text here so we can see it wrapped, lol lol lol.</p>}
</div>
);
}
Call me picky but I’d expect something like this:
function Foo() {
return (
<div>
{ foo &&
<p>some very long text here so we can see it wrapped, lol lol lol.</p> }
</div>
);
}
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Unable to put space after open the curly braces
Hello, is the first time when i use codeblocks and i have a problem. When ai write a code and i open curly...
Read more >Options - Prettier
(Tabs will be used for indentation but Prettier uses spaces to align things, such as in ternaries.) Semicolons. Print semicolons at the ends...
Read more >VS Code - Code Formatting space before curly braces
If you have a .prettierrc file, you can set bracket spacing property to true module.
Read more >fs_prettier - npm
Start using fs_prettier in your project by running `npm i fs_prettier`. ... “I always put spaces in the wrong place, now I don't...
Read more >How To Customize ESLint Rules with an Ejected Create React ...
Sadly you can't integrate Prettier, change rules to fit your team's style and you're locked into the version Create React App deems as...
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
{expression}
in JSX is similar to(expresson)
in JS. Along this line of argument, there shouldn’t be spaces around expression surrounded by {}.Do we want this? bracketSpacing was only intended to object/array literals mainly. It doesn’t mean unconditional spaces. I’ve honestly never seen JSX written that way.