Lint rules
undefined-key
errorFlags a message your source code references that is not present in your source locale messages. 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:
messages/en.json
{"save": "Save"}
Examples of correct code for this rule:
messages/en.json
{"save": "Save","discard": "Discard"}
How to fix it
The report names the call site, e.g.:
Used in src/Settings.tsx:12 but not defined for en
First, check which of these causes applies:
- Misspelled key: Correct the key at the call site.
- Missing message: Extract the message to your source locale.
- Extraction hasn’t run: If you use
useExtracted, you must extract your messages.
Once a new message is in your source locale, eloqnt translate fills in its translations.