no-ambiguous-success-type
Disallows non-specific types in the success position of Result, ResultAsync, and ResultMaybeAsync.
Rule Details
When the success type of a Result is vague, callers don't know what they receive on success and have to check or cast the value themselves.
Use a concrete type instead.
The following types are reported in the success position: unknown, any, object, and {}.
void is allowed for operations that don't return a value.
The rule checks explicit type annotations such as Result.Result<T, E>. Types inferred by TypeScript are not checked.
Incorrect
Correct
Tip
When a value really is unknown, such as a parsed JSON body, validate it with Result.parse to obtain a concrete type.
Options
This rule has no options.
