noDuplicateParameters
Ce contenu n’est pas encore disponible dans votre langue.
Diagnostic Category: lint/suspicious/noDuplicateParameters
Since: v1.0.0
Sources:
- Same as:
no-dupe-args
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.
Examples
Section titled ExamplesInvalid
Section titled Invalidcode-block.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.
code-block.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.