Skip to content

fix(prefer-array-to-reversed): skip spreads of non-array iterables - #188

Open
maksimgm wants to merge 2 commits into
e18e:mainfrom
maksimgm:fix/to-reversed-non-array-spread
Open

maksimgm wants to merge 2 commits into
e18e:mainfrom
maksimgm:fix/to-reversed-non-array-spread

Conversation

@maksimgm

Copy link
Copy Markdown

closes #187

prefer-array-to-reversed now skips spreads of Set/Map/iterators (and vars typed or initialized as them), same as prefer-array-to-sorted already does. moved those helpers from to-sorted into utils/ast.ts so both rules share them

added the same valid cases to-sorted has, plus the example from the issue

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.

prefer-array-to-reversed: false positive when spreading non-array iterables like Set

1 participant