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: noDupeKeys ignores ObjectTypeSpreadProperty #325

Merged
merged 1 commit into from
Apr 14, 2018
Merged

Conversation

uforic
Copy link
Contributor

@uforic uforic commented Apr 14, 2018

The new object type spread features in Flow cause the noDupeKeys rule to crash. Specifically, .value is accessed on the ObjectTypeSpreadProperty node, which doesn't have that field.

type Foo = {...Bar}; // this would crash noDupeKeyes

The workaround is to use the Flow commenting syntax, like this:
/**
type Foo = {...Bar};
*/

I'd love to write tests (and had, in fact), but due to some combination of babylon, babel-eslint, and babel-cli, the object type spread syntax wasn't recognized and would fail tests (most immediately caused by babel-eslint). I tried bumping versions, but ended up going down a bit of a rabbit hole because other tests began failing. Seems like a general version bump refresh is in order.

Would appreciate any feedback, thanks!

@gajus gajus merged commit 7946b04 into gajus:master Apr 14, 2018
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.

2 participants