Skip to content
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

Incorrect formatting with --fix for JSX with missing parentheses (jsx-wrap-multilines) #2390

Closed
feross opened this issue Aug 22, 2019 · 1 comment · Fixed by #2392
Closed

Comments

@feross
Copy link

feross commented Aug 22, 2019

What version of this package are we using?

7.14.3

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 has an issue when used with eslint --fix. Specifically, the following happens"

Original code:

const Component = () =>
  <div>
    <p>Some text</p>
  </div>

export { Component as default }

Formatted code:

const Component = () => (
<div>
    <p>Some text</p>
  </div>
)export { Component as default }

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.

Related issue: standard/standard#1382

@ljharb
Copy link
Member

ljharb commented Aug 22, 2019

Good catch; the rule was probably authored assuming semicolon usage, since that's what's most common. This definitely should be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants