-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Parse extended class to read some informations #68
Comments
Mmm, I think we can only have a limited support for this case. We can handle the above script but not this one for example: import A from "a"
class B extends A {
render() {
return {this.props.whatever}
}
} In this case the extended class is in another file and we cannot know if the propTypes property is defined in it or not. |
I think the fs read might be a problem. But it's doable right ? |
Linting is only made on the current file content, starting to jump from file to file, resolving imports and finding how the class is constructed will be very complicated (but I accept PR 😉 ). I can handle the original case and if you encounter the second one I think the best way to handle it should be to ignore the import A from "a"
class B extends A { // eslint-disable-line react/prop-types
render() {
return {this.props.whatever}
}
} |
Is there a way we could do a decorator-style comment above a class manually to inform the parser that the class is a descendent of a Component and lint it thusly? |
B gets an error on propTypes undefined on this component.
The text was updated successfully, but these errors were encountered: