playwright-community / eslint-plugin-playwright

ESLint plugin for Playwright
https://www.npmjs.com/package/eslint-plugin-playwright
MIT License
281 stars 39 forks source link

Add rule to remove useless awaits used with expect #306

Closed rafiazman closed 4 weeks ago

rafiazman commented 3 months ago

Playwright assertions (https://playwright.dev/docs/test-assertions) are split into auto-retrying assertions and non-retrying assertions.

A new rule can be created perhaps with the name no-useless-await-expect that would disallow unnecessary awaits for Playwright expects.

Example of incorrect code:

await expect(true).toBeTruthy()

Example of correct code:

expect(true).toBeTruthy()
antebudimir commented 3 months ago

+1 for this rule.

github-actions[bot] commented 4 weeks ago

:tada: This issue has been resolved in version 1.8.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

antebudimir commented 3 weeks ago

Thanks for the effort! 🍻