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

[Refactor]: remove unused codes in util/propTypes #2288

Merged
merged 1 commit into from Jan 5, 2020

Conversation

golopot
Copy link
Contributor

@golopot golopot commented May 25, 2019

UnionTypeDefinition.children had a inconvenient type unknown[]|true. It turned out children === true never happens, so the related codes can be removed.

 - remove useless handling of `instanceOf` and `oneOf`

There is no special treatment of `Proptypes.{instanceOf, oneOf}` types
so they might as well be handled as unrecognized types.
};
for (let i = 0, j = annotation.types.length; i < j; i++) {
const type = buildTypeAnnotationDeclarationTypes(annotation.types[i], parentName, seen);
// keep only complex type
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you track down why this was added in the first place? it seems like something that might be important.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

children === true comes from b8e0a4e . But it does not help me understand why it is needed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @phpnode any insight here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no recollection, sorry :(

@ljharb ljharb merged commit d02bb9a into jsx-eslint:master Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants