Navigation Menu

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

jsx-curly-brace-presence conflicts with no-unescaped-entities #3214

Closed
ntkoopman opened this issue Feb 22, 2022 · 2 comments
Closed

jsx-curly-brace-presence conflicts with no-unescaped-entities #3214

ntkoopman opened this issue Feb 22, 2022 · 2 comments
Labels

Comments

@ntkoopman
Copy link

With both jsx-curly-brace-presence and no-unescaped-entities turned on

<script>{`window.foo = "bar"`}</script>

is fixed into

<script>window.foo = "bar"</script>

which works fine, but will give a warning/error on no-unescaped-entities.

It is my understanding that jsx-curly-brace-presence should not be triggering on this code, since the documentation says:

If the rule is set to get rid of unnecessary curly braces(JSX expression) and there are characters that need to be escaped in its JSX form, such as quote characters, forbidden JSX text characters, escaped characters and anything that looks like HTML entity names, the code will not be warned because the fix may make the code less readable.

https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-brace-presence.md

@aprilmintacpineda
Copy link

This is still happening though.

image

After fixing the jsx-curly-brace-presence error

image

@ljharb
Copy link
Member

ljharb commented Feb 13, 2023

@aprilmintacpineda can you be sure you’re on the latest version, and file a new issue if it’s still a problem?

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

3 participants