From 61e70cdeb63b8e7971707af8a2dfe57d75e96f09 Mon Sep 17 00:00:00 2001 From: Sandro Roth <16229645+rothsandro@users.noreply.github.com> Date: Fri, 24 Jan 2025 10:42:44 +0100 Subject: [PATCH 1/2] fix: Add no-slowed-test to sharedConfig --- src/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index f3c2d06..bf9aad4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -20,7 +20,7 @@ import noPagePause from './rules/no-page-pause.js' import noRawLocators from './rules/no-raw-locators.js' import noRestrictedMatchers from './rules/no-restricted-matchers.js' import noSkippedTest from './rules/no-skipped-test.js' -import noSlowedTests from './rules/no-slowed-test.js' +import noSlowedTest from './rules/no-slowed-test.js' import noStandaloneExpect from './rules/no-standalone-expect.js' import noUnsafeReferences from './rules/no-unsafe-references.js' import noUselessAwait from './rules/no-useless-await.js' @@ -73,7 +73,7 @@ const index = { 'no-raw-locators': noRawLocators, 'no-restricted-matchers': noRestrictedMatchers, 'no-skipped-test': noSkippedTest, - 'no-slowed-test': noSlowedTests, + 'no-slowed-test': noSlowedTest, 'no-standalone-expect': noStandaloneExpect, 'no-unsafe-references': noUnsafeReferences, 'no-useless-await': noUselessAwait, @@ -120,6 +120,7 @@ const sharedConfig = { 'playwright/no-networkidle': 'error', 'playwright/no-page-pause': 'warn', 'playwright/no-skipped-test': 'warn', + 'playwright/no-slowed-test': 'warn', 'playwright/no-standalone-expect': 'error', 'playwright/no-unsafe-references': 'error', 'playwright/no-useless-await': 'warn', From 09753367d616a2db2238bb64131847ad7f4a0678 Mon Sep 17 00:00:00 2001 From: Sandro Roth <16229645+rothsandro@users.noreply.github.com> Date: Fri, 24 Jan 2025 14:45:01 +0100 Subject: [PATCH 2/2] fix: remove no-slowed-test from recommended list --- README.md | 2 +- src/index.ts | 1 - src/rules/no-slowed-test.ts | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0b3c812..682bbff 100644 --- a/README.md +++ b/README.md @@ -139,7 +139,7 @@ CLI option\ | [no-raw-locators](https://github.com/playwright-community/eslint-plugin-playwright/tree/main/docs/rules/no-raw-locators.md) | Disallow using raw locators | | | | | [no-restricted-matchers](https://github.com/playwright-community/eslint-plugin-playwright/tree/main/docs/rules/no-restricted-matchers.md) | Disallow specific matchers & modifiers | | | | | [no-skipped-test](https://github.com/playwright-community/eslint-plugin-playwright/tree/main/docs/rules/no-skipped-test.md) | Disallow usage of the `.skip` annotation | ✅ | | 💡 | -| [no-slowed-test](https://github.com/playwright-community/eslint-plugin-playwright/tree/main/docs/rules/no-slowed-test.md) | Disallow usage of the `.slow` annotation | ✅ | | 💡 | +| [no-slowed-test](https://github.com/playwright-community/eslint-plugin-playwright/tree/main/docs/rules/no-slowed-test.md) | Disallow usage of the `.slow` annotation | | | 💡 | | [no-standalone-expect](https://github.com/playwright-community/eslint-plugin-playwright/tree/main/docs/rules/no-standalone-expect.md) | Disallow using expect outside of `test` blocks | ✅ | | | | [no-unsafe-references](https://github.com/playwright-community/eslint-plugin-playwright/tree/main/docs/rules/no-unsafe-references.md) | Prevent unsafe variable references in `page.evaluate()` | ✅ | 🔧 | | | [no-useless-await](https://github.com/playwright-community/eslint-plugin-playwright/tree/main/docs/rules/no-useless-await.md) | Disallow unnecessary `await`s for Playwright methods | ✅ | 🔧 | | diff --git a/src/index.ts b/src/index.ts index bf9aad4..26ff8e1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -120,7 +120,6 @@ const sharedConfig = { 'playwright/no-networkidle': 'error', 'playwright/no-page-pause': 'warn', 'playwright/no-skipped-test': 'warn', - 'playwright/no-slowed-test': 'warn', 'playwright/no-standalone-expect': 'error', 'playwright/no-unsafe-references': 'error', 'playwright/no-useless-await': 'warn', diff --git a/src/rules/no-slowed-test.ts b/src/rules/no-slowed-test.ts index a7b728d..134f45f 100644 --- a/src/rules/no-slowed-test.ts +++ b/src/rules/no-slowed-test.ts @@ -52,7 +52,7 @@ export default createRule({ docs: { category: 'Best Practices', description: 'Prevent usage of the `.slow()` slow test annotation.', - recommended: true, + recommended: false, url: 'https://github.com/playwright-community/eslint-plugin-playwright/tree/main/docs/rules/no-slowed-test.md', }, hasSuggestions: true,