Skip to content

Add internal lint rule to guard against raw strings instead of AST_NODE_TYPES #1503

@bradzacher

Description

@bradzacher

We've gotten most of the cases, but it'd be good to guard against this explicitly in the codebase.

There are a few times where there were things like the following, which aren't strictly false at runtime, but we prefer to use the enums in the codebase.

if (node.type === 'Identifier') {}

An internal lint rule would mean we can add a fixer, and would save us ever having to mention this in code reviews.

Metadata

Metadata

Assignees

No one assigned

    Labels

    has prthere is a PR raised to close thistestsanything to do with testing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions