Skip to content

no-typos doesn't detect invalid PropTypes in static class fields #1677

Closed
@swrobel

Description

@swrobel

I've observed this with versions 7.5.1 & 7.6.1. The docs indicate that the following should cause this warning: Typo in declared prop type: typo however it doesn't.

class MyComponent extends React.Component {
  static propTypes = {
    a: PropTypes.typo
  }
}

However, when you don't use static class fields, it produces the expected warning:

class MyComponent extends React.Component {}
MyComponent.propTypes = {
  a: PropTypes.typo
};

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