Lint rules
missing-other-case
errorFlags a plural, selectordinal, or select block that has no other case.
Why this is bad
ICU falls back to other for any value the sibling cases don't match, so a block without one throws when the message is formatted. A message covering only one and few may format fine in testing and fails on the first count outside them.
Examples
Examples of incorrect code for this rule:
messages/en.json
{"messages": "{count, plural, one {1 new message} few {# new messages}}"}
Examples of correct code for this rule:
messages/en.json
{"messages": "{count, plural, one {1 new message} other {# new messages}}"}
How to fix it
Add an other case to the block that holds the general wording:
- If your source locale is affected, make this change in its messages file.
- If a target locale is affected, you can re-translate the message with
eloqnt translate.
npx eloqnt translate --id messages --locale es
Alternatively, add the case to the translation manually.