-
-
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 template literal fix can break things #3607
Labels
Comments
This comment was marked as off-topic.
This comment was marked as off-topic.
akx
added a commit
to akx/eslint-plugin-react
that referenced
this issue
Jul 21, 2023
…emplate literals configurable Fixes jsx-eslint#3607
did not realize use case like this until now, thanks for raising and fixing! |
Indeed, I think #3538 needs to be reverted. |
ljharb
pushed a commit
to taozhou-glean/eslint-plugin-react
that referenced
this issue
Jul 23, 2023
…ession template literals" This reverts commit 099b14c / jsx-eslint#3538. Fixes jsx-eslint#3607.
ljharb
pushed a commit
to taozhou-glean/eslint-plugin-react
that referenced
this issue
Jul 24, 2023
…ession template literals" This reverts commit 099b14c / jsx-eslint#3538. Fixes jsx-eslint#3607.
caesar1030
pushed a commit
to caesar1030/eslint-plugin-react
that referenced
this issue
Dec 3, 2023
…ession template literals" This reverts commit 099b14c / jsx-eslint#3538. Fixes jsx-eslint#3607.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there an existing issue for this?
Description Overview
#3538 (see #3537) fixes a template literal with a single placeholder to just be that placeholder.
This can change the semantics of the prop:
casts
foo
to a string (and thus passes"123"
), while the "fixed"passes
foo
as a number123
; when using TypeScript andComponent
expectsfoo: string
, that's a type error. When not using TypeScript, ifComponent
behaves differently with a string prop cf. a number prop, this changes that behavior.This also stands for children:
will be changed to
which can be a type error if
err
is not a valid React child (and when not using TypeScript, it can cause e.g.false
not to get rendered as text.Expected Behavior
Whether template literals with a single placeholder are unwrapped should be configurable.
eslint-plugin-react version
v7.33.0
eslint version
v8.45.0
node version
v20.3.0
The text was updated successfully, but these errors were encountered: