Skip to content

Conversation

@Rel1cx
Copy link
Owner

@Rel1cx Rel1cx commented Sep 10, 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

@vercel
Copy link

vercel bot commented Sep 10, 2025

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

Project Deployment Preview Comments Updated (UTC)
eslint-react Ready Ready Preview Comment Sep 10, 2025 9:11am

@Rel1cx Rel1cx requested a review from Copilot September 10, 2025 09:11
Copy link
Contributor

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 fixes a bug in the web-api/no-leaked-event-listener rule where the useEffect setup function check was incorrectly filtering out valid cases. The fix removes overly restrictive conditions that were preventing the rule from detecting leaked event listeners in certain scenarios.

  • Removes two restrictive conditions from the isFunctionOfUseEffectSetup function
  • Adds a test case to verify the fix works for custom hooks using useEffect

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/core/src/hook/hook-hierarchy.ts Removes restrictive callee type and identity checks from useEffect setup function detection
packages/plugins/eslint-plugin-react-web-api/src/rules/no-leaked-event-listener.spec.ts Adds test case for custom hook scenario that was previously not caught

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

@Rel1cx Rel1cx marked this pull request as ready for review September 10, 2025 09:12
@Rel1cx Rel1cx merged commit 84df72f into main Sep 10, 2025
10 checks passed
@Rel1cx Rel1cx deleted the fix/web-api-no-leaked-event-listener branch September 11, 2025 03:14
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.

2 participants