Repository navigation
Add eslint-plugin-playwright enforcement with CI check #26494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
f2a6684
d684f8f
636d5ea
5440414
35b4bc7
171e306
8b88ad3
22e833c
f49326b
cf94f3c
a3c6eaf
12f7a7c
1fb4bfb
d41cc74
280f217
2512386
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,6 +16,7 @@ import i18next from 'eslint-plugin-i18next'; | |
| import jest from 'eslint-plugin-jest'; | ||
| import jestFormatting from 'eslint-plugin-jest-formatting'; | ||
| import jsoncPlugin from 'eslint-plugin-jsonc'; | ||
| import playwright from 'eslint-plugin-playwright'; | ||
| import react from 'eslint-plugin-react'; | ||
| import reactHooks from 'eslint-plugin-react-hooks'; | ||
| import globals from 'globals'; | ||
|
|
@@ -237,20 +238,33 @@ export default [ | |
| // Playwright tests | ||
| { | ||
| files: ['**/playwright/**/*.{js,jsx,ts,tsx}'], | ||
| plugins: { | ||
| playwright, | ||
| }, | ||
| rules: { | ||
| 'jest/expect-expect': 'off', | ||
| 'jest/valid-expect-in-promise': 'off', | ||
| 'jest/valid-expect': 'off', | ||
| 'jest/valid-describe': 'off', | ||
| 'jest/consistent-test-it': 'off', | ||
| 'jest/no-done-callback': 'off', | ||
| 'jest/no-standalone-expect': 'off', | ||
| 'jest/no-conditional-expect': 'off', | ||
| // TypeScript/base rule overrides for Playwright files | ||
| '@typescript-eslint/no-unused-vars': 'off', | ||
| '@typescript-eslint/no-duplicate-enum-values': 'off', | ||
| '@typescript-eslint/no-explicit-any': 'warn', | ||
| '@typescript-eslint/no-unused-expressions': 'warn', | ||
| 'react-hooks/rules-of-hooks': 'off', | ||
| 'prefer-const': 'off', | ||
|
|
||
| // Playwright rules — blocking (error): zero existing violations, prevent regressions | ||
| 'playwright/no-networkidle': 'error', | ||
| 'playwright/no-page-pause': 'error', | ||
| 'playwright/no-focused-test': 'error', | ||
|
|
||
| // Playwright rules — aspirational (warn): existing violations to fix over time | ||
| 'playwright/missing-playwright-await': 'warn', | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Quality: valid-expect at warn level won't catch missing-await bugsThe Was this helpful? React with 👍 / 👎 | Reply |
||
| 'playwright/valid-expect': 'warn', | ||
| 'playwright/no-wait-for-timeout': 'warn', | ||
| 'playwright/no-force-option': 'warn', | ||
| 'playwright/no-element-handle': 'warn', | ||
| 'playwright/no-eval': 'warn', | ||
| 'playwright/no-skipped-test': 'warn', | ||
| 'playwright/prefer-web-first-assertions': 'warn', | ||
| 'playwright/no-useless-await': 'warn', | ||
| 'playwright/no-wait-for-selector': 'warn', | ||
| }, | ||
| }, | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.