What kind of issue is this?
Link to repro
https://playground.react.dev/#N4Igzg9grgTgxgUxALhAHRFMCAEcA2AlggHYAuGaJVhAtgA4Qxk7A5YIAKAhjN7WBwBfHADMYEWjgwkEADzIB6EtwBuhAObcyhCNXQk6jZq3bYAsgloRhYiVIwwE3OBQNV5xlgBMEo7lD4LKJQJK66JDgAQlAaAEoI9BLeUOF6ABQAlKxUOHl4emAsTuoIAO4Akt44ALw4AHJQtABGCDDpHDx8AlkA2o4IpWUAtITeGAC6mVQzkflwhSyCdRyW1ulZtQB8OXP584UQ+AgAdPgQGuklxJXe03v7OIqKOOaEYGCEJBo4TmSwJAAhLl8kIADQ4XrXcpVKYghYkSDHM4XdJge77EF5MgwACeu0eB0RR1O50uGAAynRAtovj8FgxjnICuQJPgxOcyhgMaC8No4AALHDpNoSGDIdgkADWJAgZRI2WAWMeCKRp1FTBFMDFPLyIlEX24+Hw+KVD32qpJKPJIAAwsduCQoPRucqhLN9n8ATgADzeQiqLa2gUIOBSnBEchtHDQMj0KAsdIUgXQfDVVo4ACMOA1MAh7xwAAZMj7FP7A1QhCAwSAEQaNCgQEYmCwyLj6Lg2Jx8LEvgB5eg6Qq2cSSHAAcma3Fa+GG9B7Gi+wycLjIwwZ9EIxxgZfeZHHAG5ZukzXlnhut7S9OYIL4JRgjfhKCQRGBaWADQhBN3eyQB0PEUyA9q3AFNKijGAVHwMAUH8aCECEIA
Repro steps
- Install eslint-plugin-react-hooks@7.0.1 (or latest).
- Create a React component with a clear rule violation (e.g., useMemo with no return value).
- Observe that the linter correctly reports the error.
- Add a try/catch or try/catch/finally block anywhere inside the component body.
- Bug: The linter stops reporting the useMemo error (and all other compiler errors) for that component.
Note: In the React Playground, when recreating the example, I see that the the try/catch/finally block actually throws an error, but the useMemo one is still ignored
Expected Behavior
The linter should flag the useMemo error regardless of the try/catch block present in the component.
Actual Behavior
The linter reports 0 errors. Removing the try/catch block immediately causes the useMemo error to reappear.
How often does this bug happen?
Every time
What version of React are you using?
19.1.1
What version of React Compiler are you using?
I don't use React compiler, but I use eslint-plugin-react-hooks version 7.0.1
What kind of issue is this?
Link to repro
https://playground.react.dev/#N4Igzg9grgTgxgUxALhAHRFMCAEcA2AlggHYAuGaJVhAtgA4Qxk7A5YIAKAhjN7WBwBfHADMYEWjgwkEADzIB6EtwBuhAObcyhCNXQk6jZq3bYAsgloRhYiVIwwE3OBQNV5xlgBMEo7lD4LKJQJK66JDgAQlAaAEoI9BLeUOF6ABQAlKxUOHl4emAsTuoIAO4Akt44ALw4AHJQtABGCDDpHDx8AlkA2o4IpWUAtITeGAC6mVQzkflwhSyCdRyW1ulZtQB8OXP584UQ+AgAdPgQGuklxJXe03v7OIqKOOaEYGCEJBo4TmSwJAAhLl8kIADQ4XrXcpVKYghYkSDHM4XdJge77EF5MgwACeu0eB0RR1O50uGAAynRAtovj8FgxjnICuQJPgxOcyhgMaC8No4AALHDpNoSGDIdgkADWJAgZRI2WAWMeCKRp1FTBFMDFPLyIlEX24+Hw+KVD32qpJKPJIAAwsduCQoPRucqhLN9n8ATgADzeQiqLa2gUIOBSnBEchtHDQMj0KAsdIUgXQfDVVo4ACMOA1MAh7xwAAZMj7FP7A1QhCAwSAEQaNCgQEYmCwyLj6Lg2Jx8LEvgB5eg6Qq2cSSHAAcma3Fa+GG9B7Gi+wycLjIwwZ9EIxxgZfeZHHAG5ZukzXlnhut7S9OYIL4JRgjfhKCQRGBaWADQhBN3eyQB0PEUyA9q3AFNKijGAVHwMAUH8aCECEIA
Repro steps
Note: In the React Playground, when recreating the example, I see that the the try/catch/finally block actually throws an error, but the useMemo one is still ignored
Expected Behavior
The linter should flag the useMemo error regardless of the try/catch block present in the component.
Actual Behavior
The linter reports 0 errors. Removing the try/catch block immediately causes the useMemo error to reappear.
How often does this bug happen?
Every time
What version of React are you using?
19.1.1
What version of React Compiler are you using?
I don't use React compiler, but I use eslint-plugin-react-hooks version 7.0.1