Skip to content

feat(macro): Add arg macro tests, docs and typings #2292

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

DeyLak
Copy link

@DeyLak DeyLak commented Jul 22, 2025

Description

This PR resolves part of the discussed changes in #2279. It adds tests, docs and typings for the arg macro that was already available in the babel plugin.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Examples update

Fixes #2279

Checklist

  • I have read the CONTRIBUTING and CODE_OF_CONDUCT docs
  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary documentation (if appropriate)

Copy link

vercel bot commented Jul 22, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
js-lingui ✅ Ready (Inspect) Visit Preview Aug 4, 2025 8:55am

Copy link

codecov bot commented Jul 22, 2025

Codecov Report

❌ Patch coverage is 80.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.01%. Comparing base (6bb8983) to head (e9f03e1).
⚠️ Report is 211 commits behind head on main.

Files with missing lines Patch % Lines
...ckages/babel-plugin-lingui-macro/src/macroJsAst.ts 80.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2292      +/-   ##
==========================================
- Coverage   77.05%   77.01%   -0.04%     
==========================================
  Files          84       89       +5     
  Lines        2157     2506     +349     
  Branches      555      651      +96     
==========================================
+ Hits         1662     1930     +268     
- Misses        382      461      +79     
- Partials      113      115       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@timofei-iatsenko
Copy link
Collaborator

Regardless of the original conversation we had, i feel that this PR is still quite a valuable contribution for the library, so would like to move this forward.

The PR itself LGTM

@timofei-iatsenko timofei-iatsenko marked this pull request as draft August 4, 2025 08:02
@timofei-iatsenko
Copy link
Collaborator

I'd like to do some changes first, than will mark as ready

@timofei-iatsenko timofei-iatsenko marked this pull request as ready for review August 4, 2025 08:53
@timofei-iatsenko
Copy link
Collaborator

timofei-iatsenko commented Aug 4, 2025

I added support for named placeholders to the arg macro, to be consistent with other places and added type tests for that.

@timofei-iatsenko
Copy link
Collaborator

@andrii-bodnar anything else to be done to merge it?

@andrii-bodnar
Copy link
Contributor

@timofei-iatsenko I was waiting here for lingui/swc-plugin#161, to release them synchronously

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.

Custom formatters for numbers, dates etc.
3 participants