From ea049e454c393b75630f553ba8911818cdd67eb4 Mon Sep 17 00:00:00 2001 From: edzis Date: Fri, 24 Apr 2026 20:37:34 +0300 Subject: [PATCH] feat: add no-macro-inside-macro rule, narrow no-expression-in-message Closes #90. Forbids nesting Lingui translation macros inside each other. Covers: - message macro (t/msg/defineMessage) inside another message macro - any translation macro inside a /`, `` — extracts as a **standalone translation unit**. A standalone unit can't be composed into another one: the inner macro becomes an opaque expression at extract time, the outer message falls back to positional placeholders (`{0}`, `{1}`), and the `.po` file ends up with useless (sometimes enormous) placeholder comments. + +Concretely, this rule forbids a translation macro inside any of: + +- another message macro's template literal or message body (`` t`…${inner}…` ``, `t({ message: `…${inner}…` })`) +- a `` / ` with plain string branches', + code: '', + code: ' interpolated into t`` template', + code: 't`outer ${ branches', + code: '