From 35aeb2f71db5e28746acae5f71e2e31aff7b73f4 Mon Sep 17 00:00:00 2001 From: crisbeto Date: Thu, 28 Nov 2019 15:45:53 +0100 Subject: [PATCH] build: disallow usages of the first operator 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. --- tslint.json | 1 + 1 file changed, 1 insertion(+) diff --git a/tslint.json b/tslint.json index 87f16b9a5d6d..7ea3eceb0516 100644 --- a/tslint.json +++ b/tslint.json @@ -86,6 +86,7 @@ ["fdescribe"], ["xit"], ["xdescribe"], + {"name": ["first"], "message": "Use take(1) instead."}, {"name": ["Object", "assign"], "message": "Use the spread operator instead."} ], // Avoids inconsistent linebreak styles in source files. Forces developers to use LF linebreaks.