You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The exhaustive-deps rule file (1363 lines) opened with 17 single-line
buildXMessage builder functions and a separate resolveSettings block
before any analysis logic.
Split out:
- exhaustive-deps-messages.ts: 17 user-facing diagnostic strings
- exhaustive-deps-settings.ts: ExhaustiveDepsSettings interface +
resolveExhaustiveDepsSettings (renamed from resolveSettings for
namespace clarity)
The main rule file drops from 1363 -> 1307 lines and now opens
directly on analysis logic instead of message bookkeeping. Symbol-
stability helpers (symbolHasStableHookOrigin / symbolHasStableValue /
symbolHasStableFunctionOrigin) stay co-located with the rule for now
because they depend on later-declared helpers (unwrapExpression,
isOutsideAllFunctions); extracting them is a larger surgery.
Co-authored-by: Aiden Bai <aidenybai@users.noreply.github.com>
`React Hook \`${hookName}\` was passed a literal as a dependency. Literals never change so they cannot trigger an update — remove them from the dependency array.`;
`React Hook \`${hookName}\` shouldn't include \`${depName}\` in the dependency array — mutable values like \`.current\` aren't valid deps; depend on \`${depName.replace(/\.current$/,"")}\` itself instead.`;
`React Hook \`${hookName}\` has a second argument which is not an array literal. This means oxlint cannot statically verify whether the dependencies are exhaustive — replace the variable with an inline array.`;
`React Hook \`${hookName}\` has a spread element in its dependency array. This means oxlint cannot statically verify whether the dependencies are exhaustive.`;
`The \`${depName}\` value makes the dependencies of \`${hookName}\` change on every render. Move it inside the hook callback or wrap it in its own memoization hook.`;
`The ref value \`${depName}\` will likely have changed by the time this effect cleanup function runs. Copy it to a variable inside the hook callback and use that variable in cleanup.`;
`React Hook \`${hookName}\` was passed a literal as a dependency. Literals never change so they cannot trigger an update — remove them from the dependency array.`;
`React Hook \`${hookName}\` shouldn't include \`${depName}\` in the dependency array — mutable values like \`.current\` aren't valid deps; depend on \`${depName.replace(/\.current$/,"")}\` itself instead.`;
`React Hook \`${hookName}\` has a second argument which is not an array literal. This means oxlint cannot statically verify whether the dependencies are exhaustive — replace the variable with an inline array.`;
`React Hook \`${hookName}\` has a spread element in its dependency array. This means oxlint cannot statically verify whether the dependencies are exhaustive.`;
`The \`${depName}\` value makes the dependencies of \`${hookName}\` change on every render. Move it inside the hook callback or wrap it in its own memoization hook.`;
`The ref value \`${depName}\` will likely have changed by the time this effect cleanup function runs. Copy it to a variable inside the hook callback and use that variable in cleanup.`;
0 commit comments