-
Notifications
You must be signed in to change notification settings - Fork 0
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
Redo PR #435 #5
base: main
Are you sure you want to change the base?
Redo PR #435 #5
Conversation
20f0f9f
to
fe7cabf
Compare
What does this fix exactly? Please explain it in the commit msg body.
What does this fix exactly? Please explain it in the commit msg body.
Occur? I guess you meant to use the past tense, because your commit fixes the errors, right?
What in the world is “outdi”???
You’re missing the the why (what does this fix exactly?)
This commit message is much better than the others, but still not perfect. What was the consequence of choosing the wrong type?
What does “throw nonsense” means?? |
Since we also have JS files in our project, if we want to use export defaults we have to use default property: ``` var bar = require('./input').default; ``` I preferred named export over export default since it required a lot of changes to the JS files.
efb8572
to
a753b89
Compare
Why are you repeating in the commit msg what can already be seen in the commit's diff? |
This commit msg seems to be suggesting that ts-check is a good thing; however, your commit is removing it! SO EXPLAIN WHY! |
What do you mean with "git pollution"? I don't get it. Explain it in commit message body. |
You're also enableding allowJs and skipLibCheck, but are not mentioning them and not explaining why. |
Why??? |
Define what "it's not working" means. We are software engineers, not users. |
I have so many issues with the above:
|
e8436f2
to
5423b77
Compare
What do you mean??? JavaScript code doesn't have types so it obviously lacks types. |
So what's the reason of mixing these 3 changes in one single commit? |
The community null check thing is being explained in 2 different commits, shouldn't it be in the same commit? I mean, a commit that deals exclusively with the community null check. |
I can't parse this sentence above. I think it's missing some word. |
You're still not explaining what "not working" means. |
What's the problem here? I see that you guys agree. JS allows for implicit/non-existent types so ts-check fails on it. what's the big deal? |
After porting logger.js to typescript, the logger type became a "named export", this changes the syntax for importing it. Additionally, there are a few mistakes in imports that we weren't noticed of.
5423b77
to
e59d0eb
Compare
Why was CI before this commit green then? |
331ead4
to
8af19ce
Compare
8af19ce
to
4c51cef
Compare
Typescript compilers in newer versions complain about when calling functions with named parameters, there is no argument interface for the deleteMessage method in Telegraf framework so I changed it, and there's a telegram argument with the wrong type. ``` util/index.ts:283:20 - error TS2554: Expected 2 arguments, but got 1. 283 await telegram.deleteMessage({chat_id: channel!, message_id: Number(order.tg_channel_message1!)}); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ node_modules/telegraf/typings/telegram.d.ts:317:44 317 deleteMessage(chatId: number | string, messageId: number): Promise<true>; ~~~~~~~~~~~~~~~~~ An argument for 'messageId' was not provided. Found 1 error in util/index.ts:283 ```
While both import and require can be used to import modules in TypeScript, it is recommended to use import because it is part of the ES6 module system and provides better performance.
As community may sometimes be null, I edited the isDisputeSolver function to accept null, so we don't have to do a null check over it. ``` bot/validations.ts:97:38 - error TS2345: Argument of type '(ICommunity & { _id: ObjectId; }) | null' is not assignable to parameter of type 'ICommunity'. Type 'null' is not assignable to type 'ICommunity'. 97 const isSolver = isDisputeSolver(community, user); ~~~~~~~~~ Found 1 error in bot/validations.ts:97 ```
ff72fca
to
476a801
Compare
No description provided.