Skip to content

invalid-typeof: Allow comparing against identifiers #1375

@marvinhagemeister

Description

@marvinhagemeister

Currently this lint rule is complaining about code like this:

const type = "string";
if (typeof foo === type) {}

I feel like that should be accepted by default. TypeScript already checks the type value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions