sheerun / prettier-standard

Formats with Prettier and lints with ESLint+Standard! (✿◠‿◠)
MIT License
868 stars 44 forks source link

JSX Fragments cause formatting errors #66

Closed ggascoigne closed 5 years ago

ggascoigne commented 5 years ago

Prettier-standard generates incorrect code when it sees an abbreviated react fragment.

    <>
        <div>
            ... some content
        </div>
    </>

gets formatted as

    <>'        '<div>
            ... some content
        </div>'    '</>

causing whitespace and quotes to be injected into the result.

Switching to generates the correct result and is a viable work-around.

It would be nice if the abbreviated syntax worked correctly.

Tested using prettier-standard 8.0.1

There's a somewhat related bug on prettier which was fixed a while ago.

https://github.com/prettier/prettier/issues/3341

rafaelrinaldi commented 5 years ago

I'm running into the same issue.

sheerun commented 5 years ago

prettier-standard 9.0.0 uses newest version of prettier so it should fix this problem