react
react copied to clipboard
Allow to configure hooks to check for async callbacks in eslint-plugin-exhaustive-deps
Summary
- Add option
checkAsyncFor
to configure which effect hooks should be checked for async callbacks - 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?
- Added unit tests & tried out in my own project
- Ran existing unit tests with no errors & tried out in my own project
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
Any update ?
Comparing: 7ce765ec321a6f213019b56b36f9dccb2a8a7d5c...de02be97e0f280f373ceabbf6b10140fff342b10
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 | = | 163.93 kB | 163.93 kB | = | 51.67 kB | 51.67 kB |
oss-experimental/react-dom/cjs/react-dom.production.min.js | = | 168.28 kB | 168.28 kB | = | 52.93 kB | 52.93 kB |
facebook-www/ReactDOM-prod.classic.js | = | 568.19 kB | 568.19 kB | = | 100.64 kB | 100.64 kB |
facebook-www/ReactDOM-prod.modern.js | = | 551.92 kB | 551.92 kB | = | 97.97 kB | 97.97 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.73% | 26.70 kB | 26.89 kB | +0.58% | 9.22 kB | 9.27 kB |
oss-stable/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.production.min.js | +0.73% | 26.70 kB | 26.89 kB | +0.58% | 9.22 kB | 9.27 kB |
oss-experimental/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.production.min.js | +0.72% | 27.40 kB | 27.60 kB | +0.55% | 9.42 kB | 9.47 kB |
oss-stable-semver/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.development.js | +0.36% | 92.56 kB | 92.89 kB | +0.37% | 21.80 kB | 21.88 kB |
oss-stable/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.development.js | +0.36% | 92.56 kB | 92.89 kB | +0.37% | 21.80 kB | 21.88 kB |
oss-experimental/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.development.js | +0.36% | 92.78 kB | 93.11 kB | +0.35% | 21.83 kB | 21.91 kB |
Generated by :no_entry_sign: dangerJS against de02be97e0f280f373ceabbf6b10140fff342b10