-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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(rest): remove const enum
s in favour of regular enums
#9243
Conversation
The motivation is that `const enum` produces ambient const enums when compiling which in turn causes issues with TypeScript 5.x when `verbatimModuleSyntax` is enabled. Furthermore, the generally accepted best practice is to avoid `const enum`s when writing libraries. Can back this up with statements from TS maintainers if needed, I know they made them, I just can't be bothered to find the GitHub links lmao. @vladfrangu will probably be able to find those links much easier than me as it was also the motivation to remove `const enum`'s from discord-api-types
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov Report
@@ Coverage Diff @@
## main #9243 +/- ##
==========================================
+ Coverage 83.57% 83.70% +0.12%
==========================================
Files 100 100
Lines 9567 9550 -17
Branches 1101 1101
==========================================
- Hits 7996 7994 -2
+ Misses 1532 1517 -15
Partials 39 39
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
🎉
Please describe the changes this PR makes and why it should be merged:
The motivation is that
const enum
produces ambient const enums when compiling which in turn causes issues with TypeScript 5.x whenverbatimModuleSyntax
is enabled.Furthermore, the generally accepted best practice is to avoid
const enum
s when writing libraries. Can back this up with statements from TS maintainers if needed, I know they made them, I just can't be bothered to find the GitHub links lmao. @vladfrangu will probably be able to find those links much easier than me as it was also the motivation to removeconst enum
's from discord-api-types.Status and versioning classification: