React version: N/A
Steps To Reproduce
- Install
eslint-plugin-react-hooks@v7.0.1
- Configure with a
.config.ts configuration (although an issue raised in zod-validation-error shows esm/resolve so may also flag with a .js config)
- Run
npx eslint .
- Error printed:
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
The current behavior
There is an error when running eslint - Downgrading to 7.0.0 resolves both the above error, and the typescript issue below.
The expected behavior
There is no error running eslint.
Type Discrepancy
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 signature.
Type '{ recommended: ReactHooksFlatConfig; "recommended-latest": ReactHooksFlatConfig; }' is not assignable to type 'ConfigObject<RulesConfig> | LegacyConfigObject<RulesConfig, RulesConfig> | ConfigObject<RulesConfig>[]'
// Truncated
React version: N/A
Steps To Reproduce
eslint-plugin-react-hooks@v7.0.1.config.tsconfiguration (although an issue raised inzod-validation-errorshowsesm/resolveso may also flag with a.jsconfig)npx eslint .The current behavior
There is an error when running eslint - Downgrading to
7.0.0resolves both the above error, and the typescript issue below.The expected behavior
There is no error running eslint.
Type Discrepancy
Additionally, with
v7.0.1, typescript complains that thereact-hooksplugin is not the correct type: