Skip to content

Latest commit

 

History

History
20 lines (15 loc) · 982 Bytes

File metadata and controls

20 lines (15 loc) · 982 Bytes

require-implicit-id

Enforce that <Trans>, <Plural>, <SelectOrdinal>, <Select> components and Lingui macro function calls (t, msg, defineMessage) do not have an explicit id.

Relying on auto-generated IDs eliminates the need to maintain a separate mapping of IDs to messages and ensures the catalog stays in sync with the source code. See Benefits of Generated IDs in the Lingui docs for more details.

⚠️ Conflicts: This rule directly conflicts with require-explicit-id. Do not enable both rules at the same time — they are mutually exclusive.

// nope ⛔️
<Trans id="msg.hello">Hello</Trans>
<Plural id="msg.books" value={count} one="# book" other="# books" />
t({ id: "msg.hello", message: "Hello" })

// ok ✅
<Trans>Hello</Trans>
<Plural value={count} one="# book" other="# books" />
t({ message: "Hello" })
t`Hello`