Skip to content

difference typescript/explicit-function-return-type vs typescript/explicit-module-boundary-types #12602

Answered by KieranP
mesqueeb asked this question in Q&A
Discussion options

You must be logged in to vote

My understanding is that typescript/explicit-function-return-type checks all functions (declarations, expressions, and arrow), whereas typescript/explicit-module-boundary-types only deals with exports from a module.

typescript/explicit-module-boundary-types can be used to make TypeScript faster. If all module exports have explicit return types, TypeScript doesn't need to keep crawling up the module tree to infer it; with explicit typing it can instantly return it when you reference it. It applies to functions, variables, classes; anything exported from a module. With this check enabled, they must have an explicit return type.

On the other hand, typescript/explicit-function-return-type onl…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by camc314
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants