-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix no ignored replay buffer edge cases (#82)
* Handle edge cases * Add some more test cases to default * Create test cases for different import alias * add tsconfig file * Add tslint file
- Loading branch information
Showing
5 changed files
with
107 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
test/v6/fixtures/no-ignored-replay-buffer/diff-import-alias/fixture.ts.lint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import * as Rx from "rxjs"; | ||
import { publishReplay, shareReplay } from "rxjs/operators"; | ||
|
||
const a = new Rx.ReplaySubject<string>(1); | ||
const b = new Rx.ReplaySubject<string>(); | ||
~~~~~~~~~~~~~ [no-ignored-replay-buffer] | ||
|
||
const c = Rx.of(42).pipe(publishReplay(1)); | ||
const d = Rx.of(42).pipe(publishReplay()); | ||
~~~~~~~~~~~~~ [no-ignored-replay-buffer] | ||
|
||
const e = Rx.of(42).pipe(shareReplay(1)); | ||
const f = Rx.of(42).pipe(shareReplay()); | ||
~~~~~~~~~~~ [no-ignored-replay-buffer] | ||
|
||
|
||
const g = new Thing(new Rx.ReplaySubject<number>(1)); | ||
const g = new Thing(new Rx.ReplaySubject<number>()); | ||
~~~~~~~~~~~~~ [no-ignored-replay-buffer] | ||
class Mock { | ||
private valid: Rx.ReplaySubject<number>; | ||
private invalid: Rx.ReplaySubject<number> | ||
|
||
constructor(){ | ||
this.valid = new Rx.ReplaySubject<number>(1); | ||
this.invalid = new Rx.ReplaySubject<number>(); | ||
~~~~~~~~~~~~~ [no-ignored-replay-buffer] | ||
} | ||
} | ||
[no-ignored-replay-buffer]: Ignoring the buffer size is forbidden |
13 changes: 13 additions & 0 deletions
13
test/v6/fixtures/no-ignored-replay-buffer/diff-import-alias/tsconfig.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"compilerOptions": { | ||
"baseUrl": ".", | ||
"lib": ["es2015"], | ||
"noEmit": true, | ||
"paths": { | ||
"rxjs": ["../../node_modules/rxjs"] | ||
}, | ||
"skipLibCheck": true, | ||
"target": "es5" | ||
}, | ||
"include": ["fixture.ts"] | ||
} |
8 changes: 8 additions & 0 deletions
8
test/v6/fixtures/no-ignored-replay-buffer/diff-import-alias/tslint.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"defaultSeverity": "error", | ||
"jsRules": {}, | ||
"rules": { | ||
"rxjs-no-ignored-replay-buffer": { "severity": "error" } | ||
}, | ||
"rulesDirectory": "../../../../../build/rules" | ||
} |