Skip to content

chore(tools): ban as any via eslint and fix existing usages#39709

Merged
pavelfeldman merged 1 commit intomicrosoft:mainfrom
pavelfeldman:chore-ban-as-any-tools
Mar 16, 2026
Merged

chore(tools): ban as any via eslint and fix existing usages#39709
pavelfeldman merged 1 commit intomicrosoft:mainfrom
pavelfeldman:chore-ban-as-any-tools

Conversation

@pavelfeldman
Copy link
Member

Summary

  • Add no-restricted-syntax ESLint rule targeting as any casts in tools code to prevent accidental casting to client interfaces
  • Replace as any with precise types where possible (e.g. Parameters<playwright.Frame['getByRole']>[0], zod issue discriminated union)
  • Add eslint-disable comments with justification for remaining unavoidable as any usages
  • Minor cleanups: simplify sanitizeUnicode, tighten callTool signature, remove dead code in sessionLog

🤖 Generated with Claude Code

Add no-restricted-syntax rule targeting TSAsExpression > TSAnyKeyword
to prevent accidental casts to client interfaces. Replace `as any` with
precise types where possible; add eslint-disable comments with
justification where unavoidable.
@pavelfeldman pavelfeldman force-pushed the chore-ban-as-any-tools branch from a215c8e to 1436311 Compare March 16, 2026 23:07
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@pavelfeldman pavelfeldman merged commit 8dcb1c3 into microsoft:main Mar 16, 2026
34 of 37 checks passed
@github-actions
Copy link
Contributor

Test results for "MCP"

5339 passed, 186 skipped


Merge workflow run.

@github-actions
Copy link
Contributor

Test results for "tests 1"

11 failed
❌ [default] › run-tests.spec.ts:226 › should show error message @vscode-extension
❌ [default] › run-tests.spec.ts:278 › should show soft error messages @vscode-extension
❌ [default] › run-tests.spec.ts:818 › should report project-specific failures @vscode-extension
❌ [default-reuse] › run-tests.spec.ts:226 › should show error message @vscode-extension
❌ [default-reuse] › run-tests.spec.ts:278 › should show soft error messages @vscode-extension
❌ [default-reuse] › run-tests.spec.ts:818 › should report project-specific failures @vscode-extension
❌ [default-trace] › run-tests.spec.ts:226 › should show error message @vscode-extension
❌ [default-trace] › run-tests.spec.ts:278 › should show soft error messages @vscode-extension
❌ [default-trace] › run-tests.spec.ts:383 › should only create test run if folder belongs to context @vscode-extension
❌ [default-trace] › run-tests.spec.ts:818 › should report project-specific failures @vscode-extension
❌ [playwright-test] › playwright.reuse.browser.spec.ts:102 › should produce correct test steps @ubuntu-latest-node20

6 flaky ⚠️ [chromium-library] › library/video.spec.ts:358 › screencast › should capture navigation `@chromium-ubuntu-22.04-arm-node20`
⚠️ [chromium-library] › library/trace-viewer.spec.ts:1223 › should display language-specific locators `@chromium-ubuntu-22.04-node24`
⚠️ [chromium-library] › library/trace-viewer.spec.ts:1223 › should display language-specific locators `@chromium-ubuntu-22.04-node22`
⚠️ [firefox-library] › library/inspector/cli-codegen-1.spec.ts:1080 › cli codegen › should not throw csp directive violation errors `@firefox-ubuntu-22.04-node20`
⚠️ [firefox-page] › page/page-wait-for-function.spec.ts:104 › should work with strict CSP policy `@firefox-ubuntu-22.04-node20`
⚠️ [webkit-library] › library/har.spec.ts:163 › should include form params `@webkit-ubuntu-22.04-node20`

38764 passed, 847 skipped


Merge workflow run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants