reposense / RepoSense

Contribution analysis tool for Git repositories
https://reposense.org
MIT License
251 stars 154 forks source link

Update lint rules to enforce explicit return type annotations #2156

Open vvidday opened 8 months ago

vvidday commented 8 months ago

What feature(s) would you like to see in RepoSense

With https://github.com/reposense/RepoSense/issues/2002 being worked on, it would be beneficial to add lint rule(s) to enforce typescript functions to have explicit return type annotations. This will ensure that future additions comply with the existing coding standard, and enforce uniformity across the codebase.

Is the feature request related to a problem?

If this is not added, future functions might omit explicit return types, which would result in inconsistency across the frontend codebase.

If possible, describe the solution

Add lint rule(s) to enforce explicit return types for functions. Example: https://typescript-eslint.io/rules/explicit-function-return-type/ We should make sure that the linter works for both raw .ts files and for TypeScript code inside .vue files. This rule should of course be added after the rule has been enforced across the existing code base (i.e. after #2002 is finished & closed).

Additionally, since this will be enforced as a rule, please also update the style guide in the DG to specify this rule.

If applicable, describe alternatives you've considered

Additional context

logical-1985516 commented 4 months ago

Hi @vvidday, may I try this issue? I know that issue #2002 is still open (for .ts files), but may I work on this issue and create a PR with a s.DoNotMerge label?