no-invalid-typed-mutation
Keep native object mutation APIs from writing incompatible values into declared property types.
Why
Object.assign, Reflect.set and property descriptors accept values that a normal typed property assignment rejects. They can invalidate a domain object's contract while subsequent reads retain its original type.
Fix
Use an assignment that satisfies the declared property type, or construct and validate a complete replacement. Preserve any deliberate construction or external compatibility contract; do not cast away the incompatibility.
Examples
const counter: { count: number } = { count: 1 };Object.assign(counter, { count: "invalid" });counter.count.toFixed();const counter: { count: number } = { count: 1 };Object.assign(counter, { count: 2 });