Skip to content
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

feat(eslint): update eslint-plugin-playwright #98

Merged
merged 2 commits into from Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 5 additions & 4 deletions eslint/playwright-test.js
@@ -1,6 +1,7 @@
module.exports = {
extends: [
'plugin:playwright/playwright-test',
require.resolve('./rules/playwright-test.js'),
],
plugins: ['playwright'],
extends: [require.resolve('./rules/playwright-test.js')],
env: {
'shared-node-browser': true,
},
};
15 changes: 8 additions & 7 deletions eslint/rules/playwright-test.js
@@ -1,9 +1,10 @@
// Source: https://github.com/playwright-community/eslint-plugin-playwright/blob/main/src/index.ts
// Source: https://github.com/playwright-community/eslint-plugin-playwright/blob/v1.5.1/src/index.ts#L101-L129
const recommended = {
'no-empty-pattern': 'off',
'playwright/expect-expect': 'warn',
'playwright/max-nested-describe': 'warn',
'playwright/missing-playwright-await': 'error',
'playwright/no-conditional-expect': 'warn',
'playwright/no-conditional-in-test': 'warn',
'playwright/no-element-handle': 'warn',
'playwright/no-eval': 'warn',
Expand All @@ -13,11 +14,17 @@ const recommended = {
'playwright/no-networkidle': 'error',
'playwright/no-page-pause': 'warn',
'playwright/no-skipped-test': 'warn',
'playwright/no-standalone-expect': 'error',
'playwright/no-unsafe-references': 'error',
'playwright/no-useless-await': 'warn',
'playwright/no-useless-not': 'warn',
'playwright/no-wait-for-selector': 'warn',
'playwright/no-wait-for-timeout': 'warn',
'playwright/prefer-web-first-assertions': 'error',
'playwright/valid-describe-callback': 'error',
'playwright/valid-expect': 'error',
'playwright/valid-expect-in-promise': 'error',
'playwright/valid-title': 'error',
};

module.exports = {
Expand All @@ -35,11 +42,5 @@ module.exports = {
* 🔧 Fixable - https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/prefer-lowercase-title.md
*/
'playwright/prefer-to-have-length': 'warn',
/**
* Require test cases and hooks to be inside a `test.describe` block.
*
* 🚫 Not fixable - https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/prefer-lowercase-title.md
*/
'playwright/require-top-level-describe': 'error',
},
mrmckeb marked this conversation as resolved.
Show resolved Hide resolved
};
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -49,7 +49,7 @@
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-jest": "^27.2.3",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-playwright": "^0.16.0",
"eslint-plugin-playwright": "^1.5.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-testing-library": "^6.0.1",
Expand Down
27 changes: 18 additions & 9 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.