-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Nikolai Katkov
committed
Feb 1, 2024
1 parent
9f72f9c
commit 19560a0
Showing
2 changed files
with
34 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,71 @@ | ||
import type { Rule } from '../../lib/eslint/rulesConfig' | ||
import type { Rule, RuleInput } from '../../lib/eslint/rulesConfig' | ||
import { projectHas } from '../../lib/eslint/rulesConfig' | ||
|
||
const yes = projectHas('@playwright/test') | ||
const forAllPlaywrightUsage = ({ projectDependencies }: RuleInput) => | ||
projectDependencies.includes('@playwright/test') || projectDependencies.includes('playwright') | ||
|
||
const forTestsOnly = projectHas('@playwright/test') | ||
|
||
export const ruleset: Record<string, Rule> = { | ||
'playwright/max-nested-describe': { | ||
enabled: yes, | ||
enabled: forTestsOnly, | ||
}, | ||
'playwright/missing-playwright-await': { | ||
enabled: yes, | ||
enabled: forTestsOnly, | ||
fixable: true, | ||
}, | ||
'playwright/no-conditional-in-test': { | ||
enabled: false, // may be too disruptive and lacking justificaition // yes, | ||
enabled: false, // may be too disruptive and lacking justificaition // forTestsOnly, | ||
}, | ||
'playwright/no-element-handle': { | ||
enabled: yes, | ||
enabled: forAllPlaywrightUsage, | ||
}, | ||
'playwright/no-eval': { | ||
enabled: yes, | ||
enabled: forAllPlaywrightUsage, | ||
}, | ||
'playwright/no-focused-test': { | ||
enabled: yes, | ||
enabled: forTestsOnly, | ||
}, | ||
'playwright/no-force-option': { | ||
enabled: yes, | ||
enabled: forAllPlaywrightUsage, | ||
}, | ||
'playwright/no-page-pause': { | ||
enabled: yes, | ||
enabled: forAllPlaywrightUsage, | ||
}, | ||
'playwright/no-restricted-matchers': { | ||
enabled: yes, | ||
enabled: forTestsOnly, | ||
}, | ||
'playwright/no-skipped-test': { | ||
enabled: yes, | ||
enabled: forTestsOnly, | ||
}, | ||
'playwright/no-useless-not': { | ||
enabled: yes, | ||
enabled: forTestsOnly, | ||
}, | ||
'playwright/no-wait-for-timeout': { | ||
enabled: yes, | ||
enabled: forAllPlaywrightUsage, | ||
}, | ||
'playwright/prefer-lowercase-title': { | ||
enabled: yes, | ||
enabled: forTestsOnly, | ||
}, | ||
'playwright/prefer-strict-equal': { | ||
enabled: yes, | ||
enabled: forAllPlaywrightUsage, | ||
}, | ||
'playwright/prefer-to-be': { | ||
enabled: yes, | ||
enabled: forTestsOnly, | ||
}, | ||
'playwright/prefer-to-have-length': { | ||
enabled: yes, | ||
enabled: forTestsOnly, | ||
}, | ||
'playwright/prefer-web-first-assertions': { | ||
enabled: yes, | ||
enabled: forTestsOnly, | ||
}, | ||
'playwright/require-soft-assertions': { | ||
enabled: false, // too opinionated | ||
enabled: false, // too opinionated // forTestsOnly | ||
}, | ||
'playwright/require-top-level-describe': { | ||
enabled: false, // rconsider after | ||
enabled: false, // rconsider after // forTestsOnly | ||
}, | ||
'playwright/valid-expect': { | ||
enabled: yes, | ||
enabled: forTestsOnly, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters