A function of this file is called with more arguments than it has parameters

tx0/ts:extra-call-argumentsrecommendedwarningbug

What it finds

function area(width, height) {...} area(w, h, depth): arguments beyond the parameters of a function are never seen by it. Either the call passes something the function was meant to use, or the function lost a parameter the callers still pass.

The called function must be declared in this file, as a function declaration or a const initialized with a function or arrow function, not reassigned, without a rest parameter, and not reading arguments. Calls with a spread argument are left alone, and so are files with syntax errors and files marked @flow.

From the rule's source, extra_call_arguments.rs.

Example from the rule's tests
function area(width: number, height: number) {  return width * height;}const scale = (n: number) => n * 2;function sum() {  return Array.from(arguments).length;}export const values = [  area(1, 2, 3),tx0 reports: area takes 2 parameters but is given 3 arguments  scale(1, 2),tx0 reports: scale takes 1 parameters but is given 2 arguments  area(1, 2),  sum(),];
Highlighted lines are the ones tx0 reports, with its message under each; the other lines are left alone.

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:

tx0.toml
[rules]
"tx0/ts:extra-call-arguments" = "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:extra-call-arguments] reason="..."

tx0 explain tx0/ts:extra-call-arguments shows the same in the terminal. Found a false positive? Report it.