Skip to content

Regression in prop-types rule v7.13.0 #2298

Closed
@willdurand

Description

@willdurand

The prop-types rule reports false-positives when we upgraded from version 7.12.0 to 7.13.0. I believe this is related to #2241 and Flow.

Example

type Props = {|
  _value?: number
|};

function App({ _value = defaultValue }: Props = {}) {
  ...
}

What happened?

error  '_value' is missing in props validation  react/prop-types

What did you expect to happen?

No error.

Other information

It worked until 7.12.0 but it fails with 7.13.0.

I created a demo project to reproduce the bug: https://github.com/willdurand/eslint-issue-prop-types.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions