Skip to content

[Bug]: react/prop-types not working when prefixing function with underscore _ #3560

Closed
@KubiGR

Description

@KubiGR

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

When naming function components with an underscore _ prefix, the react/prop-types rule does not report anything.
Other prefixes, like $ don't seem to create this problem.

function _EventsList({ eventDate }) {
    return (
        <div>
            {eventDate.events.map((event) => (
                <Event key={event.id} eventId={event.id} />
            ))}
        </div>
    );
}

Expected Behavior

I would expect the rule to appear regardless of the function name.

eslint-plugin-react version

v7.31.10

eslint version

v7.32.0

node version

v10.15.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions