Skip to content

Create eslint rule to enforce function return type #3777

@milanholemans

Description

@milanholemans

Right now it is perfectly fine to write a function like this:

private doSomething() {
   // do some stuff
   //  ...
   return result;
}

Best practice is to always define a return type for your function. We could enforce this with an eslint rule. The rule we are looking for is @typescript-eslint/explicit-function-return-type.

We should enable the eslint rule and fix all the functions that violate this rule.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions