fix(prefer-expect-assertions): support .each
#798
Merged
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.
Fixes #676
Issue was that we were using a specific selector, which couldn't account for
.each
- have refactored the rule to match using conditions instead like the rest of our rules.Had to modify
isEachCall
in the process - technically it's got a slightly different behaviour as it's stricter, but this is actually what's being checked for in the refactored utils so when #792 is landed this method will be doing the right thing anyway. Plus this hasn't broken any tests so its fine(it did break TypeScript, which is why I had to make a change to
lowercase-name
- I'm pretty sure this is another instance of microsoft/TypeScript#35953 but tbh I'm going to look to do a major refactor of our types once I've straighted out the.each
-based stuff anyway, which'll include dropping some of the generics that we don't really need).