-
-
Notifications
You must be signed in to change notification settings - Fork 511
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
💅 lint/complexity/noUselessFragments
recommends removing useful fragments
#4059
Comments
Ran into the same issue. In an expression you can use |
Is there a reason why you use that instead of |
But do you have a demo in a react JSX project that causes that? |
I don't see why the playground link supplied with the issue is insufficient |
Two reasons:
|
Here's one: import * as React from "react"
const myStrings = [ "foo", "bar", undefined, "baz" ] as const
export default function TestPage() {
return <div>
{myStrings.map((value, index) =>
<div>
{value ?? <> </>}
</div>
)}
</div>
} The blank line is desired. With I hope you understand this is just one example, and
That was something of a jest on my part, so I'm sorry it confused you. |
i'll work on this. |
Environment information
Rule name
lint/complexity/noUselessFragments
Playground link
Link
Expected result
Fragments containing HTML escapes (e.g.
) inside expression escapes{ ... }
should not be considered useless.Code of Conduct
The text was updated successfully, but these errors were encountered: