mirror of https://github.com/zulip/zulip.git
lint: Require folding of } on same line in else if statements.
This commit is contained in:
parent
c35781d505
commit
584887e588
|
@ -107,8 +107,7 @@ exports.build_widget = function (
|
|||
input_error.text('File size must be < 5Mb.');
|
||||
input_error.show();
|
||||
clear();
|
||||
}
|
||||
else if (!is_image_format(file)) {
|
||||
} else if (!is_image_format(file)) {
|
||||
input_error.text('File type is not supported.');
|
||||
input_error.show();
|
||||
clear();
|
||||
|
@ -193,8 +192,7 @@ exports.build_direct_upload_widget = function (
|
|||
input_error.text('File size must be < 5Mb.');
|
||||
input_error.show();
|
||||
clear();
|
||||
}
|
||||
else if (!is_image_format(file)) {
|
||||
} else if (!is_image_format(file)) {
|
||||
input_error.text('File type is not supported.');
|
||||
input_error.show();
|
||||
clear();
|
||||
|
|
|
@ -62,8 +62,7 @@ function message_matches_search_term(message, operator, operand) {
|
|||
case 'in':
|
||||
if (operand === 'home') {
|
||||
return message_in_home(message);
|
||||
}
|
||||
else if (operand === 'all') {
|
||||
} else if (operand === 'all') {
|
||||
return true;
|
||||
}
|
||||
return true; // in:whatever returns true
|
||||
|
|
|
@ -117,11 +117,9 @@ exports.actions_menu_handle_keyboard = function (key) {
|
|||
}
|
||||
if (index === -1) {
|
||||
index = 0;
|
||||
}
|
||||
else if ((key === 'down_arrow' || key === 'vim_down') && index < items.length - 1) {
|
||||
} else if ((key === 'down_arrow' || key === 'vim_down') && index < items.length - 1) {
|
||||
++index;
|
||||
}
|
||||
else if ((key === 'up_arrow' || key === 'vim_up') && index > 0) {
|
||||
} else if ((key === 'up_arrow' || key === 'vim_up') && index > 0) {
|
||||
--index;
|
||||
}
|
||||
items.eq(index).focus();
|
||||
|
|
|
@ -212,8 +212,7 @@ exports.resize_page_components = function () {
|
|||
$("#group-pms").css("margin", "0px");
|
||||
$("#userlist-toggle").css("display", "none");
|
||||
$("#invite-user-link").hide();
|
||||
}
|
||||
else if (!css_narrow_mode && narrow_window) {
|
||||
} else if (!css_narrow_mode && narrow_window) {
|
||||
// move stuff to the right sidebar (wide mode)
|
||||
narrow_window = false;
|
||||
popovers.set_userlist_placement("right");
|
||||
|
|
|
@ -212,11 +212,9 @@ function update_count_in_dom(count_span, value_span, count) {
|
|||
count_span.hide();
|
||||
if (count_span.parent().hasClass("subscription_block")) {
|
||||
count_span.parent(".subscription_block").removeClass("stream-with-count");
|
||||
}
|
||||
else if (count_span.parent().hasClass("user_sidebar_entry")) {
|
||||
} else if (count_span.parent().hasClass("user_sidebar_entry")) {
|
||||
count_span.parent(".user_sidebar_entry").removeClass("user-with-count");
|
||||
}
|
||||
else if (count_span.parent().hasClass("group-pms-sidebar-entry")) {
|
||||
} else if (count_span.parent().hasClass("group-pms-sidebar-entry")) {
|
||||
count_span.parent(".group-pms-sidebar-entry").removeClass("group-with-count");
|
||||
}
|
||||
value_span.text('');
|
||||
|
@ -227,11 +225,9 @@ function update_count_in_dom(count_span, value_span, count) {
|
|||
|
||||
if (count_span.parent().hasClass("subscription_block")) {
|
||||
count_span.parent(".subscription_block").addClass("stream-with-count");
|
||||
}
|
||||
else if (count_span.parent().hasClass("user_sidebar_entry")) {
|
||||
} else if (count_span.parent().hasClass("user_sidebar_entry")) {
|
||||
count_span.parent(".user_sidebar_entry").addClass("user-with-count");
|
||||
}
|
||||
else if (count_span.parent().hasClass("group-pms-sidebar-entry")) {
|
||||
} else if (count_span.parent().hasClass("group-pms-sidebar-entry")) {
|
||||
count_span.parent(".group-pms-sidebar-entry").addClass("group-with-count");
|
||||
}
|
||||
value_span.text(count);
|
||||
|
|
|
@ -25,8 +25,7 @@ function selectText(element) {
|
|||
|
||||
sel.removeAllRanges();
|
||||
sel.addRange(range);
|
||||
}
|
||||
else if (document.body.createTextRange) {
|
||||
} else if (document.body.createTextRange) {
|
||||
range = document.body.createTextRange();
|
||||
range.moveToElementText(element);
|
||||
range.select();
|
||||
|
|
|
@ -153,6 +153,8 @@ js_rules = [
|
|||
'description': 'Missing space between else and {'},
|
||||
{'pattern': '^else {$',
|
||||
'description': 'Write JS else statements on same line as }'},
|
||||
{'pattern': '^else if',
|
||||
'description': 'Write JS else statements on same line as }'},
|
||||
] + whitespace_rules
|
||||
python_rules = [
|
||||
{'pattern': '^(?!#)@login_required',
|
||||
|
|
Loading…
Reference in New Issue