forked from cartant/eslint-plugin-rxjs
-
Notifications
You must be signed in to change notification settings - Fork 3
Closed
Labels
bugSomething isn't workingSomething isn't working
Milestone
Description
This will get flagged by the finnish
rule:
function getNumber(): Observable<number> {
return of(42);
}
but this will not get flagged:
function getNumber() {
return of(42);
}
This is likely due to couldReturnType
not being able to handle implicit return types.
tsTypeNode = tsNode.type ?? tsNode.body;
If type
is null (no explicit return type) and body
is a Block instead of something like a CallExpression, then the type checker will not be able to determine the type of tsTypeNode
and so couldReturnType
will always return false. This is currently impacts the finnish
, no-finnish
, and no-misused-observables
rules.
Implicit return types don't have test coverage in the finnish
test suite, so this bug was never discovered (or ignored?).
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working