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

Fix variance issues with babel 7 #339

Merged
merged 2 commits into from
Jun 1, 2018
Merged

Conversation

pnevyk
Copy link
Contributor

@pnevyk pnevyk commented Jun 1, 2018

In Babel parser v7 the variance is represented as a node instead of a string. Fixes #334. Relates to #336.

I also spotted ObjectTypeSpreadProperty case in the rule, but no tests for it. It perhaps relates to Flow's type extensions:

type One = {| foo: number |};
type Two = {| bar: boolean |};

type Both = {| ...One, ...Two |}

So before this is merged, we should probably define how these spread types behave (it is not mentioned in docs), then validate if they work as we want, and if not, fix them.

My proposal is to have them below normal properties if asc is used, i.e.:

type Foo = {
     z: number,
     ...Bar,
}

@gajus gajus merged commit 3cd70b8 into gajus:master Jun 1, 2018
@gajus
Copy link
Owner

gajus commented Jun 1, 2018

🎉 This PR is included in version 2.49.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

sort-keys --fix strips out covariance annotations
2 participants