Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[@angular-eslint/no-implicit-take-until-destroyed] false positive #3074

Copy link
Copy link

Description

@splincode
Issue body actions

I have

https://github.com/taiga-family/taiga-ui/blob/main/projects/demo/src/pages/app/utils/viewport-scroller.service.ts

 constructor() {
        inject(TUI_DOC_PAGE_LOADED)
            .pipe(
                filter(Boolean),
                switchMap(() => this.scroll$),
                takeUntilDestroyed(),
            )
            .subscribe((element) => element.scrollIntoView());
    }

But

projects/demo/src/pages/app/utils/viewport-scroller.service.ts
  20:17  error  `takeUntilDestroyed()` must be called with an explicit `DestroyRef` parameter when used outside of an injection context. See more at https://angular.dev/guide/di/dependency-injection-context and https://angular.dev/ecosystem/rxjs-interop/take-until-destroyed  @angular-eslint/no-implicit-take-until-destroyed

✖ 1 problem (1 error, 0 warnings)

This is normal behavior for Angular, and you don't need to use destroyRef.

Versions

package version
@angular-eslint/eslint-plugin 21.4.0
@typescript-eslint/parser 8.60.0
ESLint 9.39.4
node 26.2.0
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    package: eslint-pluginAngular-specific TypeScript rulesAngular-specific TypeScript rulestriageThis issue needs to be looked at and categorized by a maintainerThis issue needs to be looked at and categorized by a maintainer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.