Replies: 2 comments 14 replies
-
I'm wondering why following one can change format... diff --git a/src/language-js/print/jsx.js b/src/language-js/print/jsx.js
index 424756498..e78915c65 100644
--- a/src/language-js/print/jsx.js
+++ b/src/language-js/print/jsx.js
@@ -258,12 +258,12 @@ function printJsxElementInternal(path, options, print) {
return content;
}
- const multiLineElem = group([
+ const multiLineElem = [
openingLines,
indent([hardline, content]),
hardline,
closingLines,
- ]);
+ ];
if (forcedBreak) {
return multiLineElem; ↓test result x = (
<div>
<div className="first" tabIndex="1">
First
- </div>
- -
- <div className="second" tabIndex="2">
+ </div>-<div className="second" tabIndex="2">
Second
</div>
</div>
);
x = (
<div>
<div className="first" tabIndex="1">
First
- </div>
- -
- <div className="second" tabIndex="2">
+ </div>-<div className="second" tabIndex="2">
Second
</div>
</div>
);
x = (
<div>
<div className="first" tabIndex="1">
First
- </div>
- -
- <div className="second" tabIndex="2">
+ </div>-<div className="second" tabIndex="2">
Second
</div>
</div>
); <Hello>
test <World /> test
- </Hello>
- 123
+ </Hello>123 |
Beta Was this translation helpful? Give feedback.
10 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Isn't it helpful if #15795 and similar problems can be detected by defining internal ESLint rule?
I might try to implement it if members agree.
Beta Was this translation helpful? Give feedback.
All reactions