widenThenAssertBinding "{{name}}" discards type evidence and later recreates it with an assertion. Keep the precise type from initialization through use; parse boundary input once.small-rules/no-widen-then-assertDisallow local const flows that explicitly widen a known value before asserting the widened binding to a narrower type.
Ported from dmmulroy/anti-slop. Widening a known local value then asserting it back recreates evidence that was already available. Preserve the precise type through the flow, or parse external data once.
widenThenAssertBinding "{{name}}" discards type evidence and later recreates it with an assertion. Keep the precise type from initialization through use; parse boundary input once.This rule does not accept options.
const source = { id: 'second' };const widened: unknown = source;const parsed = widened as { readonly id: string };// SAFETY: parseUser validated this payload.declare const input: unknown;const parsed = input as { readonly id: string };