Documentation clarification needed for regex in additionalHooks configuration.
The documentation for `additionalHooks` in eslint-plugin-react-hooks may be misleading due to overly broad regex examples. The issue suggests updating the documentation to clarify regex usage. No major blockers, but requires understanding of regex patterns and ESLint configuration.
Splits from https://github.com/WordPress/gutenberg/issues/61598 & https://github.com/WordPress/gutenberg/pull/61599
The current explanation about "additionalHooks" under react-hooks/exhaustive-deps might be misleading. The regex in the example catches more than needed.
This:
"additionalHooks": "(useMyCustomHook|useMyOtherCustomHook)"
Will catch also things like this:
function App() {
const data1 = useMyCustomHook2();
const data2 = useMyOtherCustomHookTest();
// ...
}
This might be the reason why Gutenberg used the same approach (which caused the bug mentioned above): https://github.com/WordPress/gutenberg/blob/2df566c771dba22eec2841081a00963a2e56658c/packages/eslint-plugin/configs/react.js#L37-L42
Claim this issue to let others know you're working on it. You'll earn 10 points when you complete it!