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

🐛 noUselessFragments fix result has invalid jsx syntax #4553

Closed
1 task done
maxmorozoff opened this issue Nov 17, 2024 · 1 comment · Fixed by #4648
Closed
1 task done

🐛 noUselessFragments fix result has invalid jsx syntax #4553

maxmorozoff opened this issue Nov 17, 2024 · 1 comment · Fixed by #4648
Assignees
Labels
A-Linter Area: linter L-JavaScript Language: JavaScript and super languages S-Bug-confirmed Status: report has been confirmed as a valid bug

Comments

@maxmorozoff
Copy link

Environment information

(edited)

CLI:
  Version:                      1.9.4

Biome Configuration:
  Status:                       Loaded successfully
  Formatter disabled:           false
  Linter disabled:              false
  Organize imports disabled:    false
  VCS disabled:                 false

Linter:
  JavaScript enabled:           true
  JSON enabled:                 true
  CSS enabled:                  true
  GraphQL enabled:              false
  Recommended:                  true
  All:                          false

What happened?

Open in Biome Playground

Input

<Suspense
	fallback={
		<>
			<span>Loading...</span>
		</>
	}
>
	{children}
</Suspense>;

Biome fix output

<Suspense fallback=<span>Loading...</span>>
	{children}
</Suspense>;

Issue Details

The fix removes the fragment but doesn't wrap the prop value in curly braces ({}). This results in invalid JSX syntax, as seen in the fix output above.

Expected result

<Suspense fallback={<span>Loading...</span>}>
	{children}
</Suspense>;

Should the formatter be responsible for fixing this, or is it a linter issue?

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@maxmorozoff maxmorozoff added the S-Needs triage Status: this issue needs to be triaged label Nov 17, 2024
@ematipico ematipico added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages S-Bug-confirmed Status: report has been confirmed as a valid bug labels Nov 18, 2024
@github-actions github-actions bot removed the S-Needs triage Status: this issue needs to be triaged label Nov 18, 2024
@fireairforce
Copy link
Member

i will fix this~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Linter Area: linter L-JavaScript Language: JavaScript and super languages S-Bug-confirmed Status: report has been confirmed as a valid bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants