mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
eslint: Enable no-jquery/no-sizzle.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
b5aed2a8db
commit
ccfb50d4dd
@@ -131,6 +131,7 @@ export default tseslint.config(
|
|||||||
"no-jquery/no-append-html": "error",
|
"no-jquery/no-append-html": "error",
|
||||||
"no-jquery/no-constructor-attributes": "error",
|
"no-jquery/no-constructor-attributes": "error",
|
||||||
"no-jquery/no-parse-html-literal": "error",
|
"no-jquery/no-parse-html-literal": "error",
|
||||||
|
"no-jquery/no-sizzle": ["error", {}],
|
||||||
"no-label-var": "error",
|
"no-label-var": "error",
|
||||||
"no-labels": "error",
|
"no-labels": "error",
|
||||||
"no-multi-str": "error",
|
"no-multi-str": "error",
|
||||||
|
@@ -68,6 +68,7 @@ function get_target_navbar_menu(
|
|||||||
event_name: string,
|
event_name: string,
|
||||||
$current_navbar_menu: JQuery,
|
$current_navbar_menu: JQuery,
|
||||||
): string | undefined {
|
): string | undefined {
|
||||||
|
// eslint-disable-next-line no-jquery/no-sizzle
|
||||||
const $visible_navbar_menus = $(".navbar-item:visible");
|
const $visible_navbar_menus = $(".navbar-item:visible");
|
||||||
const index = $visible_navbar_menus.index($current_navbar_menu);
|
const index = $visible_navbar_menus.index($current_navbar_menu);
|
||||||
let $target_navbar_menu;
|
let $target_navbar_menu;
|
||||||
|
@@ -173,6 +173,7 @@ export function get_popover_items_for_instance(instance: tippy.Instance): JQuery
|
|||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line no-jquery/no-sizzle
|
||||||
return $current_elem.find("a, [tabindex='0']").filter(":visible");
|
return $current_elem.find("a, [tabindex='0']").filter(":visible");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -156,17 +156,20 @@ export class SettingsPanelMenu {
|
|||||||
}
|
}
|
||||||
|
|
||||||
prev(): boolean {
|
prev(): boolean {
|
||||||
|
// eslint-disable-next-line no-jquery/no-sizzle
|
||||||
this.$curr_li.prevAll(":visible").first().trigger("focus").trigger("click");
|
this.$curr_li.prevAll(":visible").first().trigger("focus").trigger("click");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
next(): boolean {
|
next(): boolean {
|
||||||
|
// eslint-disable-next-line no-jquery/no-sizzle
|
||||||
this.$curr_li.nextAll(":visible").first().trigger("focus").trigger("click");
|
this.$curr_li.nextAll(":visible").first().trigger("focus").trigger("click");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
enter_panel(): boolean {
|
enter_panel(): boolean {
|
||||||
const $panel = this.get_panel();
|
const $panel = this.get_panel();
|
||||||
|
// eslint-disable-next-line no-jquery/no-sizzle
|
||||||
const $panel_elem = $panel.find("input:visible,button:visible,select:visible").first();
|
const $panel_elem = $panel.find("input:visible,button:visible,select:visible").first();
|
||||||
|
|
||||||
$panel_elem.trigger("focus");
|
$panel_elem.trigger("focus");
|
||||||
|
@@ -590,7 +590,9 @@ export function update_stream_privacy_choices(policy: string): void {
|
|||||||
if (!overlays.streams_open()) {
|
if (!overlays.streams_open()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// eslint-disable-next-line no-jquery/no-sizzle
|
||||||
const stream_edit_panel_opened = $("#stream_permission_settings").is(":visible");
|
const stream_edit_panel_opened = $("#stream_permission_settings").is(":visible");
|
||||||
|
// eslint-disable-next-line no-jquery/no-sizzle
|
||||||
const stream_creation_form_opened = $("#stream-creation").is(":visible");
|
const stream_creation_form_opened = $("#stream-creation").is(":visible");
|
||||||
|
|
||||||
if (!stream_edit_panel_opened && !stream_creation_form_opened) {
|
if (!stream_edit_panel_opened && !stream_creation_form_opened) {
|
||||||
|
@@ -94,6 +94,7 @@ class PopoverMenu {
|
|||||||
|
|
||||||
const $popover = $(this.instance.popper);
|
const $popover = $(this.instance.popper);
|
||||||
|
|
||||||
|
// eslint-disable-next-line no-jquery/no-sizzle
|
||||||
const $items = $("[tabindex='0']", $popover).filter(":visible");
|
const $items = $("[tabindex='0']", $popover).filter(":visible");
|
||||||
|
|
||||||
popover_items_handle_keyboard_with_overrides(key, $items);
|
popover_items_handle_keyboard_with_overrides(key, $items);
|
||||||
@@ -631,6 +632,7 @@ function get_user_card_popover_for_message_items(): JQuery | undefined {
|
|||||||
|
|
||||||
// Return only the popover menu options that are visible, and not the
|
// Return only the popover menu options that are visible, and not the
|
||||||
// copy buttons or the link items in the custom profile fields.
|
// copy buttons or the link items in the custom profile fields.
|
||||||
|
// eslint-disable-next-line no-jquery/no-sizzle
|
||||||
return $(".link-item .popover-menu-link", $popover).filter(":visible");
|
return $(".link-item .popover-menu-link", $popover).filter(":visible");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -46,6 +46,7 @@ function get_user_group_popover_items(): JQuery | undefined {
|
|||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line no-jquery/no-sizzle
|
||||||
return $("li:not(.divider):visible a", $popover);
|
return $("li:not(.divider):visible a", $popover);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user