Skip to content

Conversation

@JasonWeinzierl
Copy link
Owner

@JasonWeinzierl JasonWeinzierl commented Jun 25, 2025

New rule to catch putting shareReplay before takeUntil with refCount: false.

  • This rule is added to the strict config.
  • This is using the same algorithm as no-unsafe-takeuntil to determine if takeUntil itself is in a valid position; this rule will not trigger if takeUntil is invalid.
  • This rule also cannot handle complex scenarios like composing multiple observables or refCount set to a variable with unknown boolean value.

Resolves #108

@github-actions
Copy link

github-actions bot commented Jun 25, 2025

LCOV of commit 40bda7b during .github/workflows/ci.yml #703

Summary coverage rate:
  lines......: 96.7% (4575 of 4729 lines)
  functions..: 96.2% (280 of 291 functions)
  branches...: no data found

Files changed coverage rate:
                                                                    |Lines       |Functions  |Branches    
  Filename                                                          |Rate     Num|Rate    Num|Rate     Num
  ========================================================================================================
  src/configs/strict.ts                                             | 2.4%     42| 0.0%     1|    -      0
  src/index.ts                                                      | 0.0%    109|    -     0|    -      0
  src/rules/no-sharereplay-before-takeuntil.ts                      | 5.3%     76| 0.0%     4|    -      0

@JasonWeinzierl JasonWeinzierl marked this pull request as ready for review October 30, 2025 16:24
@JasonWeinzierl JasonWeinzierl force-pushed the issue-108 branch 2 times, most recently from 41ef0fa to bea1603 Compare November 2, 2025 17:25
@JasonWeinzierl JasonWeinzierl merged commit dafc378 into main Nov 3, 2025
4 checks passed
@JasonWeinzierl JasonWeinzierl deleted the issue-108 branch November 3, 2025 16:12
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.

Rule to prevent shareReplay({ refCount: false }) before takeUntil

2 participants