const user = res.data as any
user.profile.preferences.theme = 'dark' // any deep access, no checks
Deterministic AST match: flags assertion expressions whose target type is `any`.
An `as any` cast — bypasses TypeScript's checker entirely. Every guarantee from the type system is gone for that value forward.
Each example shows the exact code shape the rule is looking for, then the smallest version that keeps the intent without hiding risk or adding noise.
const user = res.data as any
user.profile.preferences.theme = 'dark' // any deep access, no checks
Deterministic AST match: flags assertion expressions whose target type is `any`.
const user = UserSchema.parse(res.data)
user.profile.preferences.theme = 'dark'
Validate untrusted data at the boundary and carry the narrowed type forward. If the shape is internal, model it with an interface or type guard instead of erasing it with `any`.
Agents reach for `as any` when they can't easily derive the real shape. It silences the error in 5 seconds and quietly disables the feature you bought TypeScript for.
ai-slop/unsafe-type-assertion
ai-slop
Deterministic AST match: flags assertion expressions whose target type is `any`.
Casts to a concrete type, validated parser output, and narrowing via type guards are not flagged.
Unsafe type escapes appeared across unrelated projects in the first public scan batch.