Seems like this issue is closed, but I think the code can be improved for checking if left side is boolean or not. Currently, the implementation only looks if the variable is assigned to a boolean in it's current scope. So it is not working if I am using a TS-typed component prop.
I think this can be improved by actually checking TS-type of the variable on the left-side.
Here is an example demonstrating the pain-point.
I checked the codebase a bit, but could not find an easy way to get it right by checking the TS type.
I think we need to somehow get to what IDE shows as variable type when hovered.
PS: This post originated from this comment. But I am sure if it makes sense to add new comments to a closed issue. So I opened this as a new one.
Seems like this issue is closed, but I think the code can be improved for checking if left side is boolean or not. Currently, the implementation only looks if the variable is assigned to a boolean in it's current scope. So it is not working if I am using a TS-typed component prop.
I think this can be improved by actually checking TS-type of the variable on the left-side.
Here is an example demonstrating the pain-point.
I checked the codebase a bit, but could not find an easy way to get it right by checking the TS type. I think we need to somehow get to what IDE shows as variable type when hovered.![Screenshot 2024-05-29 at 12 09 19](https://github.com/jsx-eslint/eslint-plugin-react/assets/39553853/a6fcb502-045a-48e4-aa0c-85147737cd05)
PS: This post originated from this comment. But I am sure if it makes sense to add new comments to a closed issue. So I opened this as a new one.
Related issue: https://github.com/jsx-eslint/eslint-plugin-react/issues/3719