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

fix(useHookAtTopLevel): recognize hook property in member expression calls #3140

Merged
merged 5 commits into from
Jun 10, 2024

Conversation

ksnyder9801
Copy link
Contributor

Summary

this is needed for parity with eslint-plugin-react-hooks. specifically when using hook APIs like trpc or simply React.useEffect instead of useEffect, the current lint rule will fail to catch rules-of-hooks violations.

Test Plan

updated test case

@github-actions github-actions bot added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages A-Changelog Area: changelog labels Jun 9, 2024
Copy link
Contributor

@arendjr arendjr left a comment

Choose a reason for hiding this comment

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

Thanks!

CHANGELOG.md Outdated Show resolved Hide resolved
@arendjr arendjr changed the title fix(use-hook-at-top-level): recognize hook property in member expression calls fix(useHookAtTopLevel): recognize hook property in member expression calls Jun 10, 2024
Copy link

codspeed-hq bot commented Jun 10, 2024

CodSpeed Performance Report

Merging #3140 will not alter performance

Comparing ksnyder9801:rules-of-hooks (d0db974) with main (535acc7)

Summary

✅ 92 untouched benchmarks

@Sec-ant Sec-ant merged commit 5d76e45 into biomejs:main Jun 10, 2024
12 checks passed
@ipanasenko
Copy link
Contributor

Started to get false-positives:

beforeEach(() => jest.useFakeTimers('legacy'));
afterEach(() => jest.useRealTimers());

@ematipico
Copy link
Member

Can you open a new issue?

@ipanasenko
Copy link
Contributor

Yes, sure: #3337

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Changelog Area: changelog A-Linter Area: linter L-JavaScript Language: JavaScript and super languages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants