Skip to content

fix: keep the key when t from useLingui is used as a shorthand property - #281

Merged
andrii-bodnar merged 1 commit into
mainfrom
fix/use-lingui-shorthand-prop
Oct 8, 2026
Merged

andrii-bodnar merged 1 commit into
mainfrom
fix/use-lingui-shorthand-prop

Conversation

@andrii-bodnar

Copy link
Copy Markdown
Contributor

IdentReplacer only overrode fold_ident, so in { t } the single identifier that serves as both key and value was renamed to $__, producing { $__ }. Expand the shorthand to { t: $__ } instead, matching the Babel macro.

Fixes #278

…operty

IdentReplacer only overrode fold_ident, so in `{ t }` the single identifier
that serves as both key and value was renamed to `$__`, producing `{ $__ }`.
Expand the shorthand to `{ t: $__ }` instead, matching the Babel macro.

Fixes #278

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.90909% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 94.42%. Comparing base (32bb27a) to head (a10b7f1).

Files with missing lines Patch % Lines
crates/lingui_macro/src/lib.rs 90.90% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #281      +/-   ##
==========================================
- Coverage   94.44%   94.42%   -0.02%     
==========================================
  Files          11       11              
  Lines        2518     2529      +11     
==========================================
+ Hits         2378     2388      +10     
- Misses        140      141       +1     
Flag Coverage Δ
unittests 94.42% <90.90%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
crates/lingui_macro/src/lib.rs 91.45% <90.90%> (-0.02%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@andrii-bodnar
andrii-bodnar merged commit 107fce3 into main Oct 8, 2026
28 checks passed
@andrii-bodnar
andrii-bodnar deleted the fix/use-lingui-shorthand-prop branch October 8, 2026 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

useLingui transform renames t inside shorthand object properties ({ t } → { $__ })

1 participant