Replace JSON.parse with parseJsonWithSchema
Replace JSON.parse with Misc.parseJsonWithSchema for type safety.
Example: https://github.com/monkeytypegame/monkeytype/blob/2a0a5b408cc38a678328c2ff44e281416ebb9c4d/frontend/src/ts/utils/url-handler.ts#L68-L92
I think before we do this we should extract common util functions (like this one) to a package.
It should be go on the discussion.
Hi @fehmer, Could you assign me that issue.
@dev-mohit06 I'd say just work on it and create a PR
Hey @fehmer, I’d prefer to avoid duplication of effort, so could you assign this issue to me if possible?
@fehmer - Could you please indicate which files in the frontend need JSON.parse replacements? This will help ensure I cover all necessary changes.
https://github.com/search?q=repo%3Amonkeytypegame%2Fmonkeytype+JSON.parse+language%3ATypeScript+path%3A%2F%5Efrontend%5C%2Fsrc%5C%2Fts%5C%2F%2F&type=code
@fehmer thanks for helping me out
Isn't this done in #6207?
@Miodec I will be happy to do that. I will start now onwards.
Isn't this done in #6207?
Backend is not using
parseJsonWithSchemayet
been a while, should I give it a try?
@byseif21 broo I already finished 😅
@byseif21 broo I already finished 😅
Oh shit, my bad! 😅 I thought you kinda had enough after the Frontend and won’t tackle this. I even checked the repos before going for it and noticed you hadn’t been active for a bit, so I assumed you were sitting this one out. Sorry for the overlap! I’ve got PR #6481 up with the changes. Can you take a look and let me know your thoughts? sorry again I really thought you won't do it :(
@byseif21 no problem