-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
still warns on strings containing unescaped entities
#3801
Comments
|
Wow yeah, you're right. I had |
|
No I meant that |
hmm - why? because of no-unescaped entities? straight quotes shouldn't ever appear in prose anyways, they're typographically incorrect - what's the actual context here for a lone single quote in a p tag? |
What do you mean? The error is still triggered in things like |
Because template literals shouldn't be (and basically aren't) used for one line strings with no substitutions.
|
Then why does
I don't think this nit is relevant to the issue tbh. My main concern here is inconsistency. |
I suppose we could adjust it so that one-line template literals with no substitutions still warn - but I'm skeptical anyone would benefit from that, because mostly nobody uses backticks for that case in the first place. |
Is there an existing issue for this?
Description Overview
This commit: fe708e1 adds a special case that is supposed to allow plain string literals inside JSX expressions if it contains unescaped HTML entities:
Previously, the warning will yield the following invalid JSX when "fixed":
The issue still remains because the special case only considers strings quoted with backticks but not normal quotes
Related issue: #3214
Expected Behavior
This should not trigger a warning:
eslint-plugin-react version
v7.34.0
eslint version
v8.57.0
node version
v20.15.1
The text was updated successfully, but these errors were encountered: