-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: react/prop-types false positives since upgrading typescript-eslint to v8 #3796
Comments
We don’t even support v6 of the ts parser yet, let alone v7 or v8. See #3629. |
Ok. I'm getting exactly the same behaviour as described in the replies to #3140 (issue only arises when props param is either named |
I encountered the same issue when upgrading to typescript-eslint 8.x I confirm that avoiding destructuring and renaming the type TProps = {
title: string;
};
const Section = forwardRef<Ref, TProps>((props, ref) => {
return <section ref={ref}>{props.title}</section>;
}); Output: type TProps = {
title: string;
};
const Section = forwardRef<Ref, TProps>(({ title }, ref) => {
return <section ref={ref}>{title}</section>;
}); Output: type TProps = {
title: string;
};
const Section = forwardRef<Ref, TProps>((myProps, ref) => {
return <section ref={ref}>{myProps.title}</section>;
}); Works ✅ Not ideal but a simple workaround 🤷♂️ |
Is there an existing issue for this?
Description Overview
Since upgrading
@typescript-eslint/eslint-plugin
and@typescript-eslint/parser
tov8.0.1
, I'm getting false positives forreact/prop-types
. It looks like this might have been an issue before.(I know v8 has only just been released. 🙏)
'children' is missing in props validation eslint(react/prop-types)
Expected Behavior
No error.
eslint-plugin-react version
v7.35.0
eslint version
v8.57.0
node version
N/A
The text was updated successfully, but these errors were encountered: