Skip to content

default-props-match-prop-types doesn't detect properties in quotes #1908

@zech

Description

@zech

Hello,

same as in issue #1201 last year the above mentioned rule doesn't detect quoted properties. The error for the second and third property is defaultProp "undefined" defined for isRequired propType. (react/default-props-match-prop-types)

SomeComponent.propTypes = {
    "firstProperty": PropTypes.string.isRequired,
    "secondProperty": PropTypes.bool,
    "thirdProperty": PropTypes.func
};

SomeComponent.defaultProps = {
    "secondProperty": false,
    "thirdProperty": () => undefined
};

As before removing the quotes solves the error. But I don't think this should be consistent and a non issue.

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