Skip to content

Commit d4a2a0c

Browse files
crisbetojelbourn
authored andcommitted
build: disallow usages of the first operator (#17836)
The `first` operator will throw if the observable completes before it has emitted. A long time ago we went through and updated all the usages to `take(1)`, but recently a couple of new usages were introduced so we might as well lint for it so it doesn't happen again.
1 parent 2ecb0d5 commit d4a2a0c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tslint.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
["fdescribe"],
8787
["xit"],
8888
["xdescribe"],
89+
{"name": ["first"], "message": "Use take(1) instead."},
8990
{"name": ["Object", "assign"], "message": "Use the spread operator instead."}
9091
],
9192
// Avoids inconsistent linebreak styles in source files. Forces developers to use LF linebreaks.

0 commit comments

Comments
 (0)