---
source: https://cli.eloqnt.dev/docs/lint-rules/undefined-key
docs_index: https://cli.eloqnt.dev/llms.txt
---

# undefined-key

Flags a key your source code references that the source locale doesn't define. Only applies when `srcPath` is set, and currently only supports `next-intl`.

## Why this is bad

There is no message to render, so rendering may fail or use a fallback.

## Examples

Given source code that calls `t('discard')`.

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

```json title="messages/en.json"
{
  "save": "Save"
}
```

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

```json title="messages/en.json"
{
  "save": "Save",
  "discard": "Discard"
}
```

---

For an index of every eloqnt/cli documentation page, see [https://cli.eloqnt.dev/llms.txt](https://cli.eloqnt.dev/llms.txt).
