cartant / eslint-plugin-rxjs

ESLint rules for RxJS
MIT License
312 stars 37 forks source link

`no-ignored-replay-buffer` doesn't check `bufferSize` if object config passed to `shareReplay` #100

Open sashaqred opened 2 years ago

sashaqred commented 2 years ago

In my project I'm using plugin:rxjs/recommended which comes with two rules: rxjs/no-sharereplay and rxjs/no-ignored-replay-buffer.

The following code is good with rxjs/no-ignored-replay-buffer rule and throws error with rxjs/no-sharereplay rule:

interval(1000).pipe(shareReplay(1));

And this won't throw any linter error:

interval(1000).pipe(shareReplay({refCount: true}));

But bufferSize here is missing. And it looks like here should be error from rxjs/no-ignored-replay-buffer rule. I've checked sources and it looks like the rule check only arguments length but doesn't check the arguments content.

Also, I can help with pull request, if you don't mind.