mirror of
https://github.com/zulip/zulip.git
synced 2025-11-12 09:58:06 +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
@@ -8,7 +8,7 @@ exports.do_unread_count_updates = function do_unread_count_updates(messages) {
|
||||
|
||||
function add_messages(messages, msg_list, opts) {
|
||||
if (!messages) {
|
||||
return;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
loading.destroy_indicator($("#page_loading_indicator"));
|
||||
@@ -50,7 +50,7 @@ exports.add_new_messages = function (messages, msg_list) {
|
||||
// narrow. Otherwise the new message would be rendered just after
|
||||
// the previously fetched messages when that's inaccurate.
|
||||
msg_list.data.fetch_status.update_expected_max_message_id(messages);
|
||||
return;
|
||||
return undefined;
|
||||
}
|
||||
return add_messages(messages, msg_list, {messages_are_new: true});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user