Hooks are matched to their state by call order and closures capture by value, and both failure modes are silent — which is exactly the shape of problem a linter is good at.
{
"plugins": ["react-hooks"],
"rules": {
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn"
}
}
rules-of-hooks should be an error from the first day, because a conditional hook corrupts state rather than throwing. exhaustive-deps as a warning is the pragmatic setting: it is right far more often than intuition and it has genuine false positives, so making it an error produces a codebase full of suppression comments. Arguing with it usually ends in a stale-closure bug, and the disagreements are worth reading rather than silencing.