A method that its declared type marks optional is called without a check
What it finds
handler.onClose() where the interface declares onClose?(): void throws a TypeError whenever the object leaves the method out. The declared type is resolved across modules; reported when nothing else in the function mentions handler.onClose, as a test would, and the call does not use ?.. Projects compiled with strictNullChecks reject such calls already; this rule catches them where the compiler does not.
From the rule's source, unchecked_optional_call.rs.
Turn it on, off or suppress it
The rule runs from the recommended tier up. To turn it on in a lower tier, give it a level in tx0.toml:
[rules]
"tx0/ts:optional-method-called-unchecked" = "warning"To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:
// tx0: ignore[tx0/ts:optional-method-called-unchecked] reason="..."tx0 explain tx0/ts:optional-method-called-unchecked shows the same in the terminal. Found a false positive? Report it.