I cannot reproduce that. Is it possible that is due to some caching done in the IDE? We changed that rule name in 2.0.3
>npx eslint -c eslint.config.cjs file.js
Loaded 328 rules
C:\www\projects\SonarJS\its\eslint8-plugin-sonarjs\file.js
65:5 error React Hook "useEffect" is called conditionally. React Hooks must be called in the exact same order in every component render sonarjs/rules-of-hooks
I can confirm this is already fixed in 2.0.3. I just had to make sure to update to it.
For the record, here’s how it showed in the CLI in 2.0.2 (just to prove it wasn’t an editor caching issue, but as I said, already fixed anyway, thanks)
32:18 error React Hook “useState” is called in function “getName” that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word “use” sonarjs/pluginRules-of-hooks