flag less overly general functions with js/unneeded-defensive-code

This commit is contained in:
Erik Krogh Kristensen
2021-01-20 15:48:12 +01:00
parent 2f459d9a72
commit bf518f1c90
2 changed files with 10 additions and 0 deletions

View File

@@ -176,4 +176,11 @@
u && (u.p, f()); // technically not OK, but it seems like an unlikely pattern
u && !u.p; // NOT OK
u && !u(); // NOT OK
function hasCallbacks(success, error) {
if (success) success()
if (error) error()
}
hasCallbacks(() => {}, null);
});