eslint: Fix unicorn/no-array-push-push.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2021-01-22 17:46:57 -08:00
committed by Tim Abbott
parent 2e501c8667
commit 1e7347349c
2 changed files with 15 additions and 24 deletions

View File

@@ -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 = [

View File

@@ -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();
},
};