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/no-array-push-push.

Anders Kaseorg1e7347349c25
diff --git a/frontend_tests/node_tests/settings_org.js b/frontend_tests/node_tests/settings_org.js
index 8f7f36e13e4..65698b3cc5c 100644
--- a/frontend_tests/node_tests/settings_org.js
+++ b/frontend_tests/node_tests/settings_org.js
@@ -1000,12 +1000,10 @@ run_test("misc", () => {
settings_account.update_email_change_display();
assert(!$("#change_email .button").prop("disabled"));
- stream_data.get_streams_for_settings_page = () => {
- const arr = [];
- arr.push({name: "some_stream", stream_id: 75});
- arr.push({name: "some_stream", stream_id: 42});
- return arr;
- };
+ stream_data.get_streams_for_settings_page = () => [
+ {name: "some_stream", stream_id: 75},
+ {name: "some_stream", stream_id: 42},
+ ];
// Set stubs for dropdown_list_widget:
const widget_settings = [
diff --git a/static/shared/js/fenced_code.js b/static/shared/js/fenced_code.js
index 22a086694e2..df06b5b32c1 100644
--- a/static/shared/js/fenced_code.js
+++ b/static/shared/js/fenced_code.js
@@ -81,16 +81,17 @@ function wrap_tex(tex) {
}
function wrap_spoiler(header, text, stash_func) {
- const output = [];
const header_div_open_html = '<div class="spoiler-block"><div class="spoiler-header">';
const end_header_start_content_html = '</div><div class="spoiler-content" aria-hidden="true">';
const footer_html = "</div></div>";
- output.push(stash_func(header_div_open_html));
- output.push(header);
- output.push(stash_func(end_header_start_content_html));
- output.push(text);
- output.push(stash_func(footer_html));
+ const output = [
+ stash_func(header_div_open_html),
+ header,
+ stash_func(end_header_start_content_html),
+ text,
+ stash_func(footer_html),
+ ];
return output.join("\n\n");
}
@@ -121,9 +122,7 @@ export function process_fenced_code(content) {
done() {
const text = wrap_quote(lines.join("\n"));
- output_lines.push("");
- output_lines.push(text);
- output_lines.push("");
+ output_lines.push("", text, "");
handler_stack.pop();
},
};
@@ -142,9 +141,7 @@ export function process_fenced_code(content) {
done() {
const text = wrap_tex(lines.join("\n"));
const placeholder = stash_func(text, true);
- output_lines.push("");
- output_lines.push(placeholder);
- output_lines.push("");
+ output_lines.push("", placeholder, "");
handler_stack.pop();
},
};
@@ -162,9 +159,7 @@ export function process_fenced_code(content) {
done() {
const text = wrap_spoiler(header, lines.join("\n"), stash_func);
- output_lines.push("");
- output_lines.push(text);
- output_lines.push("");
+ output_lines.push("", text, "");
handler_stack.pop();
},
};
@@ -183,9 +178,7 @@ export function process_fenced_code(content) {
const text = wrap_code(lines.join("\n"), lang);
// insert safe HTML that is passed through the parsing
const placeholder = stash_func(text, true);
- output_lines.push("");
- output_lines.push(placeholder);
- output_lines.push("");
+ output_lines.push("", placeholder, "");
handler_stack.pop();
},
};