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
- Clone the repo https://github.com/ankitprahladsoni/eslint-noInlineConfig-bug
- 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