# no-unnecessary-default-arguments

Rule `unicorn/no-unnecessary-default-arguments`. Disallow arguments that match their parameter defaults.

- Source: unicorn
- Technologies: JavaScript
- Kind: style
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 0 weekly downloads of presets that enable it
- Trend: 0% last quarter
- Rank: #2023 by reach

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `unicorn/no-unnecessary-default-arguments` | no | safe | package `eslint-plugin-unicorn` | [docs](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v80.0.0/docs/rules/no-unnecessary-default-arguments.md) |

## Code examples

### Incorrect: the rule reports this

```js
run(true);
```

```js
format(width, {unit: 'px', digits: 2});
```

```js
run({enabled: true});
```

### Correct: the rule accepts this

```js
run();
```

```js
format(width, {digits: 2});
```

```js
run({});
```

Examples from the ESLint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
import unicorn from "eslint-plugin-unicorn";

export default [
  {
    plugins: { unicorn },
    rules: {
      "unicorn/no-unnecessary-default-arguments": "error",
    },
  },
];
```

## Related rules

- [unicorn/no-unreadable-new-expression](https://lintradar.dev/rules/unicorn/no-unreadable-new-expression.md): Disallow unreadable `new` expressions.
- [unicorn/no-unsafe-dom-html](https://lintradar.dev/rules/unicorn/no-unsafe-dom-html.md): Disallow unsafe DOM HTML APIs.
- [unicorn/no-repeated-call-wrappers](https://lintradar.dev/rules/unicorn/no-repeated-call-wrappers.md): Disallow repeating the same wrapper at every call to a function.
- [unicorn/no-unused-properties](https://lintradar.dev/rules/unicorn/no-unused-properties.md): Disallow unused object properties.
- [unicorn/no-missing-local-resource](https://lintradar.dev/rules/unicorn/no-missing-local-resource.md): Disallow references to missing local resources.
- [unicorn/prefer-dispose](https://lintradar.dev/rules/unicorn/prefer-dispose.md): Prefer using `using`/`await using` over manual `try`/`finally` resource disposal.

---

Web page: https://lintradar.dev/rules/unicorn/no-unnecessary-default-arguments. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
