# symbol-description

> Require a description when creating a `Symbol`

A symbol made with `Symbol()` prints as `Symbol()` in logs and in the debugger, so you can't tell them apart. With a description it prints as `Symbol(userId)`, and `symbol.description` returns the text.

Any argument counts as a description, not only a string literal. Your own function named `Symbol` isn't checked.

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

## Configure

Off by default. To turn it on:

```toml bunfig.toml
[lint.rules]
"symbol-description" = "error" # or "warn"
```

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

## Examples

Reported:

{/* bad */}
```js
const userId = Symbol();
```

Not reported:

{/* good */}
```js
const userId = Symbol("userId");

function makeKey(name) {
  return Symbol(name);
}
```
