Why is this an issue?

Consistent naming between arguments and parameters reduces the chances of making mistakes, such as passing the wrong value to a parameter or omitting an argument in a function call. When the names of arguments in a function call match the names of the function parameters, it contributes to clearer, more readable code.

However, when the names match but are passed in a different order than their declaration in the function signature, it may indicate a mistake in the parameter order, likely leading to unexpected results.

function divide(dividend, divisor) {
  return dividend / divisor;
}

function doTheThing() {
  const dividend = 15;
  const divisor = 5;

  const result = divide(divisor, dividend); // Noncompliant: not the expected result
  //...
}

Ensure that the arguments passed to the function are in the correct order, according to the function signature.

function divide(dividend, divisor) {
  return dividend / divisor;
}

function doTheThing() {
  const dividend = 15;
  const divisor = 5;

  const result = divide(dividend, divisor);
  //...
}

Exceptions

Swapped arguments that are compared beforehand in an enclosing if statement are ignored:

function divide(dividend, divisor) {
  return dividend / divisor;
}

function doTheThing() {
  const dividend = 5;
  const divisor = 15;
  if (divisor > dividend) {
    const result = divide(divisor, dividend);
    //...
  }
}

Intentional comparator reversal is also ignored. When the entire body of a 2-parameter wrapper function with single-character parameter names (such as a, b) is a single call whose two arguments are exactly those parameters in reversed order, the swap is treated as a deliberate reverse-order comparator wrapper — a common pattern for descending sort comparators:

const items = ['banana', 'apple', 'cherry'];
items.sort((a, b) => compareStrings(b, a)); // Compliant: intentional descending comparator

Parameter swaps inside object properties with directional or reversal names (such as rtl, ltr, reverse, flip, swap, forward, or backward) are also ignored, as they indicate intentional parameter reversal for bidirectional or symmetric operations:

function setRange(start, end) {
  /* ... */
}

const handlers = {
  ltr: function(start, end) {
    setRange(start, end);
  },
  rtl: function(start, end) {
    setRange(end, start); // Compliant: intentional reversal for RTL direction
  },
};

Resources

Documentation