A type is written as any, which switches off type checking for the value
What it finds
function parse(input: any), data as any: any turns type checking off for the value and for everything computed from it, so mistakes that the compiler would catch pass silently and spread. unknown keeps the checks and asks for a narrowing before use.
Every written any type is reported. Code at the edges of untyped libraries uses it on purpose, which is why the rule is strict.
From the rule's source, explicit_any.rs.
function parse(input: any): unknown {tx0 reports: any switches off type checking here const data = JSON.parse(input) as any;tx0 reports: any switches off type checking here const safe: unknown = data; return safe;} Turn it on, off or suppress it
The rule runs from the strict tier up. To turn it on in a lower tier, give it a level in tx0.toml:
[rules]
"tx0/ts:explicit-any" = "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:explicit-any] reason="..."tx0 explain tx0/ts:explicit-any shows the same in the terminal. Found a false positive? Report it.