Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Repo: Make utility for static member access #8323

Copy link
Copy link
Closed
@kirkwaiblinger

Description

@kirkwaiblinger
Issue body actions

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

No one assigned

    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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.