Issue involves dependency resolution and TypeScript compatibility in eslint-plugin-react-hooks.
The issue involves a broken resolution in [email protected], causing errors when running ESLint and TypeScript compatibility issues. The problem appears to be related to dependency paths and TypeScript type definitions. The fix likely requires updating dependency paths and ensuring TypeScript compatibility, but the exact scope and impact are not entirely clear.
React version: N/A
[email protected].config.ts configuration (although an issue raised in zod-validation-error shows esm/resolve so may also flag with a .js config)npx eslint .Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './v4' is not defined by "exports" in /node_modules/zod-validation-error/package.json
at exportsNotFound (node:internal/modules/esm/resolve:313:10)
at packageExportsResolve (node:internal/modules/esm/resolve:660:9)
at resolveExports (node:internal/modules/cjs/loader:650:36)
at Function._findPath (node:internal/modules/cjs/loader:717:31)
at Function._resolveFilename (node:internal/modules/cjs/loader:1369:27)
at Function.resolve (node:internal/modules/helpers:157:19)
at jitiResolve (node_modules/jiti/dist/jiti.cjs:1:148703)
at jitiRequire (node_modules/jiti/dist/jiti.cjs:1:150290)
at node_modules/jiti/dist/jiti.cjs:1:157987
at node_modules/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.development.js:20:16
There is an error when running eslint - Downgrading to 7.0.0 resolves both the above error, and the typescript issue below.
There is no error running eslint.
Additionally, with v7.0.1, typescript complains that the react-hooks plugin is not the correct type:
// Truncated
Types of property 'configs' are incompatible.
Type '{ recommended: { plugins: string[]; rules: RulesConfig; }; 'recommended-latest': { plugins: string[]; rules: RulesConfig; }; flat: { recommended: ReactHooksFlatConfig; "recommended-latest": ReactHooksFlatConfig; }; }' is not assignable to type 'Record<string, ConfigObject<RulesConfig> | LegacyConfigObject<RulesConfig, RulesConfig> | ConfigObject<RulesConfig>[]>'.
Property 'flat' is incompatible with index
Claim this issue to let others know you're working on it. You'll earn 10 points when you complete it!