mirror of
https://github.com/zulip/zulip.git
synced 2025-10-30 03:23:50 +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
@@ -567,7 +567,7 @@ exports.granted_desktop_notifications_permission = function () {
|
||||
|
||||
exports.request_desktop_notifications_permission = function () {
|
||||
if (NotificationAPI) {
|
||||
return NotificationAPI.requestPermission();
|
||||
NotificationAPI.requestPermission();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -629,7 +629,7 @@ exports.get_local_notify_mix_reason = function (message) {
|
||||
if (row.length > 0) {
|
||||
// If our message is in the current message list, we do
|
||||
// not have a mix, so we are happy.
|
||||
return;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (message.type === "stream" && muting.is_topic_muted(message.stream_id, message.topic)) {
|
||||
@@ -651,6 +651,8 @@ exports.get_local_notify_mix_reason = function (message) {
|
||||
) {
|
||||
return i18n.t("Sent! Your message is outside your current narrow.");
|
||||
}
|
||||
|
||||
return undefined;
|
||||
};
|
||||
|
||||
exports.notify_local_mixes = function (messages, need_user_to_scroll) {
|
||||
|
||||
Reference in New Issue
Block a user