Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
swrobel opened this issue Feb 4, 2018 · 0 comments
Closed

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

swrobel opened this issue Feb 4, 2018 · 0 comments

Comments

@swrobel
Copy link

swrobel commented Feb 4, 2018

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
};
This was referenced Sep 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants