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

Don't crash when encountering unparameterized Arrays #402

Merged
merged 2 commits into from
May 8, 2019

Conversation

zpao
Copy link
Contributor

@zpao zpao commented May 6, 2019

While these are disallowed in Flow, typeof Array is a valid type,
which could trigger this.

Rather than try to enumerate other possible cases, I simply check to
make sure we don't crash when we hit them.

While these are disallowed in Flow, `typeof Array` is a valid type,
which could trigger this.

Rather than try to enumerate other possible cases, I simply check to
make sure we don't crash when we hit them.
@@ -128,6 +128,16 @@ export default {
onlyFilesWithFlowAnnotation: true
}
}
},

// While this isn't valid flow, we shouldn't disallow it.
Copy link
Owner

Choose a reason for hiding this comment

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

What is the use case for this if it isn't valid Flow?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mostly just a sanity check to check that the code won't break. I'm not attached to it at all.

@gajus gajus merged commit 05a7281 into gajus:master May 8, 2019
@gajus
Copy link
Owner

gajus commented May 8, 2019

🎉 This PR is included in version 3.8.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@gajus gajus added the released label May 8, 2019
kangax pushed a commit to kangax/eslint-plugin-flowtype that referenced this pull request May 17, 2019
While these are disallowed in Flow, `typeof Array` is a valid type,
which could trigger this.

Rather than try to enumerate other possible cases, I simply check to
make sure we don't crash when we hit them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants