Skip to main content
GoodFirstPicks
DashboardIssuesReposLeaderboard

GoodFirstPicks by Leaveitblank © 2026

CreatorRequest a RepoPrivacy PolicyTerms of Service
Bug: eslint-plugin-react-hooks documentation might be misleading | GoodFirstPicks

Bug: eslint-plugin-react-hooks documentation might be misleading

facebook/react 21 comments 24d ago
View on GitHub
lowopenScope: somewhat clearSkill match: maybeReactJavaScriptTypeScript

Why this is a good first issue

Documentation clarification needed for regex in additionalHooks configuration.

AI Summary

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.

Issue Description

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

GitHub Labels

Status: Unconfirmed

Want to work on this?

Claim this issue to let others know you're working on it. You'll earn 10 points when you complete it!

Risk Flags

  • potential regex edge cases
Loading labels...

Details

Points10 pts
Difficultylow
Scopesomewhat clear
Skill Matchmaybe
Test Focusedno