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/no-unused-prop-types skipShapeProps with flow.js #1157

Closed
damaon opened this issue Apr 20, 2017 · 3 comments
Closed

react/no-unused-prop-types skipShapeProps with flow.js #1157

damaon opened this issue Apr 20, 2017 · 3 comments
Labels

Comments

@damaon
Copy link

damaon commented Apr 20, 2017

There's modifier for this rule called "skipShapeProps": true but it doesn't work when you use flow for prop types declarations, ex:

...
props: {
  foo: {}
}
...
render() {
  return <SomeComponent foo={this.foo} />
}

Works

But If I'm more specific and provide the shape of foo, ex:

props: {
  foo: { a: number }
}

It fails with error that foo.a is not beeing used.

I would like it to detect that I passed foo to some children and mark foo.a as used.
Otherwise, I cannot import specific type declarations, when I have to pass value down through some components.

@ljharb ljharb added flow and removed flow labels Jun 13, 2017
@maurolionel
Copy link

Running into the same issue, not sure on how to disable eslint react rule only for this... any ideas?

@DianaSuvorova
Copy link
Contributor

@ljharb this was fixed in #1341 Thanks!

@ljharb
Copy link
Member

ljharb commented Aug 4, 2017

Fixed in #1341 :-)

@ljharb ljharb closed this as completed Aug 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

4 participants