Skip to content

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

Merged
merged 4 commits into from
Nov 25, 2020
Merged

Fix PropTypes.object() linting errors #1692

merged 4 commits into from
Nov 25, 2020

Conversation

KKVANONYMOUS
Copy link
Contributor

Fixes #1514
I have replaced all the instances of PropTypes.object.isRequired with PropTypes.objectOf(PropTypes.shape()) in the following files:

  • IDEView.jsx
  • AccountForm.jsx
  • LoginForm.jsx
  • NewPasswordForm.jsx
  • SignupForm.jsx
  • ResetPasswordForm.jsx
  • APIKeyForm.jsx
  • NewFileForm.jsx
  • NewFolderForm.jsx

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:

  • has no linting errors (npm run lint)
  • is from a uniquely-named feature branch and has been rebased on top of the latest develop branch. (If I was asked to make more changes, I have made sure to rebase onto develop then too)
  • is descriptively named and links to an issue number, i.e. Fixes #123

Copy link
Member

@catarak catarak left a 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
Copy link
Member

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?

Copy link
Contributor Author

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?

Copy link
Member

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 😄

@KKVANONYMOUS
Copy link
Contributor Author

I have resolved the issue related to isRequired. Please have a look at it.

@KKVANONYMOUS KKVANONYMOUS requested a review from catarak November 25, 2020 07:01
Copy link
Member

@catarak catarak left a 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix PropTypes linting errors
2 participants