eloqnt/studiov0.6
Navigation

Lint rules

missing-other-case

error

Flags 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}}"
}