Skip to content

Conversation

Rel1cx
Copy link
Owner

@Rel1cx Rel1cx commented Aug 15, 2025

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Docs
  • Test
  • New Binding issue #___
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change?

  • Yes, and the changes were approved in issue #___
  • No

Checklist

  • When resolving issues, they are referenced in the PR's title (e.g fix: remove a typo, closes #___, #___)
  • I have added a convincing reason for adding this feature, if necessary

Other information

Copy link

vercel bot commented Aug 15, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
eslint-react Ready Preview Comment Aug 15, 2025 3:17am

Copy link

socket-security bot commented Aug 15, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​babel/​preset-env@​7.28.0 ⏵ 7.28.3961007596 +5100
Updated@​babel/​core@​7.28.0 ⏵ 7.28.3981007896100
Updated@​tailwindcss/​postcss@​4.1.11 ⏵ 4.1.1210010079 -199100
Updated@​eslint/​config-inspector@​1.1.0 ⏵ 1.2.0991009591 +7100
Addedlefthook@​1.12.39210010095100
Updatedeslint-plugin-jsdoc@​53.0.1 ⏵ 54.1.0100 +2100100100 +5100

View full report

@Rel1cx Rel1cx requested a review from Copilot August 15, 2025 03:12
@Rel1cx Rel1cx changed the title fix: refactor is-from-react utility and improve no-forward-ref rule a… fix: refactor is-from-react utility and improve no-forward-ref rule autofix handling, closes #1172 Aug 15, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the is-from-react utility and improves autofix handling for the no-forward-ref rule by making fixes conditional on whether the forwardRef call comes from React.

  • Adds safety checks to prevent autofixing when forwardRef is imported from non-React sources
  • Refactors the is-from-react utility by moving it to a more appropriate location and making it reusable
  • Updates package dependencies to newer versions

Reviewed Changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/plugins/eslint-plugin-react-x/src/rules/no-forward-ref.ts Adds canFix function to conditionally apply fixes only when forwardRef is from React
packages/plugins/eslint-plugin-react-x/src/rules/no-forward-ref.spec.ts Adds test case for non-React import source to verify fix is not applied
packages/plugins/eslint-plugin-react-debug/src/rules/is-from-react.ts Refactors by extracting isFromReact function to be reusable
packages/core/src/utils/is-from-react.ts Updates JSDoc comments and adds @internal annotation
packages/core/src/utils/index.ts Updates export to use new is-from-react module name
package.json & example packages Updates various dependencies to newer versions

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

…ard-ref.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: REL1CX <dokimondex@gmail.com>
@Rel1cx Rel1cx merged commit a3544b5 into main Aug 15, 2025
10 checks passed
@Rel1cx Rel1cx deleted the no-forward-ref branch August 20, 2025 03:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant