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
ts: Convert emoji.js
to TypeScript.
#24875
Conversation
diff --git a/.eslintrc.json b/.eslintrc.json
index c3cabcdac5..b126a19af3 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -140,6 +140,8 @@
{
"files": ["web/src/**"],
"globals": {
+ "Iterator": true,
+ "IterableIterator": true,
"StripeCheckout": false
}
}, Adding |
dd7464f
to
ee60e70
Compare
Yep that fixed it thanks @PIG208 ! |
This seems to be Ideally, we don’t want to have to manually list all the ES2022 globals we use. Until that fix is merged, try using |
@andersk That worked too so changed "ES2022" -> "ESNext". |
58c96b1
to
c6c7759
Compare
Removed unnecessary map |
Thanks for the work on this @Lalit3716! I posted a bunch of comments, mostly on naming -- I think my main advice is to spend more time thinking about what to call types, and if you're not sure, consider posting in #frontend to get feedback -- names are really important to the readability of code, and a big part of the benefit of moving to TypeScript is having named types for things, so it's definitely well worth our time to try to name things well. Usually there's pretty good hints in the names of the functions etc. that use a given type. |
Thanks for the review! Also I will make sure to take my time with naming things in my future work!, will update the PR soon 🙂. |
This is a prep commit for typescript migration of `emoji.js`. This commit refactors the code for generating emoji rendering details such that we avoid writing an ugly code which will involve writing an incomplete type object when we migrate to TypeScript.
Converted `emoji.js` to TypeScript by adding relevant type definitions, also modified `target` option in our tsconfig to 'ESNext' so that types for object methods like `hasOwn` which is being used in `emoji.js` are included.
@timabbott This is ready to review. I have addressed all the review comments and made a prep commit for the suggested refactoring. |
This is great, merged, thanks @Lalit3716! |
Converted
emoji.js
to TypeScript by adding relevant type definitions, also modifiedtarget
option in our tsconfig to 'ES2022' so that types for object methods likehasOwn
which is being used inemoji.js
are included.Self-review checklist
(variable names, code reuse, readability, etc.).
Communicate decisions, questions, and potential concerns.
Individual commits are ready for review (see commit discipline).
Completed manual review and testing of the following: