# no-dupe-args

> Disallow two parameters with the same name in a function

When two parameters have the same name, the name refers to the last one. You can only reach the argument passed for the first one through `arguments`. It's nearly always a typo or a copy-paste mistake.

In strict mode, in modules and in arrow functions this is already a syntax error. The rule catches it in the scripts where it isn't, such as a `.cjs` file without `"use strict"`.

This rule is on by default in JavaScript files. It's off in TypeScript files, where TypeScript reports the same mistake.

{/* Generated by src/codegen/lint-rule-docs.ts. Do not edit this section. */}

## Configure

On by default as an error. To turn it off:

```toml bunfig.toml
[lint.rules]
"no-dupe-args" = "off" # or "warn"
```

{/* End of the generated section. */}

## Examples

Reported, in a `.cjs` file:

{/* bad {"filename": "legacy.cjs"} */}
```js
function resize(width, height, width) {
  return width * height;
}
```

Not reported:

{/* good */}
```js
function resize(width, height, depth) {
  return width * height * depth;
}
```
