Skip to content

[BUG] no-useless-await is applied to locator methods regardless of receiver object #350

Open
@ppath

Description

For the locator methods, the check is only against the method name and not the receiver object type. Therefore, in the following example the await before a.locator(); is marked as useless:

class A {
  locator(): Promise<void>;
}
async function () {
  const a = new A;
  await a.locator();
}

It seems the relevant logic is here, and I wonder if there could be an additional check on the receiver object for locator methods, like the one for page methods.

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