---
source: https://cli.eloqnt.dev/docs/lint-rules/duplicate-id
docs_index: https://cli.eloqnt.dev/llms.txt
---

# duplicate-id

Flags a message ID that more than one messages folder defines. Only applies when `messages.path` lists multiple folders.

## Why this is bad

Folders merge into a single catalog, so a repeated ID resolves to whichever folder is listed last and the message defined in the other one never reaches a screen.

## How to fix it

Nest each folder's messages under a namespace of its own. IDs stay unique however many folders you add, and the namespace says where a message comes from.

## Examples

Given a `messages.path` that lists two folders:

- `app/messages` (which already defines `save`)
- `packages/ui/messages`

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

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

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

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

---

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