This repository has been archived by the owner on Aug 18, 2021. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
visitorKeysMap
has always been a copy oft.VISITOR_KEYS
. After doing some archeology, it seems like there's been confusion wrt lodash'spick
vspickBy
, which led to this.When
visitorKeysMap
was first introduced in #109, it usedlodash.pick@3
. In that version, the predicate was called with(value, key, object)
. It was later switched tolodash.pickby@4
in #301. Because inlodash@4
,pick
switched to calling the predicate with(key, value, object)
, andpickby
kept the oldpick
behavior. Throughout this, the value passed toindexOf
was always an array (those are the values oft.VISITOR_KEYS
), andindexOf
was comparing that to strings (the values oft.FLIPPED_ALIAS_KEYS.Flow
). So that meant that-1 === -1
andvisitorKeysMap
became a shallow copy oft.VISITOR_KEYS
. #450 didn't help because it copied the same behavior.This is a very big change. I ran this against the tests in https://github.com/gajus/eslint-plugin-flowtype and on a full eslint run of https://github.com/facebook/nuclide - and
babel-eslint
continues to work.