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

[New] forward-ref-uses-ref: add rule for checking ref parameter is added #3667

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

NotWoods
Copy link

Closes #3158

Adds a new rule to require that a second parameter is used with forwardRef. Offers suggestions to add the parameter or remove the forwardRef wrapper.

Copy link

codecov bot commented Dec 15, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (9f4b2b9) 97.74% compared to head (2f921af) 97.75%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3667   +/-   ##
=======================================
  Coverage   97.74%   97.75%           
=======================================
  Files         132      133    +1     
  Lines        9409     9437   +28     
  Branches     3449     3458    +9     
=======================================
+ Hits         9197     9225   +28     
  Misses        212      212           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

configs/recommended.js Outdated Show resolved Hide resolved
lib/rules/forward-ref-uses-ref.js Outdated Show resolved Hide resolved
lib/rules/forward-ref-uses-ref.js Outdated Show resolved Hide resolved
tests/lib/rules/forward-ref-uses-ref.js Outdated Show resolved Hide resolved
tests/lib/rules/forward-ref-uses-ref.js Outdated Show resolved Hide resolved
tests/lib/rules/forward-ref-uses-ref.js Outdated Show resolved Hide resolved
Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There’s a few lines that are uncovered; it’d be great to add tests that cover them.

lib/rules/forward-ref-uses-ref.js Outdated Show resolved Hide resolved
@ljharb ljharb marked this pull request as draft December 20, 2023 20:37
@ljharb
Copy link
Member

ljharb commented Dec 21, 2023

(there's still some uncovered lines)

@NotWoods
Copy link
Author

I'll work on this more in January; currently busy with holidays. Will make sure to get the last few lines covered and see if I can figure out why ESLint 6 & 7 are failing.

@NotWoods NotWoods marked this pull request as ready for review January 24, 2024 23:42
@NotWoods NotWoods requested a review from ljharb January 30, 2024 04:37
Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's still a few uncovered added lines.

@ljharb ljharb marked this pull request as draft January 31, 2024 07:54
@NotWoods
Copy link
Author

I don't see the uncovered lines in Codecov, can you help point them out to me?
image

@NotWoods NotWoods requested a review from ljharb February 27, 2024 04:43
@ljharb
Copy link
Member

ljharb commented Feb 27, 2024

@NotWoods they're right in the "files changed" tab - see https://github.com/jsx-eslint/eslint-plugin-react/pull/3667/files#diff-25114be5f5c5bf7d89a5cc5dfb905ca0d6aafda4a7cb7b49d20df89ceea52bf4R72 for an example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

rule to ensure forwardRef includes a ref argument.
2 participants