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

feat: add rule to make sure that object type that is spread has exact type #391

Merged
merged 2 commits into from
Apr 8, 2019

Conversation

Kiwka
Copy link
Contributor

@Kiwka Kiwka commented Mar 26, 2019

This rule will add possibility to enforce spreading only exact object types, that are explicitly exact.

When object type is not exact and is spread inside other object annotation, it can lead to resulted type to be dependent on the place, where object type was spread. For example, this case, that from first look is invalid https://flow.org/try/#0C4TwDgpgBAygFgQwE4QCYAUkHtJOASwgGcoBeKAbwCgooAbCAOwHNg4AuKRgVwFsAjCEgA0NLgl4RORYEnwtRAXwDcVKqEhQAchADumHEILEylMQmZSufQSLEA6R-GRoDuY0SWqqAYyyMZKFwif04dfWx3QhJyagBICysAciw6VCSlIA
actually doesn't cause any flow errors.

One of the way to prevent such cases, is to spread only exact object types.

@Kiwka
Copy link
Contributor Author

Kiwka commented Apr 8, 2019

👋 @gajus. What can I do to make this new feature to be added?

@gajus gajus merged commit 52b0c00 into gajus:master Apr 8, 2019
@gajus
Copy link
Owner

gajus commented Apr 8, 2019

Thank you

@gajus
Copy link
Owner

gajus commented Apr 8, 2019

🎉 This PR is included in version 3.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@gajus gajus added the released label Apr 8, 2019
@Kiwka Kiwka deleted the add-spread-exact-rule branch April 8, 2019 13:03
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