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

react/jsx-curly-brace-presence autofix removes comments #2885

Closed
blixt opened this issue Dec 23, 2020 · 1 comment · Fixed by #2900
Closed

react/jsx-curly-brace-presence autofix removes comments #2885

blixt opened this issue Dec 23, 2020 · 1 comment · Fixed by #2900

Comments

@blixt
Copy link

blixt commented Dec 23, 2020

The autofix probably shouldn't delete comments just because the curly braces wouldn't be necessary if the comment wasn't there.

{
    /* This is a very important note on the use of the below component. */
    <Component />
}

becomes

<Component />
@ljharb
Copy link
Member

ljharb commented Dec 23, 2020

I agree; I’d say that in this case, the comment makes the curly braces necessary.

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