-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
Description
Is there an existing issue for this?
- I have searched the existing issues and my issue is unique
- My issue appears in the command-line and not only in the text editor
Description Overview
The error is shown for all components where the prop is used, not just in the component in disallowedFor.
{
propName: 'key',
disallowedFor: ['Component'],
message: 'Do not use key on Component.',
}
<AnotherComponent key={} /> -> Shows error
Expected Behavior
Error not showing for components that are not in the disallowedFor array.
<AnotherComponent key={} /> -> No error
Error only showing for the disallowed component.
<Component key={} /> -> Shows error
eslint-plugin-react version
7.31.8
eslint version
8.15.0
node version
16.14