From ddf30859a3d7a1723017e6bf4c54f67a8829875b Mon Sep 17 00:00:00 2001 From: Sergey Kintsel Date: Wed, 5 Jun 2024 21:35:51 +0100 Subject: [PATCH] Add eslint playwright plugin --- .eslintrc | 7 +++++++ package.json | 1 + src/e2e/steps/utils.ts | 1 + yarn.lock | 25 +++++++++++++++++++++++++ 4 files changed, 34 insertions(+) diff --git a/.eslintrc b/.eslintrc index e228b5c33c..7bf32fd066 100644 --- a/.eslintrc +++ b/.eslintrc @@ -135,5 +135,12 @@ "deprecation/deprecation": "off", }, }, + { + "files": "src/e2e/**", + "extends": "plugin:playwright/recommended", + "rules": { + "playwright/no-standalone-expect": "off", + }, + }, ], } diff --git a/package.json b/package.json index 81d705cffa..06614683d5 100644 --- a/package.json +++ b/package.json @@ -102,6 +102,7 @@ "eslint-plugin-import": "^2.29.1", "eslint-plugin-jest": "^28.5.0", "eslint-plugin-jest-dom": "^5.4.0", + "eslint-plugin-playwright": "^1.6.2", "eslint-plugin-react": "^7.34.2", "eslint-plugin-react-hooks": "^4.6.2", "eslint-plugin-react-redux": "^4.1.0", diff --git a/src/e2e/steps/utils.ts b/src/e2e/steps/utils.ts index 1dce1a729b..765282aa44 100644 --- a/src/e2e/steps/utils.ts +++ b/src/e2e/steps/utils.ts @@ -83,6 +83,7 @@ When("I wait for TZKT to process the updates", async function (this: CustomWorld const previous = getLastAppliedBlock(); for (;;) { + // eslint-disable-next-line playwright/no-wait-for-timeout await this.page.waitForTimeout(100); if (getLastAppliedBlock() !== previous) { break; diff --git a/yarn.lock b/yarn.lock index 20e53a7a5e..e84d816700 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9169,6 +9169,21 @@ __metadata: languageName: node linkType: hard +"eslint-plugin-playwright@npm:^1.6.2": + version: 1.6.2 + resolution: "eslint-plugin-playwright@npm:1.6.2" + dependencies: + globals: "npm:^13.23.0" + peerDependencies: + eslint: ">=8.40.0" + eslint-plugin-jest: ">=25" + peerDependenciesMeta: + eslint-plugin-jest: + optional: true + checksum: 10/cd3ed38a768f91f37894b8db7d0c6b87d26d49bc548a9fa4f1a1d20f0386570486c16925033938c8f0a56c412409e86f0b6c29832f308dfe13b3237af40d94f9 + languageName: node + linkType: hard + "eslint-plugin-react-hooks@npm:^4.6.2": version: 4.6.2 resolution: "eslint-plugin-react-hooks@npm:4.6.2" @@ -10063,6 +10078,15 @@ __metadata: languageName: node linkType: hard +"globals@npm:^13.23.0": + version: 13.24.0 + resolution: "globals@npm:13.24.0" + dependencies: + type-fest: "npm:^0.20.2" + checksum: 10/62c5b1997d06674fc7191d3e01e324d3eda4d65ac9cc4e78329fa3b5c4fd42a0e1c8722822497a6964eee075255ce21ccf1eec2d83f92ef3f06653af4d0ee28e + languageName: node + linkType: hard + "globalthis@npm:^1.0.1, globalthis@npm:^1.0.3": version: 1.0.3 resolution: "globalthis@npm:1.0.3" @@ -15648,6 +15672,7 @@ __metadata: eslint-plugin-import: "npm:^2.29.1" eslint-plugin-jest: "npm:^28.5.0" eslint-plugin-jest-dom: "npm:^5.4.0" + eslint-plugin-playwright: "npm:^1.6.2" eslint-plugin-react: "npm:^7.34.2" eslint-plugin-react-hooks: "npm:^4.6.2" eslint-plugin-react-redux: "npm:^4.1.0"