Skip to content

Bug: [EPRH] Adding multiple rules to eslint-disable-next-line along with noInlineConfig: true somehow doesn't report any errors #35189

@ankitprahladsoni

Description

@ankitprahladsoni

React version: 18

I had originally reported this in the ESLint repo, but they suggested it to move it here eslint/eslint#20344

Steps To Reproduce

  1. Clone the repo https://github.com/ankitprahladsoni/eslint-noInlineConfig-bug
  2. run npm run lint

The current behavior

Running npm run eslint results in 2 warnings

   8:5  warning  '// eslint-disable-next-line react-hooks/exhaustive-deps, react-hooks/set-state-in-effect' has no effect because you have 'noInlineConfig' setting in your config
  10:6  warning  React Hook useEffect has a missing dependency: 'count'. Either include it or remove the dependency array. You can also do a functional update 'setCount(c => ...)' if you only need 'count' in the 'setCount' call  react-hooks/exhaustive-deps

The expected behavior

ESLint should have thrown at least one error, since noInlineConfig is set to true. We can get it if we remove the inline config manually
8:5 error Error: Calling setState synchronously within an effect can trigger cascading renders

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: UnconfirmedA potential issue that we haven't yet confirmed as a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions