Closed
Description
Preceding an optional chain with a non-null assertion is useless.
The entire point of the optional chain is that it handles the non-null case.
The non-null assertion doesn't actually change the type, and is functionally useless.
function foo(x?: { a: string }) {
return x!?.a;
}
Thinking about it, this could potentially live as an option within no-extra-non-null-assertion
, but I'm not sure if it entirely fits in there.