This repository has been archived by the owner on Aug 31, 2023. It is now read-only.
🐛 noUselessFragments
is inconsistent/buggy
#3668
Labels
A-Linter
Area: linter
L-JSX
Language: JSX
S-Bug: confirmed
Status: report has been confirmed as a valid bug
Environment information
What happened?
Issue 1
The
noUselessFragments
rule finds an issue inComponent2
, but not inComponent1
, the only difference is the parentheses.Issue 2
if I apply the rule suggestion, I end up with this:
which is not valid JS.
Expected result
No bugs!
FWIW because of a TypeScript limitation, components cannot return a string for example, otherwise it'll lead to type issues, so some fragments must be preserved in
.tsx
files.In the second example, I'm not convinced it's safe to remove the fragment there anyway, we don't know where
obj.element
will be used.Code of Conduct
The text was updated successfully, but these errors were encountered: