Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

eslint: Fix unicorn/prefer-unary-minus.

Anders Kaseorgbee1ce0ad61b
diff --git a/web/src/dropdown_widget.ts b/web/src/dropdown_widget.ts
index bccc2f9a21f..1e74a5f0b58 100644
--- a/web/src/dropdown_widget.ts
+++ b/web/src/dropdown_widget.ts
@@ -272,11 +272,11 @@ export class DropdownWidget {
// Use the provided offset if we have enough space. Otherwise,
// we overlap the top of dropdown with top of dropdown input.
if (this.tippy_props?.offset === undefined) {
- top_offset = -1 * dropdown_input_props.height;
+ top_offset = -dropdown_input_props.height;
}
} else if (bottom_space > top_space) {
placement = "bottom-start";
- top_offset = -1 * dropdown_input_props.height;
+ top_offset = -dropdown_input_props.height;
}
const offset: [number, number] = [left_offset, top_offset];
diff --git a/web/src/lightbox.ts b/web/src/lightbox.ts
index 72c97890ef1..f0d3d783dcf 100644
--- a/web/src/lightbox.ts
+++ b/web/src/lightbox.ts
@@ -147,7 +147,7 @@ export class PanZoomControl {
if (modified_x < 0 + border) {
// Image has been dragged beyond the LEFT of the view.
- const move_by = modified_x * -1;
+ const move_by = -modified_x;
e.moveBy(move_by + return_buffer, 0, false);
} else if (modified_x - image_width > max_translate_x - border) {
// Image has been dragged beyond the RIGHT of the view.
@@ -157,7 +157,7 @@ export class PanZoomControl {
if (modified_y < 0 + border) {
// Image has been dragged beyond the TOP of the view.
- const move_by = modified_y * -1;
+ const move_by = -modified_y;
e.moveBy(0, move_by + return_buffer, false);
} else if (modified_y - image_height > max_translate_y - border) {
// Image has been dragged beyond the BOTTOM of the view.
diff --git a/web/src/recent_view_ui.ts b/web/src/recent_view_ui.ts
index 8e2ebed7fd2..fceb2c0296a 100644
--- a/web/src/recent_view_ui.ts
+++ b/web/src/recent_view_ui.ts
@@ -474,7 +474,7 @@ function set_table_focus(row: number, col: number, using_keyboard = false): bool
const topic_offset = topic_offset_to_visible_area($topic_row);
if (topic_offset === "above") {
- scroll_element.scrollBy({top: -1 * half_height_of_visible_area});
+ scroll_element.scrollBy({top: -half_height_of_visible_area});
} else if (topic_offset === "below") {
scroll_element.scrollBy({top: half_height_of_visible_area});
}