Skip to content

Rule request: don't use the in operator on nodes #326

Closed
@JoshuaKGoldberg

Description

@JoshuaKGoldberg

Continuing conversation from here typescript-eslint/typescript-eslint#5610 (comment): We (typescript-eslint) generally try not to use string in checking pattern on AST nodes, as it's a little imprecise. We normally check for specific types.

- if ('async' in node && node.async) {
+ if (isFunctionLike(node) && node.async) {

How about making this an ESLint rule?

cc @eliasm307 since we were chatting 🙂

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions