parseInt is given a radix outside 2 to 36, so it always returns NaN
What it finds
parseInt(value, 1), Number.parseInt(s, 40): the radix must be 0 or between 2 and 36, and any other number makes parseInt return NaN for every input.
parseInt must be the global function or Number.parseInt, and the radix a number literal.
From the rule's source, parse_int_radix.rs.
function read(value: string) { const a = parseInt(value, 1);tx0 reports: a radix of 1 makes parseInt return NaN const b = Number.parseInt(value, 40);tx0 reports: a radix of 40 makes parseInt return NaN return a + b + parseInt(value, 16) + parseInt(value, 0);} Turn it on, off or suppress it
The rule runs in every tier. To turn it off for a project, set its level in tx0.toml:
[rules]
"tx0/ts:parse-int-radix" = "off"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:parse-int-radix] reason="..."tx0 explain tx0/ts:parse-int-radix shows the same in the terminal. Found a false positive? Report it.