"{ a?: string } means 'a may be missing.' It doesn't mean 'a may be explicitly undefined.' The flag enforces the difference."
What it changes
Without the flag: { a?: string } accepts both {} and { a: undefined }. They're treated as equivalent. With the flag: only the first is accepted; { a: undefined } is now a type error unless you write the type as { a?: string | undefined }.
The difference matters in two real-world scenarios: serialization (JSON.stringify drops undefined keys, but missing keys and undefined keys round-trip differently) and property merging (Object.assign treats {a: undefined} as 'set a to undefined,' not 'leave a alone').
The migration cost
Most codebases have lots of places where {a: undefined} was used to mean 'no value here.' Turning on this flag exposes them all. The fix is usually either:
- Stop setting the property: omit it entirely.
- Make the type allow explicit undefined:
{ a?: string | undefined }. - Stop conflating missing with undefined in the rest of the code.