no-unsafe-mock-casting
Disallow casting to mock types like jest.Mock or vi.Mock. Use vi.mocked() or jest.mocked() instead.
Why
A type assertion can claim an unmocked value is a mock and bypass checking between the original callable and the mock API.
Fix
Create the mock or spy first, then use the framework's mocked helper to preserve the original value's type. The helper does not create or verify a runtime mock.
Examples
import type * as vi from "vitest";const m = myFn as vi.Mock;import { vi } from "vitest";const client = { read: () => "value" };vi.spyOn(client, "read");const m = vi.mocked(client.read);