[ESLint 8/10] Fix playwright/* warnings - #31032
Conversation
Resolve all playwright/** warnings: no-restricted-syntax (browser.newPage), no-wait-for-timeout/selector, no-force-option, no-skipped-test via disable-with-reason; no-explicit-any fixed with real types. Part of #30977. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
Code Review ✅ ApprovedBehavior-preserving ESLint cleanup addressing playwright test warnings via targeted suppressions and explicit typing. No issues found. OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar | Powered by Gitar — free for open source |
|
| Count | Rule |
|---|---|
| 6 | sonarjs/cyclomatic-complexity |
| 4 | sonarjs/cognitive-complexity |
| 4 | sonarjs/expression-complexity |
| 2 | sonarjs/no-nested-conditional |
| 1 | react-hooks/exhaustive-deps |
All findings
| Location | Rule | Message | |
|---|---|---|---|
| 🟡 | src/components/Settings/Persona/PersonaAIContext/ContextRuleEditor/ContextRuleEditor.component.tsx:112:58 |
sonarjs/cyclomatic-complexity |
{"message":"Function has a complexity of 11 which is greater than 10 authorized.","cost":1,"secondaryLocations":[{"line":112,"column":57,"endLine":112,"endColum |
| 🟡 | src/components/Settings/Persona/PersonaAIContext/ContextRuleEditor/ContextRuleEditor.component.tsx:234:27 |
react-hooks/exhaustive-deps |
The ref value 'previewRequestRef.current' will likely have changed by the time this effect cleanup function runs. If this ref points to a node rendered by React |
| 🟡 | src/components/Settings/Persona/PersonaAIContext/ContextRuleEditor/ContextRuleEditor.component.tsx:532:25 |
sonarjs/no-nested-conditional |
Extract this nested ternary operation into an independent statement. |
| 🟡 | src/utils/QueryBuilderElasticsearchFormatUtils.js:62:10 |
sonarjs/cyclomatic-complexity |
{"message":"Function has a complexity of 11 which is greater than 10 authorized.","cost":1,"secondaryLocations":[{"line":62,"column":9,"endLine":62,"endColumn": |
| 🟡 | src/utils/QueryBuilderElasticsearchFormatUtils.js:424:10 |
sonarjs/cognitive-complexity |
Refactor this function to reduce its Cognitive Complexity from 23 to the 15 allowed. |
| 🟡 | src/utils/QueryBuilderElasticsearchFormatUtils.js:424:10 |
sonarjs/cyclomatic-complexity |
{"message":"Function has a complexity of 15 which is greater than 10 authorized.","cost":5,"secondaryLocations":[{"line":424,"column":9,"endLine":424,"endColumn |
| 🟡 | src/utils/QueryBuilderElasticsearchFormatUtils.js:490:10 |
sonarjs/cognitive-complexity |
Refactor this function to reduce its Cognitive Complexity from 39 to the 15 allowed. |
| 🟡 | src/utils/QueryBuilderElasticsearchFormatUtils.js:490:10 |
sonarjs/cyclomatic-complexity |
{"message":"Function has a complexity of 49 which is greater than 10 authorized.","cost":39,"secondaryLocations":[{"line":490,"column":9,"endLine":490,"endColum |
| 🟡 | src/utils/QueryBuilderElasticsearchFormatUtils.js:649:5 |
sonarjs/expression-complexity |
Reduce the number of conditional operators (5) used in the expression (maximum allowed 3). |
| 🟡 | src/utils/QueryBuilderElasticsearchFormatUtils.js:721:5 |
sonarjs/expression-complexity |
Reduce the number of conditional operators (6) used in the expression (maximum allowed 3). |
| 🟡 | src/utils/QueryBuilderElasticsearchFormatUtils.js:762:10 |
sonarjs/cognitive-complexity |
Refactor this function to reduce its Cognitive Complexity from 28 to the 15 allowed. |
| 🟡 | src/utils/QueryBuilderElasticsearchFormatUtils.js:762:10 |
sonarjs/cyclomatic-complexity |
{"message":"Function has a complexity of 38 which is greater than 10 authorized.","cost":28,"secondaryLocations":[{"line":762,"column":9,"endLine":762,"endColum |
| 🟡 | src/utils/QueryBuilderElasticsearchFormatUtils.js:781:5 |
sonarjs/expression-complexity |
Reduce the number of conditional operators (5) used in the expression (maximum allowed 3). |
| 🟡 | src/utils/QueryBuilderElasticsearchFormatUtils.js:841:7 |
sonarjs/expression-complexity |
Reduce the number of conditional operators (5) used in the expression (maximum allowed 3). |
| 🟡 | src/utils/QueryBuilderElasticsearchFormatUtils.js:848:9 |
sonarjs/no-nested-conditional |
Extract this nested ternary operation into an independent statement. |
| 🟡 | src/utils/QueryBuilderElasticsearchFormatUtils.js:978:17 |
sonarjs/cognitive-complexity |
Refactor this function to reduce its Cognitive Complexity from 16 to the 15 allowed. |
| 🟡 | src/utils/QueryBuilderElasticsearchFormatUtils.js:978:17 |
sonarjs/cyclomatic-complexity |
{"message":"Function has a complexity of 14 which is greater than 10 authorized.","cost":4,"secondaryLocations":[{"line":978,"column":16,"endLine":978,"endColum |
Fix locally (fast - only checks files changed in this branch):
make ui-checkstyle-changed
✅ Playwright Results — workflow succeededValidated commit ✅ 1852 passed · ❌ 0 failed · 🟡 9 flaky · ⏭️ 1 skipped · 🧰 0 lifecycle flaky PerformanceBlocking targets: ✅ met · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 1h 0m 32s ⏱️ Max setup 3m 6s · max shard execution 21m 37s · max shard-job elapsed before upload 25m 33s · reporting 11s 🌐 221.58 requests/attempt · 2.91 app boots/UI scenario · 14.73% common-shard skew Optimization targets still in progress:
🟡 9 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
Fixes #30987. Part of epic #30977.
Stacked PR 8 of 10 — base branch
ShaileshParmar11/eslint-08-i18n. Top of the stack. The diff here contains only the playwright/* changes.mainas each lands. See epic #30977 for the full approach and reviewer caveats.Behavior-preserving lint cleanup. Verified: target rule(s) → 0, no new warnings (git-stash ESLint before/after), 0 new tsc signatures vs baseline.
🤖 Generated with Claude Code
Reviewer notes — why suppressed (playwright)
These are E2E tests that cannot be run/verified from this change, so rewriting them risks destabilising the suite.
no-restricted-syntax(browser.newPage()multi-context pattern),no-wait-for-timeout/no-wait-for-selector,no-force-option, andno-skipped-testare resolved witheslint-disable-next-line … -- <reason>(no test logic changed). The only genuine fixes are the@typescript-eslint/no-explicit-anyhits, which got real types. Rewriting the waits/auth to satisfy the rules is worthwhile but belongs in a dedicated, separately-canaried test-quality pass.