eslint-plugin-playwright 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -79,3 +79,22 @@ The rule accepts a non-required option which can be used to specify custom match
79
79
  ]
80
80
  }
81
81
  ```
82
+ ### `no-page-pause`
83
+
84
+ Prevent usage of `page.pause()`.
85
+
86
+ #### Example
87
+
88
+ Example of **incorrect** code for this rule:
89
+
90
+ ```js
91
+ await page.click('button');
92
+ await page.pause();
93
+ ```
94
+
95
+ Example of **correct** code for this rule:
96
+
97
+ ```js
98
+ await page.click('button');
99
+ ```
100
+
package/lib/index.js CHANGED
@@ -10,6 +10,7 @@ module.exports = {
10
10
  rules: {
11
11
  "no-empty-pattern": "off",
12
12
  "playwright/missing-playwright-await": "error",
13
+ "playwright/no-page-pause": "warn",
13
14
  },
14
15
  },
15
16
  "jest-playwright": {
@@ -20,6 +21,7 @@ module.exports = {
20
21
  },
21
22
  rules: {
22
23
  "playwright/missing-playwright-await": "error",
24
+ "playwright/no-page-pause": "warn",
23
25
  "jest/no-standalone-expect": [
24
26
  "error",
25
27
  {
@@ -46,5 +48,6 @@ module.exports = {
46
48
  },
47
49
  rules: {
48
50
  "missing-playwright-await": missingPlaywrightAwait,
51
+ "no-page-pause": noPagePause,
49
52
  },
50
53
  };
@@ -62,7 +62,6 @@ const playwrightTestMatchers = [
62
62
  "toHaveTitle",
63
63
  "toHaveURL",
64
64
  "toHaveValue",
65
- "toMatchSnapshot",
66
65
  ];
67
66
 
68
67
  module.exports = {
@@ -0,0 +1,22 @@
1
+ module.exports = {
2
+ create(context) {
3
+ return {
4
+ MemberExpression(node) {
5
+ if (node.object.name === "page" && node.property.name === "pause") {
6
+ context.report({ messageId: "noPagePause", node });
7
+ }
8
+ },
9
+ };
10
+ },
11
+ meta: {
12
+ docs: {
13
+ category: "Possible Errors",
14
+ description: "Prevent usage of page.pause()",
15
+ recommended: true,
16
+ },
17
+ messages: {
18
+ noPagePause: "Unexpected use of page.pause().",
19
+ },
20
+ type: "problem",
21
+ },
22
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "eslint-plugin-playwright",
3
3
  "description": "ESLint plugin for Playwright testing.",
4
- "version": "0.6.0",
4
+ "version": "0.7.0",
5
5
  "main": "lib/index.js",
6
6
  "repository": "https://github.com/playwright-community/eslint-plugin-playwright",
7
7
  "author": "Max Schmitt <max@schmitt.mx>",
@@ -13,8 +13,8 @@
13
13
  "test": "jest"
14
14
  },
15
15
  "devDependencies": {
16
- "eslint": "^7.25.0",
17
- "jest": "^27.0.6"
16
+ "eslint": "^8.4.1",
17
+ "jest": "^27.4.5"
18
18
  },
19
19
  "peerDependencies": {
20
20
  "eslint": ">=7",