-
-
Notifications
You must be signed in to change notification settings - Fork 29
Closed
Labels
Status: ReleasedThe issue has been releasedThe issue has been releasedType: BugSomething isn't workingSomething isn't working
Description
Describe the bug
I upgraded to v2 and I see eslint throwing an error:
Oops! Something went wrong! :(
ESLint: 9.36.0
TypeError: Key "rules": Key "@eslint-react/hooks-extra/no-direct-set-state-in-use-layout-effect": Could not find "no-direct-set-state-in-use-layout-effect" in plugin "@eslint-react/hooks-extra".It's because I'm using all config rules and the rule in the error message is still present in the preset.
I see that rule has been merged to another rule in 2.0.0 and it's no longer in the docs as well. Commenting the line out locally in node_modules/@eslint-react/eslint-plugin/dist/index.js fixed the issue for me.
Reproduction
npm install --save-dev globals eslint @eslint/js @eslint-react/eslint-plugintouch index.js- Create a minimal eslint.config.mjs will all rules
import eslintReact from "@eslint-react/eslint-plugin";
import { defineConfig } from "eslint/config";
export default defineConfig([
{
files: ["**/*.js", "**/*.jsx"],
extends: [eslintReact.configs.all],
},
]);- npx eslint
Expected behavior
Eslint not throwing an error.
Platform and versions
Node: v22.15.1
@eslint-react/eslint-plugin: "2.0.5"
Stack trace
Oops! Something went wrong! :(
ESLint: 9.36.0
TypeError: Key "rules": Key "@eslint-react/hooks-extra/no-direct-set-state-in-use-layout-effect": Could not find "no-direct-set-state-in-use-layout-effect" in plugin "@eslint-react/hooks-extra".
at throwRuleNotFoundError (/home/user/project/node_modules/eslint/lib/config/config.js:100:16)
at Config.validateRulesConfig (/home/user/project/node_modules/eslint/lib/config/config.js:603:5)
at new Config (/home/user/project/node_modules/eslint/lib/config/config.js:484:9)
at [finalizeConfig] (/home/user/project/node_modules/eslint/lib/config/flat-config-array.js:212:10)
at FlatConfigArray.getConfigWithStatus (/home/user/project/node_modules/@eslint/config-array/dist/cjs/index.cjs:1404:55)
at FlatConfigArray.getConfig (/home/user/project/node_modules/@eslint/config-array/dist/cjs/index.cjs:1422:15)
at entryFilter (/home/user/project/node_modules/eslint/lib/eslint/eslint-helpers.js:322:27)
at async NodeHfs.<anonymous> (file:///home/user/project/node_modules/@humanfs/core/src/hfs.js:574:24)
at async NodeHfs.walk (file:///home/user/project/node_modules/@humanfs/core/src/hfs.js:614:3)
at async globSearch (/home/user/project/node_modules/eslint/lib/eslint/eslint-helpers.js:363:20)
Additional context
No response
Metadata
Metadata
Assignees
Labels
Status: ReleasedThe issue has been releasedThe issue has been releasedType: BugSomething isn't workingSomething isn't working