noDuplicateParameters (since v0.9.0)
This rule is recommended by Rome.
Disallow duplicate function parameter name.
If more than one parameter has the same name in a function definition, the last occurrence overrides the preceding occurrences. A duplicated name might be a typing error.
Source: https://eslint.org/docs/latest/rules/no-dupe-args
Examples
Invalid
var f = function(a, b, b) {}
suspicious/noDuplicateParameters.js:1:24 lint/suspicious/noDuplicateParameters ━━━━━━━━━━━━━━━━━━━━━
✖ Duplicate parameter name.
> 1 │ var f = function(a, b, b) {}
│ ^
2 │
ℹ The parameter overrides a preceding parameter by using the same name.
function b(a, b, b) {}
suspicious/noDuplicateParameters.js:1:18 lint/suspicious/noDuplicateParameters ━━━━━━━━━━━━━━━━━━━━━
✖ Duplicate parameter name.
> 1 │ function b(a, b, b) {}
│ ^
2 │
ℹ The parameter overrides a preceding parameter by using the same name.
Valid
function i(i, b, c) {}
var j = function (j, b, c) {};
function k({ k, b }, { c, d }) {}
function l([, l]) {}
function foo([[a, b], [c, d]]) {}