HackIllinois / adonix

HackIllinois' backend API
MIT License
1 stars 17 forks source link

Allow for type inferencing #36

Open Nydauron opened 1 year ago

Nydauron commented 1 year ago

Typescript has a decent ability to infer types correctly. In some cases, you need to coax it, but that goes for any strongly typed language.

While it is good to be explicit in your typing, I believe that if the linter can infer the type without any help, type annotations should not be added (an argument can also be made for allowing TS to infer return types as well, but I am like half-and-half on this idea). The TS LSP has support for showing inferred types within the editor (with the help of inlay hints or inline virtual text), so requiring type annotations to be present only makes it an extra thing to worry about when developing features.

Timothy-Gonzalez commented 1 year ago

See also #79