The issue involves debugging ESLint plugin behavior with React Hooks rules.
The issue describes a bug where `eslint-plugin-react-hooks` fails to report multiple errors correctly, particularly when uncommenting certain lines of code. The problem appears to be related to `babel-plugin-react-compiler`'s AST processing. While the issue is somewhat reproducible, it requires deeper investigation into the interaction between ESLint and Babel plugins.
What kind of issue is this?
React version: 19.2.0
eslint-plugin-react-hooks to your projectreact-hooks/set-state-in-effect rulereact-hooks/static-components ruleLink to code example:
export default function App() {
const [foo, setFoo] = useState(false);
useEffect(() => {
setFoo(!foo);
}, []);
const ViolateStaticComponents = () => {
// const [counter, setCounter] = useState(0);
return (
<h1>Hello, World!</h1>
);
};
// const date = Intl.DateTimeFormat().format(new Date());
return (
<>
<ViolateStaticComponents />
...
</>
);
}
Claim this issue to let others know you're working on it. You'll earn 10 points when you complete it!