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

`children is missing in props validation` #152

Closed
dcousens opened this issue Jun 9, 2015 · 4 comments

Comments

@dcousens
Copy link
Member

commented Jun 9, 2015

When using React, standard always complains about this.props.children not being defined in propTypes, even though it is a complex type that is given by React it self.

I personally don't even know what type it would even be, I know it is (kind of) array-like.

Is there a way we can avoid having to set up the propType validation for this property?

@dcousens dcousens added the question label Jun 9, 2015

@cesarandreu

This comment has been minimized.

Copy link
Contributor

commented Jun 10, 2015

The correct generic type is node.

{
  propTypes: {
    children: React.PropTypes.node
  }
}

If it can only be a single child, it's element.

@feross

This comment has been minimized.

Copy link
Member

commented Jun 11, 2015

I recently extracted the react-specific configs into their own shareable config. See: standard/eslint-config-standard#2

You guys should just change whatever options you want in eslint-config-standard-react. I've added you both as collaborators and npm owners. I don't use React, so I have no context or opinion about these issues. If you think there's likely to be controversy, open an issue / PR and wait a few days before merging. Same as we do on this repo.

standard depends on exact versions of the configs, so whenever you publish a new version of the react config, we'll need to bump the version here.

@cesarandreu

This comment has been minimized.

Copy link
Contributor

commented Jun 11, 2015

Cool, thanks :D.

@feross

This comment has been minimized.

Copy link
Member

commented Jun 11, 2015

Closing this now, please move it to https://github.com/feross/eslint-config-standard-react.

@feross feross closed this Jun 11, 2015

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

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