-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Break JSX element if a string literal prop has a newline #4011
Conversation
You might want to review it again, it didn't fix all the cases before :) |
<path | ||
d="M4.765 16.829l3.069-2.946 5.813 5.748 | ||
11.33-11.232 3.006 3.18-14.36 14.080z" | ||
/>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn’t this end up on the same line since jsxBracketSameLine
is true
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope
Prettier 1.10.2
Playground link
--jsx-bracket-same-line
Input:
<C
propA="longlonglonglonglonglonglonglonglong"
propB="longlonglonglonglonglonglonglonglong"
/>;
Output:
<C
propA="longlonglonglonglonglonglonglonglong"
propB="longlonglonglonglonglonglonglonglong"
/>;
That is meant to be visually similar to
<Parent>
<Child />
</Parent>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh OK so it’s only inlined if it’s an opening element.
* 'master' of github.com:prettier/prettier: Add ComputerBase to list of users (prettier#4027) refactor: at rules parse (prettier#4023) refactor(css): printer (prettier#4024) Webstorm now supports Prettier (prettier#4026) Handle definite variable declarations (prettier#4025) fix(css): comments in at rules (prettier#3920) feat(typescript): support definite assignment (`!:`) (prettier#4020) Add support for markdown with pre-commit (prettier#4021) Remove extraneous newline in docs/plugins.md Break JSX element if a string literal prop has a newline (prettier#4011) Add license to website/package.json (prettier#4017) Add Ruby to homepage and code (prettier#4016) Add Google Site Verification file (prettier#4015)
Closes #3803