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

[Bug]: jsx-curly-brace-presence creating invalid code when auto-fixing #3814

Closed
2 tasks done
dennisoelkers opened this issue Sep 3, 2024 · 4 comments
Closed
2 tasks done
Labels

Comments

@dennisoelkers
Copy link

Is there an existing issue for this?

  • I have searched the existing issues and my issue is unique
  • My issue appears in the command-line and not only in the text editor

Description Overview

In version 7.35.1, #3798 is introducing a regression for us, it is changing:

help={'The maximum time range for searches. (i.e. "P30D" for 30 days, "PT24H" for 24 hours)'}

to

help="The maximum time range for searches. (i.e. "P30D" for 30 days, "PT24H" for 24 hours)"

which is obviously an incorrect string.

Expected Behavior

It should not auto-fix this statement.

eslint-plugin-react version

v7.35.1

eslint version

v8.57.0

node version

v18.20.4

@ljharb
Copy link
Member

ljharb commented Sep 3, 2024

I think it could autofix it, but to escape the double quotes instead? (the longer term fix is to use curly quotes, since straight quotes are never typographically correct in prose)

one way or the other tho, i'll get a fix out.

@ljharb
Copy link
Member

ljharb commented Sep 3, 2024

k yeah, it just has to not autofix it, and you'll need to manually fix the straight quotes.

@ljharb ljharb closed this as completed in cf868f2 Sep 3, 2024
@ljharb
Copy link
Member

ljharb commented Sep 3, 2024

I'll try to get a v7.35.2 out with this today.

ljharb added a commit that referenced this issue Sep 3, 2024
…uble quotes to a double quoted attribute

Fixes #3814

(backport from cf868f2)
@dennisoelkers
Copy link
Author

Thanks for the quick fix and release, @ljharb!

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

No branches or pull requests

2 participants