Skip to content

Lint rules reference

Sam A. Horvath-Hunt edited this page Aug 29, 2023 · 9 revisions

Lint rules reference

duplicate-plural-case

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}}.

duplicate-select-case

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}}.

redundant-plural

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.

redundant-select

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.

Internal

These lint rules are only run via the --with-internal flag and are Unsplash-specific.

invalid-non-ascii-char

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.

too-many-interpolations

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.