You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What parser (default, Babel-ESLint, etc.) are you using?
"webpack": "^2.2.1",
"babel-eslint": "^7.1.1",
What did you do? Please include the actual source code causing the issue.
importReactfrom'react'import{Link}from'react-router'import{graphql}from'react-apollo'import{connect}from'react-redux'import{Grid,Alert,PageHeader}from'react-bootstrap'importSpinnerfrom'components/common/Spinner'import{queryPostDetail}from'../../qql'exportconstPostsBaseContainer=({ data })=>{if(data.loading){return(<Grid><Spinner/></Grid>)}if(data.error){return(<Grid><AlertbsStyle="danger"><strong>Error!</strong> Fetching data from GraphQl server was not successful.
</Alert></Grid>)}return(<Grid><PageHeader>{data.Post.title}<Linkto={`/posts/${data.Post.id}/edit`}><small>[edit]</small></Link></PageHeader><p>{data.Post.text}</p></Grid>)}PostsBaseContainer.propTypes={data: React.PropTypes.shape({loading: React.PropTypes.bool,error: React.PropTypes.object,Post: React.PropTypes.shape({id: React.PropTypes.string.isRequired,title: React.PropTypes.string.isRequired,text: React.PropTypes.string.isRequired,}),}).isRequired,params: React.PropTypes.shape({postId: React.PropTypes.string.isRequired,}).isRequired,}constmapStateToProps=()=>({})constmapDispatchToProps=()=>({})constPostsBaseContainerWithQueries=graphql(queryPostDetail,{options: ownProps=>({variables: {id: ownProps.params.postId,},}),})(PostsBaseContainer)exportdefaultconnect(mapStateToProps,mapDispatchToProps)(PostsBaseContainerWithQueries)
What did you expect to happen?
Eslint should not find any errors in the code.
What actually happened? Please include the actual, raw output from ESLint.
The text was updated successfully, but these errors were encountered:
@developer239, I think the plugin acts correctly here. params.propId is not used in PostsBaseContainer. It is used in connect(mapStateToProps, mapDispatchToProps)(PostsBaseContainerWithQueries) component. You may want to configure that prop type on that one instead. I have created a PR with both correct and incorrect props configurations.
Tell us about your environment
What parser (default, Babel-ESLint, etc.) are you using?
"webpack": "^2.2.1",
"babel-eslint": "^7.1.1",
What did you do? Please include the actual source code causing the issue.
What did you expect to happen?
Eslint should not find any errors in the code.
What actually happened? Please include the actual, raw output from ESLint.
The text was updated successfully, but these errors were encountered: