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

Enforce react-hooks/exhaustive-deps #9516

Merged
merged 3 commits into from
Nov 13, 2024
Merged

Conversation

twschiller
Copy link
Contributor

@twschiller twschiller commented Nov 13, 2024

What does this PR do?

  • Switches react-hooks/exhaustive-deps from warning to error
  • The rule helps flag dead code and likely React bugs

Discussion

  • Ideally, we'd also be able to turn on for useAsyncEffect, but React complains about the use of async in hook callbacks
  • In general, locations that violate react-hooks/exhaustive-deps also can't be compiled with React compiler. (You'll see react compiler lint rule warnings in places we've suppressed react-hooks/exhaustive-deps warnings

Example react-compiler lint warning:
image

For more information on our expectations for the PR process, see the
code review principles doc

Copy link

codecov bot commented Nov 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.79%. Comparing base (8318d74) to head (d50f4e2).
Report is 505 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9516      +/-   ##
==========================================
+ Coverage   74.24%   75.79%   +1.54%     
==========================================
  Files        1332     1422      +90     
  Lines       40817    42917    +2100     
  Branches     7634     7902     +268     
==========================================
+ Hits        30306    32530    +2224     
+ Misses      10511    10387     -124     

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

Copy link

github-actions bot commented Nov 13, 2024

Playwright test results

passed  151 passed
flaky  3 flaky
skipped  2 skipped

Details

report  Open report ↗︎
stats  156 tests across 51 suites
duration  12 minutes, 32 seconds
commit  d50f4e2
info  For more information on how to debug and view this report, see our readme

Flaky tests

msedge › tests/extensionConsole/activation.spec.ts › can activate a mod with no config options
chrome › tests/pageEditor/addStarterBrick.spec.ts › Add starter brick to mod
msedge › tests/pageEditor/saveMod.spec.ts › can save a new trigger mod

Skipped tests

chrome › tests/runtime/googleSheetsIntegration.spec.ts › can activate a google spreadsheet mod with config options
msedge › tests/runtime/googleSheetsIntegration.spec.ts › can activate a google spreadsheet mod with config options

Copy link

No loom links were found in the first post. Please add one there if you'd like to it to appear on Slack.

Do not edit this comment manually.

@twschiller twschiller merged commit 77ca948 into main Nov 13, 2024
24 checks passed
@twschiller twschiller deleted the feature/enforce-exhaustive-deps branch November 13, 2024 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants