Skip to content

Conversation

JasonWeinzierl
Copy link
Owner

Allow returning Observables from union types of properties like:

interface Hook {
  onInit?: ((field: string) => void) | ((field: string) => Observable<any>);
}

const hook: Hook = {
  onInit: field => of(field),
};

This corner case was skipped when the initial rule was created based on tseslint's no-misused-promises.

Resolves #193

Copy link

github-actions bot commented Jun 24, 2025

LCOV of commit 734c01c during .github/workflows/ci.yml #616

Summary coverage rate:
  lines......: 96.7% (4495 of 4649 lines)
  functions..: 96.2% (276 of 287 functions)
  branches...: no data found

Files changed coverage rate:
                                                                    |Lines       |Functions  |Branches    
  Filename                                                          |Rate     Num|Rate    Num|Rate     Num
  ========================================================================================================
  src/rules/no-misused-observables.ts                               | 4.0%    454| 0.0%    18|    -      0

@JasonWeinzierl JasonWeinzierl merged commit 93c6dab into main Jul 7, 2025
3 checks passed
@JasonWeinzierl JasonWeinzierl deleted the fix-union-return branch July 7, 2025 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue after upgrading to 0.7.2 from 0.7.0
1 participant