-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Fix PropTypes.object() linting errors #1692
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this! For all of the updates you made, you removed isRequired
, which should be kept! I commented on a few of them but not all of them—I would suggest changing all of them.
@@ -38,7 +38,7 @@ const ActionStrip = ({ actions }) => ( | |||
|
|||
ActionStrip.propTypes = { | |||
actions: PropTypes.arrayOf(PropTypes.shape({ | |||
icon: PropTypes.any, | |||
icon: PropTypes.any, //eslint-disable-line |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to fix this so that you don't have to disable linting on this line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@catarak I think in order to resolve it we have to explicitly specify the data type of icon field.
Can you please tell me which data type does it use?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be PropTypes.component
! I fixed it 😄
I have resolved the issue related to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this!
Fixes #1514
I have replaced all the instances of
PropTypes.object.isRequired
withPropTypes.objectOf(PropTypes.shape())
in the following files:Also, while debugging those errors I encountered a linting error with
PropTypes.any
in ActionStrip.jsx which I disabled by using//eslint-disable-line
for the time being.I have verified that this pull request:
npm run lint
)develop
branch. (If I was asked to make more changes, I have made sure to rebase ontodevelop
then too)Fixes #123