Closed
Description
Suggestion
This is a refactoring opportunity that comes from #8216 (comment).
In short, it may be a common pattern to want to check for either code that looks like
object.filter
or
const computedMember = "filter";
object[computedMember];
This could be extracted to a utility with approximate usage
declare const memberExpression: MemberExpressionComputedName | MemberExpressionNonComputedName,
const isFilterCall = isStaticMemberAccessOfValue(memberExpression, "filter");
An example implementation of this is 581e9ae#diff-5af06c156c2d34d6ea1d2b8f91d583d82d7e629cbd5226145c6c0b72449bcfb2R298, implemented in a way that did not aim to be more generic than the needs of that specific module. This might be possible to replace with a more general utility
Metadata
Metadata
Assignees
Labels
Go ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issuePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.Issues related to the @typescript-eslint/utils packageIssues related to the @typescript-eslint/utils packagethings to do with maintenance of the repo, and not with code/docsthings to do with maintenance of the repo, and not with code/docs