lint rule: "a message should only be used once" #2253
Closed
Answered
by
samuelstroschein
samuelstroschein
asked this question in
[inlang SDK] Feature Requests
-
ProblemReferencing the same message in multiple places leads to a broken message. No guarantee exists that a message with the content like "learn more" won't be changed by someone to "learn more about unlimited inboxes". If the message is rendering all "learn more" references, the example website below will break at 2 and 3. ProposalA lint rule that detects if a message id is used multiple times in source code. // unlimited inboxes
<p>{m.elephant_big_tree()}</p>
// manage team members
// 💥 error m.elephant is used multiple times
<p>{m.elephant_big_tree()}</p>
// spam report
// 💥 error m.elephant is used multiple times
<p>{m.blue_box({ title: m.elephant_big_tree() })}</p> (Creating new messages is cheaper than trying to manage shared messages.) Additional information |
Beta Was this translation helpful? Give feedback.
Answered by
samuelstroschein
Mar 22, 2024
Replies: 2 comments 2 replies
-
cc @martin-lysk who is a strong advocate of a message should only be once |
Beta Was this translation helpful? Give feedback.
2 replies
-
discussion moved to opral/inlang-sdk#7 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
samuelstroschein
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
discussion moved to opral/inlang-sdk#7