Skip to content

Conversation

JasonWeinzierl
Copy link
Owner

@JasonWeinzierl JasonWeinzierl commented Nov 27, 2024

New rule based on @typescript-eslint/no-misused-promises. Ensures you don't return an Observable where void is expected, or try to spread an Observable. This rule is added to the strict configuration.

Resolves #43 .

Note: checksVoidReturn is noticeably slow, specifically stemming from the arguments, properties, and variables sub-options. It's still faster than @typescript-eslint/no-deprecated and some import-x rules, but it's in the top 10 with TIMING=1 enabled. But since the implementation is similar to @typescript-eslint/no-misused-promises which has similar performance, we'll allow it.

Copy link

github-actions bot commented Dec 2, 2024

LCOV of commit a8063fc during .github/workflows/ci.yml #174

Summary coverage rate:
  lines......: 96.6% (4190 of 4336 lines)
  functions..: 96.0% (267 of 278 functions)
  branches...: 91.0% (918 of 1009 branches)

Files changed coverage rate:
                                         |Lines       |Functions  |Branches    
  Filename                               |Rate     Num|Rate    Num|Rate     Num
  =============================================================================
  src/configs/strict.ts                  | 100%     40| 100%     1| 100%      1
  src/etc/get-type-services.ts           | 100%     70| 100%    10|96.0%     25
  src/etc/is.ts                          |74.6%    118|69.7%    33| 100%     23
  src/index.ts                           | 100%    105|    -     0|    -      0
  src/rules/no-misused-observables.ts    |99.1%    427| 100%    18|89.8%    177

@JasonWeinzierl JasonWeinzierl marked this pull request as ready for review December 3, 2024 14:39
@JasonWeinzierl JasonWeinzierl merged commit 41c7be8 into main Dec 3, 2024
2 checks passed
@JasonWeinzierl JasonWeinzierl deleted the no-misused-observables branch December 3, 2024 16:06
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.

Add rule no-misused-observables
1 participant