---
url: /docs/guide/usage/linter/rules/unicorn/no-useless-undefined.md
---

### What it does

Prevents usage of `undefined` in cases where it would be useless.

::: warning
This rule can conflict with the default behaviors of the `eslint/array-callback-return`
and `eslint/getter-return` rules. For both rules, you can set
the `allowImplicit` option to avoid conflicts.
:::

### Why is this bad?

`undefined` is the default value for new variables, parameters,
return statements, etc, so specifying `undefined` in these cases
is pointless.

### Examples

Examples of **incorrect** code for this rule:

```javascript
let foo = undefined;
const noop = () => undefined;
```

Examples of **correct** code for this rule:

```javascript
let foo;
const noop = () => {};
```

## Configuration

This rule accepts a configuration object with the following properties:

### checkArguments

type: `boolean`

default: `true`

Whether to check for useless `undefined` in function call arguments.

### checkArrowFunctionBody

type: `boolean`

default: `true`

Whether to check for useless `undefined` in arrow function bodies.

## How to use

## Version

This rule was added in v0.6.1.

## References
