-
Notifications
You must be signed in to change notification settings - Fork 382
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
fix: compile should generate a TS file #1851
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
size-limit report 📦
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1851 +/- ##
==========================================
+ Coverage 76.39% 76.66% +0.26%
==========================================
Files 81 81
Lines 2072 2083 +11
Branches 529 532 +3
==========================================
+ Hits 1583 1597 +14
+ Misses 377 375 -2
+ Partials 112 111 -1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vonovak thank you!
Description
Currently, running
lingui compile --typescript
produces a.ts
(which contains javascript code) file along with.d.ts
file with typings.However, TypeScript, at least on my machine, ignores the typings file - which kinda makes sense given that the source file already has
.ts
extension.So it looks like this:
AFAICT, we should not mix
.ts
with.d.ts
. What this PR does is that it removes the generation of thed.ts
file and instead puts the types into the generated.ts
file. I believe this should not have any unintended side effects. If it does, we should keep the.d.ts
file but change the.ts
file extension.Additionally, I made some docs changes to "promote" the
--typescript
flag more. I think most users are not aware of it, yet it's nice to have.Types of changes
Fixes # (issue)
Checklist