Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is there a way to ban .asObservable() method #116

Open
goldenratio opened this issue Jun 20, 2023 · 1 comment
Open

is there a way to ban .asObservable() method #116

goldenratio opened this issue Jun 20, 2023 · 1 comment

Comments

@goldenratio
Copy link

Hey,
wondering, is there a way to ban .asObservable() method? Thanks.

// wrong
get click$(): Observable<void> {
  return this._clickSubject$.asObservable();
}

// correct
get click$(): Observable<void> {
  return this._clickSubject$;
}
@mhombach
Copy link

I think, as long as there is not a fixed rule, you could use the restricted-syntax rule to define that rule yourself in your lint config.
But could you explain in which cases asObservable() might be a problem?

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

No branches or pull requests

2 participants