Lint Rules

noDuplicateParameters (since v0.9.0)

This rule is recommended by Rome.

Disallow duplicate function arguments name.

Examples

Invalid

var f = function(a, b, b) {}
suspicious/noDuplicateParameters.js:1:24 lint/suspicious/noDuplicateParameters ━━━━━━━━━━━━━━━━━━━━━

   Duplicate argument name
  
  > 1 │ var f = function(a, b, b) {}
                          ^
    2 │ 
  
function b(a, b, b) {}
suspicious/noDuplicateParameters.js:1:18 lint/suspicious/noDuplicateParameters ━━━━━━━━━━━━━━━━━━━━━

   Duplicate argument name
  
  > 1 │ function b(a, b, b) {}
                    ^
    2 │ 
  

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]]) {}