Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

fix(rome_js_analyze): improve the logic of jsx_reference_identifier_is_fragment #3592

Merged
merged 1 commit into from
Nov 8, 2022

Conversation

leops
Copy link
Contributor

@leops leops commented Nov 8, 2022

Summary

The jsx_reference_identifier_is_fragment has a subtle logic bug that cause it to return false positive for symbol imported from "react" other than Fragment, for instance StrictMode. I've modified the implementation to explicitly inspect the import nod and, check the source name of the imported symbol against "Fragment"

Test Plan

I've added a few test case to ensure that StrictMode and React.StrictMode do not trigger the noUselessFragments rule in various context

@leops leops requested a review from xunilrj as a code owner November 8, 2022 16:15
@leops leops temporarily deployed to netlify-playground November 8, 2022 16:15 Inactive
@netlify
Copy link

netlify bot commented Nov 8, 2022

Deploy Preview for docs-rometools ready!

Name Link
🔨 Latest commit ef1a9a7
🔍 Latest deploy log https://app.netlify.com/sites/docs-rometools/deploys/636a80acb9ac0600086ae2bf
😎 Deploy Preview https://deploy-preview-3592--docs-rometools.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@github-actions
Copy link

github-actions bot commented Nov 8, 2022

@leops leops merged commit 4fc6d08 into main Nov 8, 2022
@leops leops deleted the fix/no-useless-fragment branch November 8, 2022 16:57
jeysal added a commit to jeysal/rometools that referenced this pull request Nov 8, 2022
* upstream/main:
  fix(rome_js_analyze): improve the logic of jsx_reference_identifier_is_fragment (rome#3592)
  doc: Fix configuration example
  Add crossorigin header
  Improve font performance
  release: 10.0.0 (rome#3526)
  fix(docs): use the standard picture element to display the logo (rome#3585)
@leops leops added the A-Linter Area: linter label Nov 9, 2022
@leops leops added this to the 10.0.1 milestone Nov 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Linter Area: linter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants