mirror of
https://github.com/zulip/zulip.git
synced 2025-11-15 11:22:04 +00:00
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:
committed by
Tim Abbott
parent
fe66aef0ad
commit
d72423ef21
@@ -80,7 +80,7 @@ exports.snapshot_message = function () {
|
||||
if (!compose_state.composing() || compose_state.message_content().length <= 2) {
|
||||
// If you aren't in the middle of composing the body of a
|
||||
// message or the message is shorter than 2 characters long, don't try to snapshot.
|
||||
return;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// Save what we can.
|
||||
@@ -286,7 +286,7 @@ exports.format_draft = function (draft) {
|
||||
},
|
||||
error.stack,
|
||||
);
|
||||
return;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return formatted;
|
||||
|
||||
Reference in New Issue
Block a user