Skip to content
This repository was archived by the owner on Feb 11, 2025. It is now read-only.

Commit 4b89216

Browse files
authoredMar 5, 2024··
feat(eslint): update eslint-plugin-playwright (#98)
1 parent dc392a1 commit 4b89216

File tree

4 files changed

+32
-21
lines changed

4 files changed

+32
-21
lines changed
 

‎eslint/playwright-test.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module.exports = {
2-
extends: [
3-
'plugin:playwright/playwright-test',
4-
require.resolve('./rules/playwright-test.js'),
5-
],
2+
plugins: ['playwright'],
3+
extends: [require.resolve('./rules/playwright-test.js')],
4+
env: {
5+
'shared-node-browser': true,
6+
},
67
};

‎eslint/rules/playwright-test.js

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
// Source: https://github.com/playwright-community/eslint-plugin-playwright/blob/main/src/index.ts
1+
// Source: https://github.com/playwright-community/eslint-plugin-playwright/blob/v1.5.1/src/index.ts#L101-L129
22
const recommended = {
33
'no-empty-pattern': 'off',
44
'playwright/expect-expect': 'warn',
55
'playwright/max-nested-describe': 'warn',
66
'playwright/missing-playwright-await': 'error',
7+
'playwright/no-conditional-expect': 'warn',
78
'playwright/no-conditional-in-test': 'warn',
89
'playwright/no-element-handle': 'warn',
910
'playwright/no-eval': 'warn',
@@ -13,11 +14,17 @@ const recommended = {
1314
'playwright/no-networkidle': 'error',
1415
'playwright/no-page-pause': 'warn',
1516
'playwright/no-skipped-test': 'warn',
17+
'playwright/no-standalone-expect': 'error',
18+
'playwright/no-unsafe-references': 'error',
1619
'playwright/no-useless-await': 'warn',
1720
'playwright/no-useless-not': 'warn',
21+
'playwright/no-wait-for-selector': 'warn',
1822
'playwright/no-wait-for-timeout': 'warn',
1923
'playwright/prefer-web-first-assertions': 'error',
24+
'playwright/valid-describe-callback': 'error',
2025
'playwright/valid-expect': 'error',
26+
'playwright/valid-expect-in-promise': 'error',
27+
'playwright/valid-title': 'error',
2128
};
2229

2330
module.exports = {
@@ -35,11 +42,5 @@ module.exports = {
3542
* 🔧 Fixable - https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/prefer-lowercase-title.md
3643
*/
3744
'playwright/prefer-to-have-length': 'warn',
38-
/**
39-
* Require test cases and hooks to be inside a `test.describe` block.
40-
*
41-
* 🚫 Not fixable - https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/prefer-lowercase-title.md
42-
*/
43-
'playwright/require-top-level-describe': 'error',
4445
},
4546
};

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"eslint-plugin-import": "^2.28.1",
5050
"eslint-plugin-jest": "^27.2.3",
5151
"eslint-plugin-jsx-a11y": "^6.7.1",
52-
"eslint-plugin-playwright": "^0.16.0",
52+
"eslint-plugin-playwright": "^1.5.1",
5353
"eslint-plugin-react": "^7.33.2",
5454
"eslint-plugin-react-hooks": "^4.6.0",
5555
"eslint-plugin-testing-library": "^6.0.1",

‎pnpm-lock.yaml

+18-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
This repository has been archived.