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 Code Style not applied when extending React.Component subclass #347

Closed
saschagehlich opened this issue Nov 30, 2015 · 1 comment

Comments

@saschagehlich
Copy link

commented Nov 30, 2015

Let's say I have a BaseComponent, like this:

import React from 'react'

export default class BaseComponent extends React.Component {
  render () {
    return <div />
  }
}

And another class extending this BaseComponent:

import BaseComponent from './base-component'
class MyComponent extends BaseComponent {
  render () {
    return <div>{this.props.content}</div>
  }
}

Of course standard can't know that this is a ReactComponent and should comply with the React Code Style (e.g. prop types), since it's extending BaseComponent instead of ReactComponent. But is there a way to tell standard that MyComponent is a ReactComponent?

@feross

This comment has been minimized.

Copy link
Member

commented Feb 5, 2016

Not sure - there may be a way to accomplish what you want, but you should re-open this as an issue on https://github.com/feross/eslint-config-standard-react.

React-specific rules will be removed from standard in v6. You can use standard-react which we'll publish when v6 comes out.

@feross feross closed this Feb 5, 2016

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
2 participants
You can’t perform that action at this time.