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.
Right now it is perfectly fine to write a function like this:
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.