freeCodeCamp / Developer_Quiz_Site

This is a quiz site filled with over 1500+ questions on programming.
https://developerquiz.org
BSD 3-Clause "New" or "Revised" License
268 stars 359 forks source link

[imporvement] - extract all typscript interfaces into common `types` file #1216

Open shootermv opened 3 weeks ago

shootermv commented 3 weeks ago

What bug did you find in the codebase?

as far as i can see - there are type definition are located at components files i think it is better to have all the defiinition at one common file in that way types can be found easily and also - can be reused

jdwilkin4 commented 2 weeks ago

i think it is better to have all the defiinition at one common file in that way types can be found easily and also - can be reused

I think this depends on if that particular type is only used on one file or not. If that type is only used once, then I don't see a need to move it to the types file and export it. But if that type is already being resused in multiple files, then yes it does make sense to have it in one file and export it in the files where it is needed