eslint-plugin-playwright icon indicating copy to clipboard operation
eslint-plugin-playwright copied to clipboard

Add a rule for validating that actions are `await`ed

Open Aghassi opened this issue 1 year ago • 0 comments
trafficstars

Right now there are two await related rules

One to make sure that expect awaits if locators are what is being asserted on, and one to make sure there are no useless awaits. That being said you can still do the following

const locator = page.getByRole('button')
locator.click()

When you should have to use an await on locator.click().

It would be nice to have a rule to assert that all action driven functions also need an await call.

Alternatively, I'm open to other eslint rules that may already handle this case. I've tried a few but none of them seem to catch this use case.

Aghassi avatar May 23 '24 18:05 Aghassi