Skip to content

Commit 739769b

Browse files
Improve the documentation
1 parent 0bbf67b commit 739769b

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

crates/oxc_linter/src/rules/typescript/explicit_function_return_type.rs

+7-4
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,16 @@ impl std::ops::Deref for ExplicitFunctionReturnType {
4747
declare_oxc_lint!(
4848
/// ### What it does
4949
///
50-
/// This rule enforces that functions do have an explicit return type annotation.
50+
/// This rule enforces that functions have an explicit return type annotation.
5151
///
5252
/// ### Why is this bad?
5353
///
54-
/// Explicit return types do make it visually more clear what type is
55-
/// returned by a function. They can also speed up TypeScript type checking
56-
/// performance in large codebases with many large functions.
54+
/// Explicit return types make it clearer what type is returned by a function. Making the
55+
/// type returned by a function obvious allows the reader to infer what the function does
56+
/// and how it can be used from a quick glance.
57+
///
58+
/// Another benefit of explicit return types is the potential for a speed up of type
59+
/// checking in large codebases with many large functions.
5760
///
5861
/// ### Example
5962
///

0 commit comments

Comments
 (0)