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

fix(lint/noUselessFragments): autofix causes syntax error #1496

Merged
merged 32 commits into from
Jan 9, 2024

Conversation

vasucp1207
Copy link
Member

Summary

Closes #1335

  • Ignore code action on component props when the fragment is empty ex, <div x-some-prop={<></>}.
  • Add diagnostic message.

Test Plan

Code action ignores test case like this one,

import { Suspense } from "react";
import { Comp } from "./components/Comp";

export function Component() {
  return (
    <div>
      <Suspense fallback={<></>}>
        <h1>Hi</h1>
      </Suspense>

      <Comp prop={<></>} />
    </div>
  );
}

Copy link

netlify bot commented Jan 9, 2024

Deploy Preview for biomejs ready!

Name Link
🔨 Latest commit 00a5d14
🔍 Latest deploy log https://app.netlify.com/sites/biomejs/deploys/659dbc4462f60a0008d933ae
😎 Deploy Preview https://deploy-preview-1496--biomejs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 100 (🟢 up 5 from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 93 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions github-actions bot added A-Linter Area: linter A-Website Area: website L-JavaScript Language: JavaScript and super languages labels Jan 9, 2024
Copy link

codspeed-hq bot commented Jan 9, 2024

CodSpeed Performance Report

Merging #1496 will not alter performance

Comparing vasucp1207:fragment-jsx (00a5d14) with main (6473a2e)

Summary

✅ 93 untouched benchmarks

@Conaclos Conaclos changed the title fix: noUselessFragments autofix causes syntax error fix(lint/noUselessFragments): autofix causes syntax error Jan 9, 2024
@Conaclos
Copy link
Member

Conaclos commented Jan 9, 2024

Could you add a changelog entry in Bug fixes under linter? Thanks :)

@github-actions github-actions bot added the A-Changelog Area: changelog label Jan 9, 2024
@Conaclos Conaclos merged commit c4259ed into biomejs:main Jan 9, 2024
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Changelog Area: changelog A-Linter Area: linter A-Website Area: website L-JavaScript Language: JavaScript and super languages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

💅 noUselessFragments autofix causes syntax error on component props
2 participants