-
Notifications
You must be signed in to change notification settings - Fork 49.6k
Closed
Description
React version:
N/A (ESLint issue)
Steps To Reproduce
- Install
eslint@9.36.0
witheslint-plugin-react-hooks@6.1.0
in a project that also useszod@4.x
. - Run ESLint on any file.
- Observe the crash.
Link to code example:
Minimal reproduction:
npm init -y
npm i -D eslint@9.36.0 eslint-plugin-react-hooks@6.1.0 zod@4
npx eslint --init
npx eslint index.js
The current behavior
ESLint crashes with:
TypeError: zod.z.function(...).args is not a function
at eslint-plugin-react-hooks.development.js:32075:57
This happens because eslint-plugin-react-hooks
is written against Zod v3, where z.function(...).args(...)
exists. In Zod v4, that API changed, so the plugin immediately fails when loaded.
The expected behavior
eslint-plugin-react-hooks
should work with Zod v4, or at least specify a peer dependency constraint to prevent incompatible installs. Ideally the schema validation should be updated to use Zod v4’s function API.
Nybkox and KaminskiDavid