cartant / eslint-plugin-rxjs-angular

ESLint rules for RxJS and Angular
MIT License
98 stars 11 forks source link

Support es2022 private properties in prefer-takeuntil #11

Open Michsior14 opened 2 years ago

Michsior14 commented 2 years ago

Current behavior

The following code throws error ("Forbids calling subscribe without an accompanying takeUntil") in the current version:

@Component()
class Test {
  #destroyer = new Subject();

  public ngOnInit(): void {
    someStream.pipe(takeUntil(this.#destroyer)).subscribe();
  }
}

Expected behavior

The # prefixed variables can be used within takeUntil when prefer-takeuntil rule is enabled.