Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upIncorrect formatting when running ---fix for JSX with missing parentheses (jsx-wrap-multilines) #1382
Comments
This comment has been minimized.
This comment has been minimized.
|
Sorry about the issue here. This is a bug in I'll temporarily disable this rule and release a new version of Note to self: re-add the following rule to "react/jsx-wrap-multilines": ["error", {
"declaration": "parens-new-line",
"assignment": "parens-new-line",
"return": "parens-new-line",
"arrow": "parens-new-line",
"condition": "parens-new-line",
"logical": "ignore",
"prop": "ignore"
}], |
feross
added a commit
to standard/eslint-config-standard-jsx
that referenced
this issue
Aug 22, 2019
This comment has been minimized.
This comment has been minimized.
|
Released |
feross
added
the
blocked
label
Aug 22, 2019
feross
added a commit
that referenced
this issue
Aug 22, 2019
This comment has been minimized.
This comment has been minimized.
|
Thanks @feross, great work on the update by the way! I have noticed something else strange which the Original code:
Formatted code:
I expected this to happen:
Original code:
Formatted code:
I expected this to happen:
|
This comment has been minimized.
This comment has been minimized.
|
@jakefb I agree with your expectations in the first example. As for the second example, we have a rule that ternary operators need to be at the start of the line, like this: const x = condition
? 'true'
: 'falseSo when it comes to JSX, I guess it should format to this? But it's kind of terrible... const Component = props => (
<div>
{true
? (
<div>
<p>Some text</p>
</div>
)
: null}
</div>
) |
jakefb commentedAug 19, 2019
What version of this package are you using?
^14.0.0
What operating system, Node.js, and npm version?
macOS 10.14.5
node v12.8.0
npm 6.10.2
What happened?
It appears that jsx-wrap-multilines #710 has been implemented in standard v14, however when I run
standard --fixthe following happens.Original code:
Formatted code:
What did you expect to happen?
I expected the export statement to be on a newline. Something strange is going on with the JSX formatting as well.
Are you willing to submit a pull request to fix this bug?
I could take a look into it and see if I can find what's causing the issue.