[explicit-function-return-type] allowTypedFunctionExpressions should support return values and default parameters #682
Labels
accepting prs
Go ahead, send a pull request that resolves this issue
enhancement
New feature or request
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
Repro
Expected Result
No errors;
outer
must be a() => string
due to the return type of the containing functionfunc
must be() => string
because the parameter is typed as thatfoobar
inmakeX
can be inferred from the return typeActual Result
Additional Info
After reporting #679 I started looking for other situations where
allowTypedFunctionExpressions
feels like it should apply but currently has no effect. I don't have specific use-cases in mind for each, but some examples:func(param: () => string = (): string => 'hello')
(worse if it takes parameters)For the monad case, there may even be an argument for inferring the parent type from a child type, but I think that is a separate issue (and likely a separate option).
Versions
@typescript-eslint/eslint-plugin
1.11.0
@typescript-eslint/parser
1.11.0
TypeScript
3.5.2
ESLint
5.16.0
node
12.4.0
npm
6.9.0
The text was updated successfully, but these errors were encountered: