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

fix(rome_js_analyze): Verify method name of React API calls #3619

Merged
merged 4 commits into from
Nov 9, 2022

Conversation

MichaReiser
Copy link
Contributor

Summary

The is_react_call_api in some situations didn't test if the method name is the tested for method name.

For example, is_react_call_api(..., "cloneElement") returned true for React.clone or just clone.

I fixed the same issue in jsx_member_name_is_react_fragment

Closes #3618

Test Plan

I added some new tests veryfing that the logic correctly verifies the member name.

@netlify
Copy link

netlify bot commented Nov 9, 2022

Deploy Preview for docs-rometools canceled.

Name Link
🔨 Latest commit d37b991
🔍 Latest deploy log https://app.netlify.com/sites/docs-rometools/deploys/636baebc885bf40008d9121f

@MichaReiser MichaReiser temporarily deployed to netlify-playground November 9, 2022 12:57 Inactive
@MichaReiser MichaReiser marked this pull request as draft November 9, 2022 13:04
@github-actions
Copy link

github-actions bot commented Nov 9, 2022

## Summary

The `is_react_call_api` in some situations didn't test if the method name is the tested for method name.

For example, `is_react_call_api(..., "cloneElement")` returned true for `React.clone` or just `clone`.

I fixed the same issue in `jsx_member_name_is_react_fragment`

## Test Plan

I added some new tests veryfing that the logic correctly verifies the member name.
@MichaReiser MichaReiser temporarily deployed to netlify-playground November 9, 2022 13:09 Inactive
@MichaReiser MichaReiser marked this pull request as ready for review November 9, 2022 13:09
@MichaReiser MichaReiser temporarily deployed to netlify-playground November 9, 2022 13:38 Inactive
@MichaReiser MichaReiser temporarily deployed to netlify-playground November 9, 2022 13:39 Inactive
@MichaReiser MichaReiser temporarily deployed to netlify-playground November 9, 2022 13:44 Inactive
@leops leops added this to the 10.0.1 milestone Nov 9, 2022
@MichaReiser MichaReiser changed the title fix(rome_js_analyze): Assert React symbols resolve to react module fix(rome_js_analyze): Ensure React symbols resolve to react module Nov 9, 2022
@MichaReiser MichaReiser changed the title fix(rome_js_analyze): Ensure React symbols resolve to react module fix(rome_js_analyze): Verify method name of React API calls Nov 9, 2022
@MichaReiser MichaReiser merged commit 76a56db into main Nov 9, 2022
@MichaReiser MichaReiser deleted the fix/react-rules branch November 9, 2022 15:10
jeysal added a commit to jeysal/rometools that referenced this pull request Nov 9, 2022
* upstream/main:
  fix(rome_js_analyze): Verify method name of React API calls (rome#3619)
  benchmark: Add pprettier and dprint to benchmark (rome#3597)
  feat(vscode): display the version of the language server in the status bar (rome#3616)
  fix(rome_cli): correctly account for diff diagnostics in the printed diagnostics count (rome#3595)
  fix(rome_cli): Respect formatter/linter `enabled` from configuration (rome#3591)
  Remove dead styles
  [website] Add scroll-padding-top
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 noChildrenProp doesn't check method name
2 participants