Skip to content
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

react/prop-types false positive on non-component class #45

Closed
lencioni opened this issue Mar 30, 2015 · 1 comment
Closed

react/prop-types false positive on non-component class #45

lencioni opened this issue Mar 30, 2015 · 1 comment

Comments

@lencioni
Copy link
Collaborator

If I have a regular class (non-component) that has a property called props, the react/prop-types rule will complain about missing props validation.

class MyClass {
  myMethod() {
    return this.props.test;
  }
}

3:11 error 'test' is missing in props validation for MyClass react/prop-types

This should only happen for classes that extend React.Component or extend a class that extends React.Component.

eslint-plugin-react 2.0.1

@yannickcr
Copy link
Member

Right, there is a bug in the React component detection.

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