Skip to content

require-default-props does not detect properties in quotes #1201

Closed
singapore/lint-condo
#308
@zech

Description

@zech

Hi,

I've got an issue with code like this

DueEntryComponent.propTypes = {
    "isOverdue": PropTypes.bool
};

DueEntryComponent.defaultProps = {
    "isOverdue": false
};

triggers the message:

propType "isOverdue" is not required, but has no corresponding defaultProp declaration. (react/require-default-props)

changing the declaration to

DueEntryComponent.defaultProps = {
    isOverdue: false
};

omits the error.

I don't think quotes should have an effect on detecting defaultProps. Maybe I'm wrong ;-)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions