feat(cli): add --output-prefix option to customize compiled file headers#2377
feat(cli): add --output-prefix option to customize compiled file headers#2377andrii-bodnar merged 9 commits intolingui:mainfrom
Conversation
|
@Gamote is attempting to deploy a commit to the Crowdin Team on Vercel. A member of the Team first needs to authorize it. |
… and consistency
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
andrii-bodnar
left a comment
There was a problem hiding this comment.
Thank you for the contribution, @Gamote! It looks useful!
Could you also please update the documentation? It would be great to include value examples for popular linters like Oxlint in your case or Biome.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2377 +/- ##
==========================================
- Coverage 77.05% 76.35% -0.70%
==========================================
Files 84 100 +16
Lines 2157 2660 +503
Branches 555 695 +140
==========================================
+ Hits 1662 2031 +369
- Misses 382 505 +123
- Partials 113 124 +11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@andrii-bodnar Sure thing, good call. I just pushed clear documentation and working examples. |
|
IMO, looks a bit overcoupled to the usage. Would it be better to just have "prefix / suffix" ? Than it is not coupled and user could do whatever and don't break the semantics. |
If think about a more generic solution, do some other use-case is possible except lint directive? Is there any use-case for having a suffix there as well? |
|
Ignoring by prettier, which is semantically not a linter. Instanbul coverage ignoring and so on. Not sure about "suffix", but something like |
I can see how that can be useful, also the suffix could be of help if there are tools that need to mark the start and end. How about If this is something you want I can updated the code, tests and docs. |
|
For now, I would suggest adding only the prefix. We can introduce a suffix later if necessary. |
|
@andrii-bodnar I have pushed the refactoring, updated the docs, the tests and the PR title and description. Can you please review the changes? |
|
@andrii-bodnar @Gamote LGTM |
andrii-bodnar
left a comment
There was a problem hiding this comment.
Looks also good to me, @Gamote thank you!
Description
This PR adds support for customizing the output prefix (header) in compiled message catalogs through a new
--output-prefixCLI option.Currently, Lingui hardcodes
/*eslint-disable*/at the top of compiled files. This change allows projects to specify custom prefixes for generated files, making it easier to integrate with different tools like linters, coverage tools, or formatters that rely on header directives.Usage:
Changes:
outputPrefixoption toCreateCompileCatalogOptionstypecreateCompiledCatalogfunction to accept and use the custom prefix with default value'/*eslint-disable*/'--output-prefix <prefix>Types of changes
Checklist