Skip to content

Allow to configure hooks to check for async callbacks in eslint-plugin-exhaustive-deps#24958

Closed
ahoisl wants to merge 2 commits intofacebook:mainfrom
ahoisl:topic/EslintHooks
Closed

Allow to configure hooks to check for async callbacks in eslint-plugin-exhaustive-deps#24958
ahoisl wants to merge 2 commits intofacebook:mainfrom
ahoisl:topic/EslintHooks

Conversation

@ahoisl
Copy link

@ahoisl ahoisl commented Jul 19, 2022

Summary

  1. Add option checkAsyncFor to configure which effect hooks should be checked for async callbacks
  2. Fix position/index of dependencies parameter in hooks. Dependencies are usually the last parameter in a hook function, e.g. useImperativeHandle

How did you test this change?

  1. Added unit tests & tried out in my own project
  2. Ran existing unit tests with no errors & tried out in my own project

@ahoisl
Copy link
Author

ahoisl commented Jul 22, 2022

There seem to be (at least) 3 other PRs trying to improve the dependencies parameter index problem, with #24344 seeming to be the most promising (latest & no conflicts).
The other two (#18861, #21719) also look good but seem to be stale (conflicts).

If any of those will be merged, I will gladly remove the "Correct index for hook dependencies" commit from this PR

@ahoisl ahoisl changed the title Small additions to eslint-plugin-exhaustive-deps Allow to configure hooks to check for async callbacks in eslint-plugin-exhaustive-deps Jul 22, 2022
@JamesHemery
Copy link

Any update ?

@ahoisl ahoisl force-pushed the topic/EslintHooks branch from ca8670f to de02be9 Compare April 23, 2023 21:23
@react-sizebot
Copy link

react-sizebot commented Apr 23, 2023

Comparing: ed3c65c...9fc0ac7

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.min.js = 168.12 kB 168.12 kB = 52.72 kB 52.72 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 169.92 kB 169.92 kB = 53.26 kB 53.26 kB
facebook-www/ReactDOM-prod.classic.js = 589.57 kB 589.57 kB = 103.80 kB 103.80 kB
facebook-www/ReactDOM-prod.modern.js = 565.41 kB 565.41 kB = 99.93 kB 99.93 kB
test_utils/ReactAllWarnings.js Deleted 64.24 kB 0.00 kB Deleted 16.03 kB 0.00 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable-semver/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.production.min.js +0.72% 27.13 kB 27.33 kB +0.59% 9.37 kB 9.42 kB
oss-stable/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.production.min.js +0.72% 27.13 kB 27.33 kB +0.59% 9.37 kB 9.42 kB
oss-experimental/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.production.min.js +0.71% 27.73 kB 27.93 kB +0.59% 9.54 kB 9.60 kB
oss-stable-semver/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.development.js +0.41% 93.66 kB 94.05 kB +0.37% 21.96 kB 22.04 kB
oss-stable/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.development.js +0.41% 93.66 kB 94.05 kB +0.37% 21.96 kB 22.04 kB
oss-experimental/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.development.js +0.41% 93.81 kB 94.19 kB +0.37% 21.98 kB 22.06 kB
oss-stable-semver/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.production.js +0.40% 92.68 kB 93.06 kB +0.35% 21.77 kB 21.84 kB
oss-stable/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.production.js +0.40% 92.68 kB 93.06 kB +0.35% 21.77 kB 21.84 kB
oss-experimental/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.production.js +0.40% 92.83 kB 93.20 kB +0.35% 21.79 kB 21.87 kB
test_utils/ReactAllWarnings.js Deleted 64.24 kB 0.00 kB Deleted 16.03 kB 0.00 kB

Generated by 🚫 dangerJS against 9fc0ac7

@github-actions
Copy link

This pull request has been automatically marked as stale. If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize reviewing it yet. Your contribution is very much appreciated.

@github-actions github-actions bot added the Resolution: Stale Automatically closed due to inactivity label Apr 10, 2024
@ahoisl
Copy link
Author

ahoisl commented Apr 10, 2024

It's still an issue.

Another issue was created that reported a similar problem: #26099

ahoisl added 2 commits April 10, 2024 11:24
Hook dependencies are always the last parameter in a hook call.
Allows to configure which effect hooks to check for async callbacks.
Default: `/.*/` (=every checked effect hook)
@ahoisl ahoisl force-pushed the topic/EslintHooks branch from de02be9 to 9fc0ac7 Compare April 10, 2024 09:24
@github-actions github-actions bot removed the Resolution: Stale Automatically closed due to inactivity label Apr 10, 2024
@github-actions
Copy link

github-actions bot commented Jul 9, 2024

This pull request has been automatically marked as stale. If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize reviewing it yet. Your contribution is very much appreciated.

@github-actions github-actions bot added the Resolution: Stale Automatically closed due to inactivity label Jul 9, 2024
@github-actions
Copy link

Closing this pull request after a prolonged period of inactivity. If this issue is still present in the latest release, please ask for this pull request to be reopened. Thank you!

@github-actions github-actions bot closed this Jul 17, 2024
@ahoisl
Copy link
Author

ahoisl commented Jul 17, 2024

This is still an issue, but commenting was disallowed, so did not have an option to "bump"

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

Labels

CLA Signed Resolution: Stale Automatically closed due to inactivity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Comments