eslint: Replace empty-returns with consistent-return.

Instead of prohibiting ‘return undefined’ (#8669), we require that a
function must return an explicit value always or never.  This prevents
you from forgetting to return a value in some cases.  It will also be
important for TypeScript, which distinguishes between undefined and
void.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2020-09-23 22:50:36 -07:00
committed by Tim Abbott
parent fe66aef0ad
commit d72423ef21
103 changed files with 331 additions and 247 deletions

View File

@@ -24,7 +24,7 @@ exports.autofocus = function (selector) {
exports.password_quality = function (password, bar, password_field) {
// We load zxcvbn.js asynchronously, so the variable might not be set.
if (typeof zxcvbn === "undefined") {
return;
return undefined;
}
const min_length = password_field.data("minLength");
@@ -55,7 +55,7 @@ exports.password_quality = function (password, bar, password_field) {
exports.password_warning = function (password, password_field) {
if (typeof zxcvbn === "undefined") {
return;
return undefined;
}
const min_length = password_field.data("minLength");