-
Notifications
You must be signed in to change notification settings - Fork 3
Lint rules reference
Since 0.6.0.
Duplicate cases in plurals are redundant as only one branch will be matched in the output code.
Instead of {n, plural, one {x} one {y} other {z}}
, consider {n, plural, one {x} other {z}}
.
Since 0.6.0.
Duplicate cases in selects are redundant as only one branch will be matched in the output code.
Instead of {x, select, a {x} b {y} a {z}}
, consider {x, select, a {x} b {y}}
.
Since 0.5.0.
Plurals with only wildcards are redundant. They can be replaced with plain number interpolations.
Instead of {n, plural, other {# etc}}
, consider {n, number} etc
.
Since 0.5.0.
Selects with only wildcards are redundant. They can be replaced with plain string interpolations.
Instead of {x, select, other {{x} etc}}
, consider {x} etc
.
These lint rules are only run via the --with-internal
flag and are Unsplash-specific.
Since 0.5.0.
Our translation vendor's tooling supports ASCII and an unspecified subset of Unicode. This rule disallowes all non-ASCII characters except a select few that we've validated are supported.
Since 0.5.0.
Our translation vendor has poor support for ICU syntax, and their parser particularly struggles with interpolations. This rule limits the use of a subset of interpolations to one per message.
Callbacks and plurals are allowed an unlimited number of times. The former because the vendor's tool has no issues parsing its syntax and the latter because it's a special case that we can't rewrite.
Messages that breach this rule can typically be broken up into separate messages and combined in code.