-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issuelocked due to agePlease 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.package: utilsIssues related to the @typescript-eslint/utils packageIssues related to the @typescript-eslint/utils packagerepo maintenancethings to do with maintenance of the repo, and not with code/docsthings to do with maintenance of the repo, and not with code/docs
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
auvred, JoshuaKGoldberg and yeonjuan
Metadata
Metadata
Assignees
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issuelocked due to agePlease 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.package: utilsIssues related to the @typescript-eslint/utils packageIssues related to the @typescript-eslint/utils packagerepo maintenancethings to do with maintenance of the repo, and not with code/docsthings to do with maintenance of the repo, and not with code/docs