Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
eslint: Enable arrow-parens.
Anders Kaseorgb0253c5a2e14
diff --git a/.eslintrc.json b/.eslintrc.jsonindex 9f6a6aeea05..11a6f93a176 100644--- a/.eslintrc.json+++ b/.eslintrc.json@@ -17,6 +17,7 @@"rules": {"array-callback-return": "error","array-bracket-spacing": "error",+ "arrow-parens": "error","arrow-spacing": [ "error", { "before": true, "after": true } ],"block-scoped-var": "error","brace-style": [ "error", "1tbs", { "allowSingleLine": true } ],diff --git a/frontend_tests/node_tests/activity.js b/frontend_tests/node_tests/activity.jsindex d73f246386f..013edf1ac56 100644--- a/frontend_tests/node_tests/activity.js+++ b/frontend_tests/node_tests/activity.js@@ -18,7 +18,7 @@ const _document = {const _channel = {};const _ui = {- get_content_element: element => element,+ get_content_element: (element) => element,};const _keydown_util = {@@ -686,7 +686,7 @@ run_test('initialize', () => {func();},});- $(window).focus = func => func();+ $(window).focus = (func) => func();$(window).idle = () => {};channel.post = function (payload) {diff --git a/frontend_tests/node_tests/bot_data.js b/frontend_tests/node_tests/bot_data.jsindex f5bd8b823b7..df99d7b7cf4 100644--- a/frontend_tests/node_tests/bot_data.js+++ b/frontend_tests/node_tests/bot_data.js@@ -137,7 +137,7 @@ run_test('test_basics', () => {bot_data.add({...test_bot, user_id: 45, email: '[email protected]', owner_id: me.user_id, is_active: true});bot_data.add({...test_bot, user_id: 46, email: '[email protected]', owner_id: fred.user_id, is_active: true});- const editable_bots = bot_data.get_editable().map(bot => bot.email);+ const editable_bots = bot_data.get_editable().map((bot) => bot.email);assert.deepEqual(['[email protected]', '[email protected]'], editable_bots);}());diff --git a/frontend_tests/node_tests/composebox_typeahead.js b/frontend_tests/node_tests/composebox_typeahead.jsindex a433cc3bd83..179dab148ff 100644--- a/frontend_tests/node_tests/composebox_typeahead.js+++ b/frontend_tests/node_tests/composebox_typeahead.js@@ -114,7 +114,7 @@ const emojis_by_name = new Map(Object.entries({heart: emoji_heart,headphones: emoji_headphones,}));-const emoji_list = Array.from(emojis_by_name.values(), emoji_dict => {+const emoji_list = Array.from(emojis_by_name.values(), (emoji_dict) => {if (emoji_dict.is_realm_emoji === true) {return {emoji_name: emoji_dict.name,@@ -518,7 +518,7 @@ run_test('content_typeahead_selected', () => {});function sorted_names_from(subs) {- return subs.map(sub => sub.name).sort();+ return subs.map((sub) => sub.name).sort();}run_test('initialize', () => {@@ -1320,7 +1320,7 @@ run_test('begins_typeahead', () => {assert_typeahead_equals("```test", "ing", false);assert_typeahead_equals("~~~test", "ing", false);const terminal_symbols = ',.;?!()[] "\'\n\t';- terminal_symbols.split().forEach(symbol => {+ terminal_symbols.split().forEach((symbol) => {assert_stream_list("#test", symbol);assert_typeahead_equals("@test", symbol, all_mentions);assert_typeahead_equals(":test", symbol, emoji_list);diff --git a/frontend_tests/node_tests/dispatch.js b/frontend_tests/node_tests/dispatch.jsindex dacc3cee163..b9ba52c0887 100644--- a/frontend_tests/node_tests/dispatch.js+++ b/frontend_tests/node_tests/dispatch.js@@ -8,7 +8,7 @@ const test_user = events.test_user;set_global('$', global.make_zjquery());-global.patch_builtin('setTimeout', func => func());+global.patch_builtin('setTimeout', (func) => func());// These dependencies are closer to the dispatcher, and they// apply to all tests.@@ -570,7 +570,7 @@ with_overrides(function (override) {override('subs.add_sub_to_table', noop);dispatch(event);const args = stub.get_args('streams');- assert_same(args.streams.map(stream => stream.stream_id), [42, 99]);+ assert_same(args.streams.map((stream) => stream.stream_id), [42, 99]);});// stream deletediff --git a/frontend_tests/node_tests/dropdown_list_widget.js b/frontend_tests/node_tests/dropdown_list_widget.jsindex d3adb3352af..fc1a122d190 100644--- a/frontend_tests/node_tests/dropdown_list_widget.js+++ b/frontend_tests/node_tests/dropdown_list_widget.js@@ -24,7 +24,7 @@ run_test('basic_functions', () => {let updated_value;const opts = {widget_name: 'my_setting',- data: ['one', 'two', 'three'].map(x => ({name: x, value: x})),+ data: ['one', 'two', 'three'].map((x) => ({name: x, value: x})),value: 'one',on_update: (val) => { updated_value = val; },default_text: i18n.t("not set"),@@ -55,7 +55,7 @@ run_test('basic_functions', () => {run_test('no_default_value', () => {const opts = {widget_name: 'my_setting',- data: ['one', 'two', 'three'].map(x => ({name: x, value: x})),+ data: ['one', 'two', 'three'].map((x) => ({name: x, value: x})),default_text: i18n.t("not set"),render_text: (text) => `rendered: ${text}`,null_value: 'null-value',diff --git a/frontend_tests/node_tests/filter.js b/frontend_tests/node_tests/filter.jsindex 729a2ef84e1..29d92e7523f 100644--- a/frontend_tests/node_tests/filter.js+++ b/frontend_tests/node_tests/filter.js@@ -35,7 +35,7 @@ people.add_active_user(steve);people.initialize_current_user(me.user_id);function assert_same_operators(result, terms) {- terms = terms.map(term => {+ terms = terms.map((term) => {// If negated flag is undefined, we explicitly// set it to false.let negated = term.negated;@@ -571,7 +571,7 @@ run_test('canonicalizations', () => {});function get_predicate(operators) {- operators = operators.map(op => ({+ operators = operators.map((op) => ({operator: op[0],operand: op[1],}));@@ -1558,7 +1558,7 @@ run_test('navbar_helpers', () => {},];- test_cases.forEach(test_case => {+ test_cases.forEach((test_case) => {test_helpers(test_case);});@@ -1579,7 +1579,7 @@ run_test('navbar_helpers', () => {},];- redirect_edge_cases.forEach(test_case => {+ redirect_edge_cases.forEach((test_case) => {test_redirect_url_with_search(test_case);});diff --git a/frontend_tests/node_tests/message_fetch.js b/frontend_tests/node_tests/message_fetch.jsindex f4e62f81aab..6d1a32ca58a 100644--- a/frontend_tests/node_tests/message_fetch.js+++ b/frontend_tests/node_tests/message_fetch.js@@ -107,7 +107,7 @@ function config_process_results(messages) {messages_processed_for_bools.push(message);};- message_store.add_message_metadata = message => message;+ message_store.add_message_metadata = (message) => message;message_util.do_unread_count_updates = function (arg) {assert.deepEqual(arg, messages);@@ -130,7 +130,7 @@ function config_process_results(messages) {}function message_range(start, end) {- return _.range(start, end).map(idx => ({+ return _.range(start, end).map((idx) => ({id: idx,}));}diff --git a/frontend_tests/node_tests/message_list_data.js b/frontend_tests/node_tests/message_list_data.jsindex 23e6055f2e0..a5aa70fa7d0 100644--- a/frontend_tests/node_tests/message_list_data.js+++ b/frontend_tests/node_tests/message_list_data.js@@ -155,12 +155,12 @@ run_test('more muting', () => {});assert.deepEqual(- mld._all_items.map(message => message.id),+ mld._all_items.map((message) => message.id),[3, 4, 7, 8]);assert.deepEqual(- mld.all_messages().map(message => message.id),+ mld.all_messages().map((message) => message.id),[4, 8]);@@ -177,12 +177,12 @@ run_test('more muting', () => {const more_info = mld.add_messages(more_messages);assert.deepEqual(- mld._all_items.map(message => message.id),+ mld._all_items.map((message) => message.id),[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);assert.deepEqual(- mld.all_messages().map(message => message.id),+ mld.all_messages().map((message) => message.id),[2, 4, 6, 8, 10]);diff --git a/frontend_tests/node_tests/message_list_view.js b/frontend_tests/node_tests/message_list_view.jsindex c0fd49b3d15..6c6eb34fbda 100644--- a/frontend_tests/node_tests/message_list_view.js+++ b/frontend_tests/node_tests/message_list_view.js@@ -169,7 +169,7 @@ run_test('merge_message_groups', () => {}function extract_message_ids(lst) {- return lst.map(item => item.msg.id);+ return lst.map((item) => item.msg.id);}function assert_message_list_equal(list1, list2) {@@ -546,7 +546,7 @@ run_test('render_windows', () => {let messages;function reset_list(opts) {- messages = _.range(opts.count).map(i => ({+ messages = _.range(opts.count).map((i) => ({id: i,}));list.selected_idx = function () { return 0; };diff --git a/frontend_tests/node_tests/message_store.js b/frontend_tests/node_tests/message_store.jsindex ab1a72fc1b0..a6029a6b4c2 100644--- a/frontend_tests/node_tests/message_store.js+++ b/frontend_tests/node_tests/message_store.js@@ -65,7 +65,7 @@ people.initialize_current_user(me.user_id);function convert_recipients(people) {// Display_recipient uses `id` for user_ids.- return people.map(p => ({+ return people.map((p) => ({email: p.email,id: p.user_id,full_name: p.full_name,diff --git a/frontend_tests/node_tests/narrow.js b/frontend_tests/node_tests/narrow.jsindex 1a8e81afd0e..fdf48039023 100644--- a/frontend_tests/node_tests/narrow.js+++ b/frontend_tests/node_tests/narrow.js@@ -17,7 +17,7 @@ set_global('resize', {zrequire('narrow');function set_filter(operators) {- operators = operators.map(op => ({+ operators = operators.map((op) => ({operator: op[0],operand: op[1],}));diff --git a/frontend_tests/node_tests/narrow_local.js b/frontend_tests/node_tests/narrow_local.jsindex 35eeedc7f46..c984d5cc76d 100644--- a/frontend_tests/node_tests/narrow_local.js+++ b/frontend_tests/node_tests/narrow_local.js@@ -68,7 +68,7 @@ function test_with(fixture) {assert.deepEqual(id_info, fixture.expected_id_info);const msgs = msg_data.all_messages();- const msg_ids = msgs.map(message => message.id);+ const msg_ids = msgs.map((message) => message.id);assert.deepEqual(msg_ids, fixture.expected_msg_ids);}diff --git a/frontend_tests/node_tests/narrow_state.js b/frontend_tests/node_tests/narrow_state.jsindex 7a5a80770db..b34b6c4d461 100644--- a/frontend_tests/node_tests/narrow_state.js+++ b/frontend_tests/node_tests/narrow_state.js@@ -7,7 +7,7 @@ zrequire('narrow_state');set_global('page_params', {});function set_filter(operators) {- operators = operators.map(op => ({+ operators = operators.map((op) => ({operator: op[0],operand: op[1],}));diff --git a/frontend_tests/node_tests/people.js b/frontend_tests/node_tests/people.jsindex e3e5a10c22c..10f54551045 100644--- a/frontend_tests/node_tests/people.js+++ b/frontend_tests/node_tests/people.js@@ -897,7 +897,7 @@ run_test('updates', () => {const all_people = get_all_persons();assert.equal(all_people.length, 2);- person = all_people.filter(p => p.email === new_email)[0];+ person = all_people.filter((p) => p.email === new_email)[0];assert.equal(person.full_name, 'Foo Barson');// Test shim where we can still retrieve user info using thediff --git a/frontend_tests/node_tests/pm_list.js b/frontend_tests/node_tests/pm_list.jsindex 98461246fd9..418fd21f545 100644--- a/frontend_tests/node_tests/pm_list.js+++ b/frontend_tests/node_tests/pm_list.js@@ -2,7 +2,7 @@ set_global('$', global.make_zjquery());set_global('narrow_state', {});set_global('ui', {- get_content_element: element => element,+ get_content_element: (element) => element,});set_global('stream_popover', {hide_topic_popover: function () {},diff --git a/frontend_tests/node_tests/reactions.js b/frontend_tests/node_tests/reactions.jsindex 45befca5996..365b9826f79 100644--- a/frontend_tests/node_tests/reactions.js+++ b/frontend_tests/node_tests/reactions.js@@ -420,7 +420,7 @@ run_test('add_and_remove_reaction', () => {const result = reactions.get_message_reactions(message);assert(reaction_element.hasClass('reacted'));- const realm_emoji_data = result.filter(v => v.emoji_name === 'realm_emoji')[0];+ const realm_emoji_data = result.filter((v) => v.emoji_name === 'realm_emoji')[0];assert.equal(realm_emoji_data.count, 2);assert.equal(realm_emoji_data.is_realm_emoji, true);diff --git a/frontend_tests/node_tests/recent_senders.js b/frontend_tests/node_tests/recent_senders.jsindex 6cdf6fb7f98..54aa83666d5 100644--- a/frontend_tests/node_tests/recent_senders.js+++ b/frontend_tests/node_tests/recent_senders.js@@ -5,7 +5,7 @@ const messages = [];set_global('message_util', {get_messages_in_topic: (stream_id, topic) => {- return messages.filter(x => {+ return messages.filter((x) => {return x.stream_id === stream_id &&x.topic.toLowerCase() === topic.toLowerCase();});diff --git a/frontend_tests/node_tests/rendered_markdown.js b/frontend_tests/node_tests/rendered_markdown.jsindex 9d02349d75b..1352450a146 100644--- a/frontend_tests/node_tests/rendered_markdown.js+++ b/frontend_tests/node_tests/rendered_markdown.js@@ -52,7 +52,7 @@ stream_data.add_sub(stream);const $array = (array) => {const each = (func) => {- array.forEach(e => {+ array.forEach((e) => {func.call(e);});};diff --git a/frontend_tests/node_tests/scroll_util.js b/frontend_tests/node_tests/scroll_util.jsindex b04f182e603..19d3f40bc14 100644--- a/frontend_tests/node_tests/scroll_util.js+++ b/frontend_tests/node_tests/scroll_util.js@@ -1,6 +1,6 @@zrequire('scroll_util');set_global('ui', {- get_scroll_element: element => element,+ get_scroll_element: (element) => element,});run_test('scroll_delta', () => {diff --git a/frontend_tests/node_tests/search.js b/frontend_tests/node_tests/search.jsindex 4e7a7efc981..8b4a7550dfd 100644--- a/frontend_tests/node_tests/search.js+++ b/frontend_tests/node_tests/search.js@@ -27,7 +27,7 @@ set_global('search_pill_widget', {search_pill.append_search_string = noop;search_pill.get_search_string_for_current_filter = noop;-global.patch_builtin('setTimeout', func => func());+global.patch_builtin('setTimeout', (func) => func());run_test('clear_search_form', () => {$('#search_query').val('noise');diff --git a/frontend_tests/node_tests/search_legacy.js b/frontend_tests/node_tests/search_legacy.jsindex 5ebd1169c6b..2d1841ca549 100644--- a/frontend_tests/node_tests/search_legacy.js+++ b/frontend_tests/node_tests/search_legacy.js@@ -17,7 +17,7 @@ set_global('ui_util', {set_global('narrow', {});set_global('Filter', {});-global.patch_builtin('setTimeout', func => func());+global.patch_builtin('setTimeout', (func) => func());run_test('update_button_visibility', () => {const search_query = $('#search_query');diff --git a/frontend_tests/node_tests/settings_org.js b/frontend_tests/node_tests/settings_org.jsindex c1066118674..fa53843f5f0 100644--- a/frontend_tests/node_tests/settings_org.js+++ b/frontend_tests/node_tests/settings_org.js@@ -200,7 +200,7 @@ function test_submit_settings_form(submit_form) {realm_create_stream_policy: settings_config.create_stream_policy_values.by_members.code,});- global.patch_builtin('setTimeout', func => func());+ global.patch_builtin('setTimeout', (func) => func());const ev = {preventDefault: noop,stopPropagation: noop,@@ -1016,7 +1016,7 @@ run_test('misc', () => {'realm_default_code_block_language'];const dropdown_list_parent = $.create(`<list parent>`);dropdown_list_parent.set_find_results('.dropdown_list_reset_button:not([disabled])', $.create('<disable button>'));- widget_settings.forEach(name => {+ widget_settings.forEach((name) => {const elem = $.create(`#${name}_widget #${name}_name`);elem.closest = () => {return dropdown_list_parent;diff --git a/frontend_tests/node_tests/settings_user_groups.js b/frontend_tests/node_tests/settings_user_groups.jsindex 7e79f012a20..ff9b977c7c8 100644--- a/frontend_tests/node_tests/settings_user_groups.js+++ b/frontend_tests/node_tests/settings_user_groups.js@@ -210,7 +210,7 @@ run_test('populate_user_groups', () => {(function test_source() {const result = config.source.call(fake_context, iago);- const emails = result.map(user => user.email).sort();+ const emails = result.map((user) => user.email).sort();assert.deepEqual(emails, [alice.email, bob.email]);}());diff --git a/frontend_tests/node_tests/stream_data.js b/frontend_tests/node_tests/stream_data.jsindex 5cf005b622b..f5cd80e34c4 100644--- a/frontend_tests/node_tests/stream_data.js+++ b/frontend_tests/node_tests/stream_data.js@@ -35,7 +35,7 @@ people.add_active_user(me);people.initialize_current_user(me.user_id);function contains_sub(subs, sub) {- return subs.some(s => s.name === sub.name);+ return subs.some((s) => s.name === sub.name);}run_test('basics', () => {@@ -921,7 +921,7 @@ run_test('initialize', () => {initialize();assert(!stream_data.is_filtering_inactives());- const stream_names = stream_data.get_streams_for_admin().map(elem => elem.name);+ const stream_names = stream_data.get_streams_for_admin().map((elem) => elem.name);assert(stream_names.includes('subscriptions'));assert(stream_names.includes('unsubscribed'));assert(stream_names.includes('never_subscribed'));diff --git a/frontend_tests/node_tests/stream_list.js b/frontend_tests/node_tests/stream_list.jsindex 74705c5a231..a2ed2c62735 100644--- a/frontend_tests/node_tests/stream_list.js+++ b/frontend_tests/node_tests/stream_list.js@@ -390,7 +390,7 @@ run_test('narrowing', () => {scroll_util.scroll_element_into_container = noop;set_global('ui', {- get_scroll_element: element => element,+ get_scroll_element: (element) => element,});assert(!$('<devel sidebar row html>').hasClass('active-filter'));diff --git a/frontend_tests/node_tests/subs.js b/frontend_tests/node_tests/subs.jsindex 0a8a1f417fb..defcb98d73f 100644--- a/frontend_tests/node_tests/subs.js+++ b/frontend_tests/node_tests/subs.js@@ -1,8 +1,8 @@global.stub_out_jquery();set_global('ui', {- get_content_element: element => element,- get_scroll_element: element => element,+ get_content_element: (element) => element,+ get_scroll_element: (element) => element,});zrequire('stream_data');zrequire('search_util');diff --git a/frontend_tests/node_tests/topic_list_data.js b/frontend_tests/node_tests/topic_list_data.jsindex ad82ec15472..20de9861ee6 100644--- a/frontend_tests/node_tests/topic_list_data.js+++ b/frontend_tests/node_tests/topic_list_data.js@@ -81,7 +81,7 @@ run_test('get_list_info unreads', () => {// Going forward, we just stub get_recent_topic_names// for simpler test setup.stream_topic_history.get_recent_topic_names = () => {- return _.range(15).map(i => 'topic ' + i);+ return _.range(15).map((i) => 'topic ' + i);};const unread_cnt = new Map();@@ -108,7 +108,7 @@ run_test('get_list_info unreads', () => {assert.equal(list_info.num_possible_topics, 15);assert.deepEqual(- list_info.items.map(li => li.topic_name),+ list_info.items.map((li) => li.topic_name),['topic 0','topic 1',@@ -128,7 +128,7 @@ run_test('get_list_info unreads', () => {assert.equal(list_info.num_possible_topics, 15);assert.deepEqual(- list_info.items.map(li => li.topic_name),+ list_info.items.map((li) => li.topic_name),['topic 0','topic 1',@@ -155,7 +155,7 @@ run_test('get_list_info unreads', () => {assert.equal(list_info.num_possible_topics, 15);assert.deepEqual(- list_info.items.map(li => li.topic_name),+ list_info.items.map((li) => li.topic_name),['topic 0','topic 1',diff --git a/frontend_tests/node_tests/typeahead_helper.js b/frontend_tests/node_tests/typeahead_helper.jsindex 0477b7c3c41..079017f7681 100644--- a/frontend_tests/node_tests/typeahead_helper.js+++ b/frontend_tests/node_tests/typeahead_helper.js@@ -26,8 +26,8 @@ let next_id = 0;function assertSameEmails(lst1, lst2) {assert.deepEqual(- lst1.map(r => r.email),- lst2.map(r => r.email)+ lst1.map((r) => r.email),+ lst2.map((r) => r.email));}@@ -211,7 +211,7 @@ function get_typeahead_result(query, current_stream, current_topic) {current_stream,current_topic);- return result.map(person => person.email);+ return result.map((person) => person.email);}run_test('sort_recipients', () => {@@ -363,7 +363,7 @@ run_test('sort_recipients dup bots', () => {const dup_objects = matches.concat([a_bot]);const recipients = th.sort_recipients(dup_objects, "b", "", "");- const recipients_email = recipients.map(person => person.email);+ const recipients_email = recipients.map((person) => person.email);const expected = [@@ -400,7 +400,7 @@ run_test('sort_recipients subscribers', () => {// b_user_2 is a subscriber and b_user_1 is not.const small_matches = [b_user_2, b_user_1];const recipients = th.sort_recipients(small_matches, "b", "Dev", "Dev Topic");- const recipients_email = recipients.map(person => person.email);+ const recipients_email = recipients.map((person) => person.email);const expected = [@@ -413,7 +413,7 @@ run_test('sort_recipients pm partners', () => {// both are not subscribered to the stream Linux.const small_matches = [b_user_3, b_user_2];const recipients = th.sort_recipients(small_matches, "b", "Linux", "Linux Topic");- const recipients_email = recipients.map(person => person.email);+ const recipients_email = recipients.map((person) => person.email);const expected = [@@ -432,7 +432,7 @@ run_test('sort broadcast mentions', () => {'');assert.deepEqual(- results.map(r => r.email),+ results.map((r) => r.email),['all', 'everyone', 'stream']);@@ -449,7 +449,7 @@ run_test('sort broadcast mentions', () => {'');assert.deepEqual(- results2.map(r => r.email),+ results2.map((r) => r.email),['all','everyone','stream',@@ -709,7 +709,7 @@ run_test('sort_slash_commands', () => {run_test('sort_recipientbox_typeahead', () => {let recipients = th.sort_recipientbox_typeahead("b, a", matches, ""); // search "a"- let recipients_email = recipients.map(person => person.email);+ let recipients_email = recipients.map((person) => person.email);assert.deepEqual(recipients_email, ['[email protected]', // matches "a"'[email protected]', // matches "a"@@ -721,7 +721,7 @@ run_test('sort_recipientbox_typeahead', () => {]);recipients = th.sort_recipientbox_typeahead("b, a, b", matches, ""); // search "b"- recipients_email = recipients.map(person => person.email);+ recipients_email = recipients.map((person) => person.email);assert.deepEqual(recipients_email, [diff --git a/frontend_tests/node_tests/ui_init.js b/frontend_tests/node_tests/ui_init.jsindex 9d7c925bfca..5f714fb7150 100644--- a/frontend_tests/node_tests/ui_init.js+++ b/frontend_tests/node_tests/ui_init.js@@ -72,7 +72,7 @@ emoji.emojis_by_name = new Map();util.is_mobile = () => false;global.stub_templates(() => 'some-html');-ui.get_scroll_element = element => element;+ui.get_scroll_element = (element) => element;zrequire('alert_words');zrequire('hash_util');diff --git a/frontend_tests/node_tests/vdom.js b/frontend_tests/node_tests/vdom.jsindex 05492211438..4f85133dfbd 100644--- a/frontend_tests/node_tests/vdom.js+++ b/frontend_tests/node_tests/vdom.js@@ -119,7 +119,7 @@ function make_child(i, name) {}function make_children(lst) {- return lst.map(i => make_child(i, 'foo' + i));+ return lst.map((i) => make_child(i, 'foo' + i));}run_test('children', () => {diff --git a/frontend_tests/puppeteer_lib/common.js b/frontend_tests/puppeteer_lib/common.jsindex e9cb62ffe02..782f557d767 100644--- a/frontend_tests/puppeteer_lib/common.js+++ b/frontend_tests/puppeteer_lib/common.js@@ -105,7 +105,7 @@ class CommonUtils {// is parsed but before DOMContentLoaded event is fired.await Promise.all([page.waitForNavigation({ waitUntil: 'domcontentloaded' }),- page.$eval('#login_form', form => form.submit()),+ page.$eval('#login_form', (form) => form.submit()),]);}@@ -224,7 +224,7 @@ class CommonUtils {// confirm if compose box is empty.const compose_box_element = await page.$("#compose-textarea");- const compose_box_content = await page.evaluate(element => element.textContent,+ const compose_box_content = await page.evaluate((element) => element.textContent,compose_box_element);assert.equal(compose_box_content, '', 'Compose box not empty after message sent');diff --git a/frontend_tests/puppeteer_tests/00-realm-creation.js b/frontend_tests/puppeteer_tests/00-realm-creation.jsindex 880149e0f1e..040dfade581 100644--- a/frontend_tests/puppeteer_tests/00-realm-creation.js+++ b/frontend_tests/puppeteer_tests/00-realm-creation.js@@ -14,7 +14,7 @@ async function realm_creation_tests(page) {await page.type('#email', email);await Promise.all([page.waitForNavigation(),- page.$eval('#send_confirm', form => form.submit()),+ page.$eval('#send_confirm', (form) => form.submit()),]);// Make sure onfirmation email is sent.@@ -53,9 +53,9 @@ async function realm_creation_tests(page) {};// For some reason, page.click() does not work this for particular checkbox// so use page.$eval here to call the .click method in the browser.- await page.$eval('#realm_in_root_domain', el => el.click());+ await page.$eval('#realm_in_root_domain', (el) => el.click());await common.fill_form(page, '#registration', params);- await page.$eval('#registration', form => form.submit());+ await page.$eval('#registration', (form) => form.submit());// Check if realm is created and user is logged in by checking if// element of id `lightbox_overlay` exists.diff --git a/frontend_tests/zjsunit/handlebars.js b/frontend_tests/zjsunit/handlebars.jsindex 209babfaf7c..1b0167d8f8e 100644--- a/frontend_tests/zjsunit/handlebars.js+++ b/frontend_tests/zjsunit/handlebars.js@@ -7,7 +7,7 @@ const templates_path = path.resolve(__dirname, "../../static/templates");exports.make_handlebars = () => Handlebars.create();-exports.stub_templates = stub => {+exports.stub_templates = (stub) => {window.template_stub = stub;};diff --git a/frontend_tests/zjsunit/i18n.js b/frontend_tests/zjsunit/i18n.jsindex ba3d7f3bed3..888ef467185 100644--- a/frontend_tests/zjsunit/i18n.js+++ b/frontend_tests/zjsunit/i18n.js@@ -17,7 +17,7 @@ exports.t = function (str, context) {*/const keyword_regex = /__(- )?(\w)+__/g;const keys_in_str = str.match(keyword_regex) || [];- const substitutions = keys_in_str.map(key => {+ const substitutions = keys_in_str.map((key) => {let prefix_length;if (key.startsWith("__- ")) {prefix_length = 4;diff --git a/frontend_tests/zjsunit/index.js b/frontend_tests/zjsunit/index.jsindex 62b286f5641..18547b50166 100644--- a/frontend_tests/zjsunit/index.js+++ b/frontend_tests/zjsunit/index.js@@ -79,7 +79,7 @@ global.read_fixture_data = (fn) => {function short_tb(tb) {const lines = tb.split('\n');- const i = lines.findIndex(line => line.includes('run_test') || line.includes('run_one_module'));+ const i = lines.findIndex((line) => line.includes('run_test') || line.includes('run_one_module'));if (i === -1) {return tb;diff --git a/frontend_tests/zjsunit/zblueslip.js b/frontend_tests/zjsunit/zblueslip.jsindex 539de29f026..d661a1442fe 100644--- a/frontend_tests/zjsunit/zblueslip.js+++ b/frontend_tests/zjsunit/zblueslip.js@@ -41,7 +41,7 @@ exports.make_zblueslip = function () {for (const name of names) {for (const obj of lib.test_logs[name]) {const message = obj.message;- const i = lib.test_data[name].findIndex(x => x.message === message);+ const i = lib.test_data[name].findIndex((x) => x.message === message);if (i === -1) {// Only throw this for message types we want to explicitly track.// For example, we do not want to throw here for debug messages.@@ -99,7 +99,7 @@ exports.make_zblueslip = function () {}}lib.test_logs[name].push({message, more_info, stack});- const matched_error_message = lib.test_data[name].find(x => x.message === message);+ const matched_error_message = lib.test_data[name].find((x) => x.message === message);const exact_match_fail = !matched_error_message;if (exact_match_fail) {const error = Error(`Invalid ${name} message: "${message}".`);diff --git a/frontend_tests/zjsunit/zjquery.js b/frontend_tests/zjsunit/zjquery.jsindex e48f2cabcad..bb6beeb56d2 100644--- a/frontend_tests/zjsunit/zjquery.js+++ b/frontend_tests/zjsunit/zjquery.js@@ -523,9 +523,9 @@ exports.make_zjquery = function (opts) {zjquery.state = function () {// useful for debugging- let res = Array.from(elems.values(), v => v.debug());+ let res = Array.from(elems.values(), (v) => v.debug());- res = res.map(v => [v.selector, v.value, v.shown]);+ res = res.map((v) => [v.selector, v.value, v.shown]);res.sort();diff --git a/static/js/blueslip.js b/static/js/blueslip.jsindex 4aeccf616e7..0e60a35e8f1 100644--- a/static/js/blueslip.js+++ b/static/js/blueslip.js@@ -37,7 +37,7 @@ Logger.prototype = (function () {pad(now.getUTCSeconds(), 2) + '.' +pad(now.getUTCMilliseconds(), 3) + ' UTC';- const str_args = args.map(x => typeof x === "object" ? JSON.stringify(x) : x);+ const str_args = args.map((x) => typeof x === "object" ? JSON.stringify(x) : x);const log_entry = date_str + " " + name.toUpperCase() +': ' + str_args.join("");diff --git a/static/js/bot_data.js b/static/js/bot_data.jsindex 33212cbde48..215f24032b9 100644--- a/static/js/bot_data.js+++ b/static/js/bot_data.js@@ -30,7 +30,7 @@ exports.all_user_ids = function () {exports.add = function (bot) {const clean_bot = _.pick(bot, bot_fields);bots.set(bot.user_id, clean_bot);- const clean_services = bot.services.map(service => _.pick(service, services_fields));+ const clean_services = bot.services.map((service) => _.pick(service, services_fields));services.set(bot.user_id, clean_services);send_change_event();diff --git a/static/js/buddy_data.js b/static/js/buddy_data.jsindex 55a7780a224..2f44980d604 100644--- a/static/js/buddy_data.js+++ b/static/js/buddy_data.js@@ -116,12 +116,12 @@ function filter_user_ids(user_filter_text, user_ids) {return user_ids;}- user_ids = user_ids.filter(user_id => !people.is_my_user_id(user_id));+ user_ids = user_ids.filter((user_id) => !people.is_my_user_id(user_id));let search_terms = user_filter_text.toLowerCase().split(/[|,]+/);- search_terms = search_terms.map(s => s.trim());+ search_terms = search_terms.map((s) => s.trim());- const persons = user_ids.map(user_id => people.get_by_user_id(user_id));+ const persons = user_ids.map((user_id) => people.get_by_user_id(user_id));const user_id_dict = people.filter_people_by_search_terms(persons, search_terms);return Array.from(user_id_dict.keys());@@ -306,7 +306,7 @@ function get_user_id_list(user_filter_text) {user_ids = presence.get_user_ids();}- user_ids = user_ids.filter(user_id => {+ user_ids = user_ids.filter((user_id) => {const person = people.get_by_user_id(user_id);if (!person) {@@ -334,7 +334,7 @@ exports.get_items_for_users = function (user_ids) {};exports.huddle_fraction_present = function (huddle) {- const user_ids = huddle.split(',').map(s => parseInt(s, 10));+ const user_ids = huddle.split(',').map((s) => parseInt(s, 10));let num_present = 0;diff --git a/static/js/color_data.js b/static/js/color_data.jsindex 979a5b0581b..55990f29b5e 100644--- a/static/js/color_data.js+++ b/static/js/color_data.js@@ -33,7 +33,7 @@ exports.claim_color = function (color) {};exports.claim_colors = function (subs) {- const colors = new Set(subs.map(sub => sub.color));+ const colors = new Set(subs.map((sub) => sub.color));colors.forEach(exports.claim_color);};diff --git a/static/js/components.js b/static/js/components.jsindex cc7e6858b2e..3129ed868bf 100644--- a/static/js/components.js+++ b/static/js/components.js@@ -103,7 +103,7 @@ exports.toggle = function (opts) {maybe_go_right: maybe_go_right,disable_tab: function (name) {- const value = opts.values.find(o => o.key === name);+ const value = opts.values.find((o) => o.key === name);const idx = opts.values.indexOf(value);meta.$ind_tab.eq(idx).addClass('disabled');@@ -121,7 +121,7 @@ exports.toggle = function (opts) {// go through the process of finding the correct tab for a given name,// and when found, select that one and provide the proper callback.goto: function (name) {- const value = opts.values.find(o => o.label === name || o.key === name);+ const value = opts.values.find((o) => o.label === name || o.key === name);const idx = opts.values.indexOf(value);diff --git a/static/js/compose.js b/static/js/compose.jsindex 7d9294ec1bc..8cdb82a4135 100644--- a/static/js/compose.js+++ b/static/js/compose.js@@ -423,7 +423,7 @@ exports.get_invalid_recipient_emails = function () {const private_recipients = util.extract_pm_recipients(compose_state.private_message_recipient());const invalid_recipients = private_recipients.filter(- email => !people.is_valid_email_for_compose(email)+ (email) => !people.is_valid_email_for_compose(email));return invalid_recipients;@@ -916,7 +916,7 @@ exports.warn_if_mentioning_unsubscribed_user = function (mentioned) {const error_area = $("#compose_invite_users");const existing_invites_area = $('#compose_invite_users .compose_invite_user');- const existing_invites = Array.from($(existing_invites_area), user_row => {+ const existing_invites = Array.from($(existing_invites_area), (user_row) => {return parseInt($(user_row).data('user-id'), 10);});diff --git a/static/js/compose_ui.js b/static/js/compose_ui.jsindex 7b3d20531c8..89efdc41357 100644--- a/static/js/compose_ui.js+++ b/static/js/compose_ui.js@@ -92,7 +92,7 @@ exports.compute_placeholder_text = function (opts) {// For Private Messagesif (opts.private_message_recipient) {const recipient_list = opts.private_message_recipient.split(",");- const recipient_names = recipient_list.map(recipient => {+ const recipient_names = recipient_list.map((recipient) => {const user = people.get_by_email(recipient);return user.full_name;}).join(", ");diff --git a/static/js/composebox_typeahead.js b/static/js/composebox_typeahead.jsindex 06b3cb24f7a..a99d074e560 100644--- a/static/js/composebox_typeahead.js+++ b/static/js/composebox_typeahead.js@@ -381,7 +381,7 @@ function should_show_custom_query(query, items) {if (!query) {return false;}- const matched = items.some(elem => elem.toLowerCase() === query.toLowerCase());+ const matched = items.some((elem) => elem.toLowerCase() === query.toLowerCase());return !matched;}@@ -590,7 +590,7 @@ exports.get_sorted_filtered_items = function (query) {exports.filter_and_sort_candidates = function (completing, candidates, token) {const matcher = exports.compose_content_matcher(completing, token);- const small_results = candidates.filter(item => matcher(item));+ const small_results = candidates.filter((item) => matcher(item));const sorted_results = exports.sort_results(completing, small_results, token);diff --git a/static/js/drafts.js b/static/js/drafts.jsindex b73a9aee4e1..a58f176393b 100644--- a/static/js/drafts.js+++ b/static/js/drafts.js@@ -245,7 +245,7 @@ exports.format_draft = function (draft) {};} else {const emails = util.extract_pm_recipients(draft.private_message_recipient);- const recipients = emails.map(email => {+ const recipients = emails.map((email) => {email = email.trim();const person = people.get_by_email(email);if (person !== undefined) {diff --git a/static/js/dropdown_list_widget.js b/static/js/dropdown_list_widget.jsindex da5360006eb..ca6ee5df144 100644--- a/static/js/dropdown_list_widget.js+++ b/static/js/dropdown_list_widget.js@@ -30,7 +30,7 @@ const DropdownListWidget = function (opts) {}// Happy path- const item = opts.data.find(x => x.value === value.toString());+ const item = opts.data.find((x) => x.value === value.toString());const text = opts.render_text(item.name);elem.text(text);elem.removeClass('text-warning');diff --git a/static/js/echo.js b/static/js/echo.jsindex aa48e6f801d..6b9ee72c9ec 100644--- a/static/js/echo.js+++ b/static/js/echo.js@@ -52,7 +52,7 @@ exports.build_display_recipient = function (message) {const emails = util.extract_pm_recipients(message.private_message_recipient);let sender_in_display_recipients = false;- const display_recipient = emails.map(email => {+ const display_recipient = emails.map((email) => {email = email.trim();const person = people.get_by_email(email);if (person === undefined) {diff --git a/static/js/emoji_picker.js b/static/js/emoji_picker.jsindex e3b3bd51b1c..a19f370fafc 100644--- a/static/js/emoji_picker.js+++ b/static/js/emoji_picker.js@@ -103,7 +103,7 @@ function show_emoji_catalog() {exports.generate_emoji_picker_data = function (realm_emojis) {const catalog = new Map();- catalog.set("Custom", Array.from(realm_emojis.keys(), realm_emoji_name =>+ catalog.set("Custom", Array.from(realm_emojis.keys(), (realm_emoji_name) =>emoji.emojis_by_name.get(realm_emoji_name)));@@ -133,8 +133,8 @@ exports.generate_emoji_picker_data = function (realm_emojis) {}catalog.set("Popular", popular);- const categories = get_all_emoji_categories().filter(category => catalog.has(category.name));- exports.complete_emoji_catalog = categories.map(category => ({+ const categories = get_all_emoji_categories().filter((category) => catalog.has(category.name));+ exports.complete_emoji_catalog = categories.map((category) => ({name: category.name,icon: category.icon,emojis: catalog.get(category.name),@@ -148,7 +148,7 @@ const generate_emoji_picker_content = function (id) {emojis_used = reactions.get_emojis_used_by_user_for_message_id(id);}for (const emoji_dict of emoji.emojis_by_name.values()) {- emoji_dict.has_reacted = emoji_dict.aliases.some(alias => emojis_used.includes(alias));+ emoji_dict.has_reacted = emoji_dict.aliases.some((alias) => emojis_used.includes(alias));}return render_emoji_popover_content({@@ -212,7 +212,7 @@ function filter_emojis() {for (const emoji_dict of emojis) {for (const alias of emoji_dict.aliases) {- const match = search_terms.every(search_term => alias.includes(search_term));+ const match = search_terms.every((search_term) => alias.includes(search_term));if (match) {search_results.push({ ...emoji_dict, name: alias });break; // We only need the first matching alias per emoji.diff --git a/static/js/fenced_code.js b/static/js/fenced_code.jsindex e70b214f8bf..5ccec589427 100644--- a/static/js/fenced_code.js+++ b/static/js/fenced_code.js@@ -42,7 +42,7 @@ function wrap_quote(text) {// beginning of each linefor (const paragraph of paragraphs) {const lines = paragraph.split('\n');- quoted_paragraphs.push(lines.filter(line => line !== '').map(line => '> ' + line).join('\n'));+ quoted_paragraphs.push(lines.filter((line) => line !== '').map((line) => '> ' + line).join('\n'));}return quoted_paragraphs.join('\n\n');diff --git a/static/js/filter.js b/static/js/filter.jsindex 436a742f276..95c2b4bd897 100644--- a/static/js/filter.js+++ b/static/js/filter.js@@ -323,7 +323,7 @@ Filter.parse = function (str) {might need to support multiple operators of the same type.*/Filter.unparse = function (operators) {- const parts = operators.map(elem => {+ const parts = operators.map((elem) => {if (elem.operator === 'search') {// Search terms are the catch-all case.@@ -357,7 +357,7 @@ Filter.prototype = {public_operators: function () {const safe_to_return = this._operators.filter(// Filter out the embedded narrow (if any).- value =>+ (value) =>!(page_params.narrow_stream !== undefined &&value.operator === "stream" &&@@ -376,18 +376,18 @@ Filter.prototype = {has_negated_operand: function (operator, operand) {return this._operators.some(- elem => elem.negated && (elem.operator === operator && elem.operand === operand)+ (elem) => elem.negated && (elem.operator === operator && elem.operand === operand));},has_operand: function (operator, operand) {return this._operators.some(- elem => !elem.negated && (elem.operator === operator && elem.operand === operand)+ (elem) => !elem.negated && (elem.operator === operator && elem.operand === operand));},has_operator: function (operator) {- return this._operators.some(elem => {+ return this._operators.some((elem) => {if (elem.negated && !['search', 'has'].includes(elem.operator)) {return false;}@@ -591,7 +591,7 @@ Filter.prototype = {return i18n.t('Private messages');case 'pm-with': {const emails = this.operands('pm-with')[0].split(',');- const names = emails.map(email => {+ const names = emails.map((email) => {if (!people.get_by_email(email)) {return email;}@@ -673,15 +673,15 @@ Filter.prototype = {return terms;}- return terms.filter(term => Filter.term_type(term) !== 'is-private');+ return terms.filter((term) => Filter.term_type(term) !== 'is-private');},_canonicalize_operators: function (operators_mixed_case) {- return operators_mixed_case.map(tuple => Filter.canonicalize_term(tuple));+ return operators_mixed_case.map((tuple) => Filter.canonicalize_term(tuple));},filter_with_new_params: function (params) {- const terms = this._operators.map(term => {+ const terms = this._operators.map((term) => {const new_term = { ...term };if (new_term.operator === params.operator && !new_term.negated) {new_term.operand = params.operand;@@ -729,7 +729,7 @@ Filter.prototype = {first_valid_id_from: function (msg_ids) {const predicate = this.predicate();- const first_id = msg_ids.find(msg_id => {+ const first_id = msg_ids.find((msg_id) => {const message = message_store.get(msg_id);if (message === undefined) {@@ -771,7 +771,7 @@ Filter.prototype = {// build JavaScript code in a string and then eval() it.return function (message) {- return operators.every(term => {+ return operators.every((term) => {let ok = message_matches_search_term(message, term.operator, term.operand);if (term.negated) {ok = !ok;@@ -910,7 +910,7 @@ function describe_unescaped(operators) {}}- const more_parts = operators.map(elem => {+ const more_parts = operators.map((elem) => {const operand = elem.operand;const canonicalized_operator = Filter.canonicalize_operator(elem.operator);if (canonicalized_operator === 'is') {diff --git a/static/js/hotspots.js b/static/js/hotspots.jsindex 09a4276cd88..8586a1294ba 100644--- a/static/js/hotspots.js+++ b/static/js/hotspots.js@@ -237,7 +237,7 @@ exports.close_hotspot_icon = function (elem) {function close_read_hotspots(new_hotspots) {const unwanted_hotspots = _.difference(Array.from(HOTSPOT_LOCATIONS.keys()),- new_hotspots.map(hotspot => hotspot.name)+ new_hotspots.map((hotspot) => hotspot.name));for (const hotspot_name of unwanted_hotspots) {diff --git a/static/js/info_overlay.js b/static/js/info_overlay.jsindex e4864899007..b073c5dacab 100644--- a/static/js/info_overlay.js+++ b/static/js/info_overlay.js@@ -22,7 +22,7 @@ exports.set_up_toggler = function () {const elem = exports.toggler.get();elem.addClass('large allow-overflow');- const modals = opts.values.map(item => {+ const modals = opts.values.map((item) => {const key = item.key; // e.g. message-formattingconst modal = $('#' + key).find('.modal-body');return modal;diff --git a/static/js/input_pill.js b/static/js/input_pill.jsindex b5cb93246be..1468187733a 100644--- a/static/js/input_pill.js+++ b/static/js/input_pill.js@@ -219,11 +219,11 @@ exports.create = function (opts) {},getByID: function (id) {- return store.pills.find(pill => pill.id === id);+ return store.pills.find((pill) => pill.id === id);},items: function () {- return store.pills.map(pill => pill.item);+ return store.pills.map((pill) => pill.item);},createPillonPaste: function () {diff --git a/static/js/markdown.js b/static/js/markdown.jsindex b9348ff660f..7b7d9abc5d1 100644--- a/static/js/markdown.js+++ b/static/js/markdown.js@@ -71,12 +71,12 @@ exports.contains_backend_only_syntax = function (content) {// Try to guess whether or not a message contains syntax that only the// backend markdown processor can correctly handle.// If it doesn't, we can immediately render it client-side for local echo.- const markedup = backend_only_markdown_re.find(re => re.test(content));+ const markedup = backend_only_markdown_re.find((re) => re.test(content));// If a realm filter doesn't start with some specified characters// then don't render it locally. It is workaround for the fact that// javascript regex doesn't support lookbehind.- const false_filter_match = realm_filter_list.find(re => {+ const false_filter_match = realm_filter_list.find((re) => {const pattern = /(?:[^\s'"\(,:<])/.source + re[0].source + /(?![\w])/.source;const regex = new RegExp(pattern);return regex.test(content);@@ -455,7 +455,7 @@ exports.initialize = function (realm_filters, helper_config) {// No <code> around our code blocks instead a codehilite <div> and disable// class-specific highlighting.- r.code = code => fenced_code.wrap_code(code) + '\n\n';+ r.code = (code) => fenced_code.wrap_code(code) + '\n\n';// Prohibit empty links for some reason.const old_link = r.link;diff --git a/static/js/message_edit.js b/static/js/message_edit.jsindex 73ced39dc12..c98f1c84372 100644--- a/static/js/message_edit.js+++ b/static/js/message_edit.js@@ -271,7 +271,7 @@ function edit_message(row, raw_content) {const show_edit_stream = message.is_stream && page_params.is_admin;// current message's stream has been already been added and selected in handlebarconst available_streams = show_edit_stream ? stream_data.subscribed_subs()- .filter(s => s.stream_id !== message.stream_id) : null;+ .filter((s) => s.stream_id !== message.stream_id) : null;const form = $(render_message_edit_form({is_stream: message.type === 'stream',@@ -817,13 +817,13 @@ exports.delete_message = function (msg_id) {success: function () {$('#delete_message_modal').modal("hide");currently_deleting_messages = currently_deleting_messages.filter(- id => id !== msg_id+ (id) => id !== msg_id);hide_delete_btn_show_spinner(false);},error: function (xhr) {currently_deleting_messages = currently_deleting_messages.filter(- id => id !== msg_id+ (id) => id !== msg_id);hide_delete_btn_show_spinner(false);ui_report.error(i18n.t("Error deleting message"), xhr,diff --git a/static/js/message_fetch.js b/static/js/message_fetch.jsindex bb426c69e11..344f83d37a4 100644--- a/static/js/message_fetch.js+++ b/static/js/message_fetch.js@@ -131,7 +131,7 @@ function handle_operators_supporting_id_based_api(data) {}data.narrow = JSON.parse(data.narrow);- data.narrow = data.narrow.map(filter => {+ data.narrow = data.narrow.map((filter) => {if (operators_supporting_ids.includes(filter.operator)) {filter.operand = people.emails_strings_to_user_ids_array(filter.operand);}diff --git a/static/js/message_flags.js b/static/js/message_flags.jsindex 4df205fc853..d1fb7bebf11 100644--- a/static/js/message_flags.js+++ b/static/js/message_flags.js@@ -16,8 +16,8 @@ exports.send_read = (function () {let start;function server_request() {// Wait for server IDs before sending flags- const real_msgs = queue.filter(msg => !msg.locally_echoed);- const real_msg_ids = real_msgs.map(msg => msg.id);+ const real_msgs = queue.filter((msg) => !msg.locally_echoed);+ const real_msg_ids = real_msgs.map((msg) => msg.id);if (real_msg_ids.length === 0) {setTimeout(start, 100);@@ -46,7 +46,7 @@ exports.send_read = (function () {return;}- queue = queue.filter(message => !data.messages.includes(message.id));+ queue = queue.filter((message) => !data.messages.includes(message.id));if (queue.length > 0) {start();diff --git a/static/js/message_list_data.js b/static/js/message_list_data.jsindex 9338ba81c5f..6db6af76d52 100644--- a/static/js/message_list_data.js+++ b/static/js/message_list_data.js@@ -43,7 +43,7 @@ MessageListData.prototype = {if (this._selected_id === -1) {return;}- const ids = this._items.map(message => message.id);+ const ids = this._items.map((message) => message.id);const i = ids.indexOf(this._selected_id);if (i === -1) {@@ -158,7 +158,7 @@ MessageListData.prototype = {valid_non_duplicated_messages: function (messages) {const predicate = this._get_predicate();const self = this;- return messages.filter(msg => self.get(msg.id) === undefined && predicate(msg));+ return messages.filter((msg) => self.get(msg.id) === undefined && predicate(msg));},filter_incoming: function (messages) {@@ -168,7 +168,7 @@ MessageListData.prototype = {unmuted_messages: function (messages) {return messages.filter(- message =>+ (message) =>!muting.is_topic_muted(message.stream_id, message.topic) ||message.mentioned);@@ -182,7 +182,7 @@ MessageListData.prototype = {},first_unread_message_id: function () {- const first_unread = this._items.find(message => unread.message_unread(message));+ const first_unread = this._items.find((message) => unread.message_unread(message));if (first_unread) {return first_unread.id;@@ -231,7 +231,7 @@ MessageListData.prototype = {// bottom_messages regardlessif (self.selected_id() === -1 && self.empty()) {const narrow_messages = self.filter_incoming(messages);- bottom_messages = narrow_messages.filter(msg => !self.get(msg.id));+ bottom_messages = narrow_messages.filter((msg) => !self.get(msg.id));} else {// Filter out duplicates that are already in self, and all messages// that fail our filter predicate@@ -342,10 +342,10 @@ MessageListData.prototype = {msg_ids_to_remove.add(message.id);}- this._items = this._items.filter(message => !msg_ids_to_remove.has(message.id));+ this._items = this._items.filter((message) => !msg_ids_to_remove.has(message.id));if (this.muting_enabled) {this._all_items = this._all_items.filter(- message => !msg_ids_to_remove.has(message.id)+ (message) => !msg_ids_to_remove.has(message.id));}},diff --git a/static/js/message_list_view.js b/static/js/message_list_view.jsindex 579436a335f..bd5d0e74142 100644--- a/static/js/message_list_view.js+++ b/static/js/message_list_view.js@@ -562,7 +562,7 @@ MessageListView.prototype = {// all messages lists. To prevent having both list views overwriting// each others data we will make a new message object to add data to// for rendering.- const message_containers = messages.map(message => {+ const message_containers = messages.map((message) => {if (message.starred) {message.starred_status = i18n.t("Unstar");} else {@@ -671,7 +671,7 @@ MessageListView.prototype = {if (message_actions.append_messages.length > 0) {last_message_row = table.find('.message_row').last().expectOne();last_group_row = rows.get_message_recipient_row(last_message_row);- dom_messages = $(message_actions.append_messages.map(message_container => self._get_message_template(message_container)).join('')).filter('.message_row');+ dom_messages = $(message_actions.append_messages.map((message_container) => self._get_message_template(message_container)).join('')).filter('.message_row');self._post_process(dom_messages);last_group_row.append(dom_messages);@@ -1026,7 +1026,7 @@ MessageListView.prototype = {// Since we don't have a way to get a message group from// the containing message container, we just do a search// to find it.- message_group => message_group.message_group_id === message_group_id+ (message_group) => message_group.message_group_id === message_group_id);},@@ -1097,10 +1097,10 @@ MessageListView.prototype = {const self = this;// Convert messages to list messages- let message_containers = messages.map(message => self.message_containers.get(message.id));+ let message_containers = messages.map((message) => self.message_containers.get(message.id));// We may not have the message_container if the stream or topic was mutedmessage_containers = message_containers.filter(- message_container => message_container !== undefined+ (message_container) => message_container !== undefined);const message_groups = [];diff --git a/static/js/message_util.js b/static/js/message_util.jsindex dca374b1e37..19120c06a60 100644--- a/static/js/message_util.js+++ b/static/js/message_util.js@@ -49,7 +49,7 @@ exports.get_messages_in_topic = function (stream_id, topic) {// all the messages. Please only use it in case of// very rare events like topic edits. Its primary// use case is the new experimental Recent Topics UI.- return message_list.all.all_messages().filter(x => {+ return message_list.all.all_messages().filter((x) => {return x.type === 'stream' &&x.stream_id === stream_id &&x.topic.toLowerCase() === topic.toLowerCase();diff --git a/static/js/narrow.js b/static/js/narrow.jsindex e1c6d13aa68..e39567ce7fe 100644--- a/static/js/narrow.js+++ b/static/js/narrow.js@@ -151,7 +151,7 @@ exports.activate = function (raw_operators, opts) {message_scroll.hide_top_of_narrow_notices();message_scroll.hide_indicators();- blueslip.debug("Narrowed", {operators: operators.map(e => e.operator),+ blueslip.debug("Narrowed", {operators: operators.map((e) => e.operator),trigger: opts ? opts.trigger : undefined,previous_id: current_msg_list.selected_id()});@@ -725,7 +725,7 @@ exports.to_compose_target = function () {if (compose_state.get_message_type() === 'private') {const recipient_string = compose_state.private_message_recipient();const emails = util.extract_pm_recipients(recipient_string);- const invalid = emails.filter(email => !people.is_valid_email_for_compose(email));+ const invalid = emails.filter((email) => !people.is_valid_email_for_compose(email));// If there are no recipients or any recipient is// invalid, narrow to all PMs.if (emails.length === 0 || invalid.length > 0) {diff --git a/static/js/people.js b/static/js/people.jsindex 93791f6848a..f8574fe5511 100644--- a/static/js/people.js+++ b/static/js/people.js@@ -41,7 +41,7 @@ exports.init = function () {exports.init();function split_to_ints(lst) {- return lst.split(',').map(s => parseInt(s, 10));+ return lst.split(',').map((s) => parseInt(s, 10));}@@ -151,7 +151,7 @@ exports.huddle_string = function (message) {return;}- let user_ids = message.display_recipient.map(recip => recip.id);+ let user_ids = message.display_recipient.map((recip) => recip.id);function is_huddle_recip(user_id) {return user_id &&@@ -173,7 +173,7 @@ exports.huddle_string = function (message) {exports.user_ids_string_to_emails_string = function (user_ids_string) {const user_ids = split_to_ints(user_ids_string);- let emails = user_ids.map(user_id => {+ let emails = user_ids.map((user_id) => {const person = people_by_user_id_dict.get(user_id);return person && person.email;});@@ -183,7 +183,7 @@ exports.user_ids_string_to_emails_string = function (user_ids_string) {return;}- emails = emails.map(email => email.toLowerCase());+ emails = emails.map((email) => email.toLowerCase());emails.sort();@@ -192,7 +192,7 @@ exports.user_ids_string_to_emails_string = function (user_ids_string) {exports.user_ids_string_to_ids_array = function (user_ids_string) {const user_ids = user_ids_string.split(',');- const ids = user_ids.map(id => Number(id));+ const ids = user_ids.map((id) => Number(id));return ids;};@@ -212,7 +212,7 @@ exports.reply_to_to_user_ids_string = function (emails_string) {// invalid data.const emails = emails_string.split(',');- let user_ids = emails.map(email => {+ let user_ids = emails.map((email) => {const person = exports.get_by_email(email);return person && person.user_id;});@@ -261,7 +261,7 @@ exports.emails_strings_to_user_ids_string = function (emails_string) {};exports.email_list_to_user_ids_string = function (emails) {- let user_ids = emails.map(email => {+ let user_ids = emails.map((email) => {const person = exports.get_by_email(email);return person && person.user_id;});@@ -277,7 +277,7 @@ exports.email_list_to_user_ids_string = function (emails) {};exports.safe_full_names = function (user_ids) {- let names = user_ids.map(user_id => {+ let names = user_ids.map((user_id) => {const person = people_by_user_id_dict.get(user_id);return person && person.full_name;});@@ -295,7 +295,7 @@ exports.get_recipients = function (user_ids_string) {// See message_store.get_pm_full_names() for a similar function.const user_ids = split_to_ints(user_ids_string);- const other_ids = user_ids.filter(user_id => !exports.is_my_user_id(user_id));+ const other_ids = user_ids.filter((user_id) => !exports.is_my_user_id(user_id));if (other_ids.length === 0) {// private message with oneself@@ -323,7 +323,7 @@ exports.pm_reply_to = function (message) {return;}- const emails = user_ids.map(user_id => {+ const emails = user_ids.map((user_id) => {const person = people_by_user_id_dict.get(user_id);if (!person) {blueslip.error('Unknown user id in message: ' + user_id);@@ -343,7 +343,7 @@ function sorted_other_user_ids(user_ids) {// This excludes your own user id unless you're the only user// (i.e. you sent a message to yourself).- const other_user_ids = user_ids.filter(user_id => !exports.is_my_user_id(user_id));+ const other_user_ids = user_ids.filter((user_id) => !exports.is_my_user_id(user_id));if (other_user_ids.length >= 1) {user_ids = other_user_ids;@@ -389,7 +389,7 @@ exports.all_user_ids_in_pm = function (message) {return;}- let user_ids = message.display_recipient.map(recip => recip.id);+ let user_ids = message.display_recipient.map((recip) => recip.id);user_ids = sort_numerically(user_ids);return user_ids;@@ -405,7 +405,7 @@ exports.pm_with_user_ids = function (message) {return;}- const user_ids = message.display_recipient.map(recip => recip.id);+ const user_ids = message.display_recipient.map((recip) => recip.id);return sorted_other_user_ids(user_ids);};@@ -420,8 +420,8 @@ exports.group_pm_with_user_ids = function (message) {return;}- const user_ids = message.display_recipient.map(recip => recip.id);- const is_user_present = user_ids.some(user_id => exports.is_my_user_id(user_id));+ const user_ids = message.display_recipient.map((recip) => recip.id);+ const is_user_present = user_ids.some((user_id) => exports.is_my_user_id(user_id));if (is_user_present) {user_ids.sort();if (user_ids.length > 2) {@@ -483,19 +483,19 @@ exports.update_email_in_reply_to = function (reply_to, user_id, new_email) {// and we don't warn on any errors.let emails = reply_to.split(',');- const persons = emails.map(email => people_dict.get(email.trim()));+ const persons = emails.map((email) => people_dict.get(email.trim()));if (!persons.every(Boolean)) {return reply_to;}- const needs_patch = persons.some(person => person.user_id === user_id);+ const needs_patch = persons.some((person) => person.user_id === user_id);if (!needs_patch) {return reply_to;}- emails = persons.map(person => {+ emails = persons.map((person) => {if (person.user_id === user_id) {return new_email;}@@ -507,8 +507,8 @@ exports.update_email_in_reply_to = function (reply_to, user_id, new_email) {exports.pm_with_operand_ids = function (operand) {let emails = operand.split(',');- emails = emails.map(email => email.trim());- let persons = emails.map(email => people_dict.get(email));+ emails = emails.map((email) => email.trim());+ let persons = emails.map((email) => people_dict.get(email));// If your email is included in a PM group with other people, just ignore itif (persons.length > 1) {@@ -519,7 +519,7 @@ exports.pm_with_operand_ids = function (operand) {return;}- let user_ids = persons.map(person => person.user_id);+ let user_ids = persons.map((person) => person.user_id);user_ids = sort_numerically(user_ids);@@ -579,7 +579,7 @@ exports.exclude_me_from_string = function (user_ids_string) {return user_ids.join(',');}- user_ids = user_ids.filter(user_id => !exports.is_my_user_id(user_id));+ user_ids = user_ids.filter((user_id) => !exports.is_my_user_id(user_id));return user_ids.join(',');};@@ -700,7 +700,7 @@ exports.is_valid_email_for_compose = function (email) {exports.is_valid_bulk_emails_for_compose = function (emails) {// Returns false if at least one of the emails is invalid.- return emails.every(email => {+ return emails.every((email) => {if (!exports.is_valid_email_for_compose(email)) {return false;}@@ -851,7 +851,7 @@ exports.get_message_people = function () {semantics*/const message_people = message_store.user_ids().map(- user_id => people_by_user_id_dict.get(user_id)+ (user_id) => people_by_user_id_dict.get(user_id)).filter(Boolean);return message_people;@@ -892,7 +892,7 @@ exports.build_termlet_matcher = function (termlet) {}const names = full_name.toLowerCase().split(' ');- return names.some(name => name.startsWith(termlet));+ return names.some((name) => name.startsWith(termlet));};};@@ -909,7 +909,7 @@ exports.build_person_matcher = function (query) {return true;}- return termlet_matchers.every(matcher => matcher(user));+ return termlet_matchers.every((matcher) => matcher(user));};};@@ -918,7 +918,7 @@ exports.filter_people_by_search_terms = function (users, search_terms) {// Build our matchers outside the loop to avoid some// search overhead that is not user-specific.- const matchers = search_terms.map(search_term => exports.build_person_matcher(search_term));+ const matchers = search_terms.map((search_term) => exports.build_person_matcher(search_term));// Loop through users and populate filtered_users only// if they include search_terms@@ -930,7 +930,7 @@ exports.filter_people_by_search_terms = function (users, search_terms) {}// Return user emails that include search terms- const match = matchers.some(matcher => matcher(user));+ const match = matchers.some((matcher) => matcher(user));if (match) {filtered_users.set(person.user_id, true);@@ -1198,7 +1198,7 @@ exports.filter_for_user_settings_search = function (persons, query) {See #13554 for more context.*/- return persons.filter(person => exports.matches_user_settings_search(person, query));+ return persons.filter((person) => exports.matches_user_settings_search(person, query));};exports.maybe_incr_recipient_count = function (message) {diff --git a/static/js/pm_conversations.js b/static/js/pm_conversations.jsindex 8043d30f542..d29ee97f2c5 100644--- a/static/js/pm_conversations.js+++ b/static/js/pm_conversations.js@@ -67,7 +67,7 @@ exports.recent = (function () {self.get_strings = function () {// returns array of structs with user_ids_string and// message_id- return recent_private_messages.map(conversation => conversation.user_ids_string);+ return recent_private_messages.map((conversation) => conversation.user_ids_string);};self.initialize = function (params) {diff --git a/static/js/poll_widget.js b/static/js/poll_widget.jsindex 689d40925b2..1f29b9b6745 100644--- a/static/js/poll_widget.js+++ b/static/js/poll_widget.js@@ -162,7 +162,7 @@ exports.poll_data_holder = function (is_my_poll, question, options) {// function to check whether option already existsself.is_option_present = function (data, latest_option) {- return data.some(el => el.option === latest_option);+ return data.some((el) => el.option === latest_option);};// function to add all options added along with the /poll commanddiff --git a/static/js/popovers.js b/static/js/popovers.jsindex 945fc34324d..eedb7421075 100644--- a/static/js/popovers.js+++ b/static/js/popovers.js@@ -447,7 +447,7 @@ exports.toggle_actions_popover = function (element, id) {const should_display_edit_history_option =message.edit_history &&- message.edit_history.some(entry => entry.prev_content !== undefined ||+ message.edit_history.some((entry) => entry.prev_content !== undefined ||util.get_edit_event_prev_topic(entry) !== undefined) &&page_params.realm_allow_edit_history;diff --git a/static/js/reactions.js b/static/js/reactions.jsindex 3c6b90a5da0..312dc142f63 100644--- a/static/js/reactions.js+++ b/static/js/reactions.js@@ -347,7 +347,7 @@ exports.remove_reaction = function (event) {return;}- r.user_ids = r.user_ids.filter(id => id !== user_id);+ r.user_ids = r.user_ids.filter((id) => id !== user_id);if (r.user_ids.length > 0) {exports.update_user_fields(r);} else {diff --git a/static/js/recent_topics.js b/static/js/recent_topics.jsindex 819942ca987..1c275d06329 100644--- a/static/js/recent_topics.js+++ b/static/js/recent_topics.js@@ -224,7 +224,7 @@ exports.topic_in_search_results = function (keyword, stream, topic) {keyword = keyword.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');const text = (stream + ' ' + topic).toLowerCase().replace(/\s+/g, ' ');const search_words = keyword.toLowerCase().replace(/\s+/g, ' ').split(' ');- return search_words.every(word => {+ return search_words.every((word) => {if (text.search(word) !== -1) {return true;}diff --git a/static/js/reminder.js b/static/js/reminder.jsindex f4361e1ae81..a5ba1040acc 100644--- a/static/js/reminder.js+++ b/static/js/reminder.js@@ -46,7 +46,7 @@ exports.schedule_message = function (request) {const message = raw_message.slice(1).join('\n');const deferred_message_type = deferred_message_types.filter(- props => command_line.match(props.test) !== null+ (props) => command_line.match(props.test) !== null)[0];const command = command_line.match(deferred_message_type.test)[0];diff --git a/static/js/search_pill.js b/static/js/search_pill.jsindex 4cbc06e011b..69e059e7074 100644--- a/static/js/search_pill.js+++ b/static/js/search_pill.js@@ -33,7 +33,7 @@ exports.append_search_string = function (search_string, pill_widget) {exports.get_search_string_for_current_filter = function (pill_widget) {const items = pill_widget.items();- const search_strings = items.map(item => item.display_value);+ const search_strings = items.map((item) => item.display_value);return search_strings.join(' ');};diff --git a/static/js/search_suggestion.js b/static/js/search_suggestion.jsindex 17ef14cde6d..c74ac1e6c2d 100644--- a/static/js/search_suggestion.js+++ b/static/js/search_suggestion.js@@ -20,7 +20,7 @@ function make_person_highlighter(query) {function match_criteria(operators, criteria) {const filter = new Filter(operators);- return criteria.some(cr => {+ return criteria.some((cr) => {if (Object.prototype.hasOwnProperty.call(cr, 'operand')) {return filter.has_operand(cr.operator, cr.operand);}@@ -48,7 +48,7 @@ function format_as_suggestion(terms) {}function compare_by_huddle(huddle) {- huddle = huddle.slice(0, -1).map(person => {+ huddle = huddle.slice(0, -1).map((person) => {person = people.get_by_email(person);return person && person.user_id;});@@ -91,14 +91,14 @@ function get_stream_suggestions(last, operators) {const query = last.operand;let streams = stream_data.subscribed_streams();- streams = streams.filter(stream => stream_matches_query(stream, query));+ streams = streams.filter((stream) => stream_matches_query(stream, query));streams = typeahead_helper.sorter(query, streams);const regex = typeahead_helper.build_highlight_regex(query);const hilite = typeahead_helper.highlight_with_escaping_and_regex;- const objs = streams.map(stream => {+ const objs = streams.map((stream) => {const prefix = 'stream';const highlighted_stream = hilite(regex, stream);const verb = last.negated ? 'exclude ' : '';@@ -159,7 +159,7 @@ function get_group_suggestions(last, operators) {const highlight_person = make_person_highlighter(last_part);- const suggestions = persons.map(person => {+ const suggestions = persons.map((person) => {const term = {operator: 'pm-with',operand: all_but_last_part + ',' + person.email,@@ -239,7 +239,7 @@ function get_person_suggestions(people_getter, last, operators, autocomplete_opeconst highlight_person = make_person_highlighter(query);- const objs = persons.map(person => {+ const objs = persons.map((person) => {const name = highlight_person(person);const description = prefix + ' ' + name;const terms = [{@@ -340,7 +340,7 @@ function get_topic_suggestions(last, operators) {topics = topics.slice(0, 300);if (guess !== '') {- topics = topics.filter(topic => common.phrase_match(guess, topic));+ topics = topics.filter((topic) => common.phrase_match(guess, topic));}topics = topics.slice(0, 10);@@ -351,7 +351,7 @@ function get_topic_suggestions(last, operators) {// care about case.topics.sort();- return topics.map(topic => {+ return topics.map((topic) => {const topic_term = {operator: 'topic', operand: topic, negated: negated};const operators = suggest_operators.concat([topic_term]);return format_as_suggestion(operators);@@ -382,7 +382,7 @@ function get_special_filter_suggestions(last, operators, suggestions) {// Negating suggestions on is_search_operand_negated is required for// suggesting negated operators.if (last.negated || is_search_operand_negated) {- suggestions = suggestions.map(suggestion => ({+ suggestions = suggestions.map((suggestion) => ({search_string: '-' + suggestion.search_string,description: 'exclude ' + suggestion.description,invalid: suggestion.invalid,@@ -390,7 +390,7 @@ function get_special_filter_suggestions(last, operators, suggestions) {}const last_string = Filter.unparse([last]).toLowerCase();- suggestions = suggestions.filter(s => {+ suggestions = suggestions.filter((s) => {if (match_criteria(operators, s.invalid)) {return false;}@@ -565,9 +565,9 @@ function get_operator_suggestions(last) {}let choices = ['stream', 'topic', 'pm-with', 'sender', 'near', 'from', 'group-pm-with'];- choices = choices.filter(choice => common.phrase_match(last_operand, choice));+ choices = choices.filter((choice) => common.phrase_match(last_operand, choice));- return choices.map(choice => {+ return choices.map((choice) => {const op = [{operator: choice, operand: '', negated: negated}];return format_as_suggestion(op);});@@ -743,7 +743,7 @@ exports.finalize_search_result = function (result) {lookup_table.set(obj.search_string, obj);}- const strings = result.map(obj => obj.search_string);+ const strings = result.map((obj) => obj.search_string);return {strings: strings,lookup_table: lookup_table,diff --git a/static/js/search_util.js b/static/js/search_util.jsindex 89e6661fce8..721d7040124 100644--- a/static/js/search_util.js+++ b/static/js/search_util.js@@ -17,7 +17,7 @@ exports.vanilla_match = function (opts) {This is case insensitive.*/const val = opts.val.toLowerCase();- return opts.search_terms.some(term => val.includes(term));+ return opts.search_terms.some((term) => val.includes(term));};window.search_util = exports;diff --git a/static/js/server_events.js b/static/js/server_events.jsindex a62598960a8..6e2b7555d87 100644--- a/static/js/server_events.js+++ b/static/js/server_events.js@@ -99,7 +99,7 @@ function get_events_success(events) {if (messages.length > 0) {messages.forEach(message_store.set_message_booleans);- const sent_by_this_client = messages.some(msg =>+ const sent_by_this_client = messages.some((msg) =>sent_messages.messages.has(msg.local_id));// If some message in this batch of events was sent by thisdiff --git a/static/js/settings_bots.js b/static/js/settings_bots.jsindex 4ca9cf9dab0..6696732f0b6 100644--- a/static/js/settings_bots.js+++ b/static/js/settings_bots.js@@ -64,7 +64,7 @@ function is_local_part(value, element) {}exports.type_id_to_string = function (type_id) {- return page_params.bot_types.find(bot_type => bot_type.type_id === type_id).name;+ return page_params.bot_types.find((bot_type) => bot_type.type_id === type_id).name;};exports.render_bots = function () {@@ -392,7 +392,7 @@ exports.set_up = function () {const bot_id = parseInt(li.find('.bot_info').attr('data-user-id'), 10);const bot = bot_data.get(bot_id);const user_ids = people.get_active_human_ids();- const users_list = user_ids.map(user_id => ({+ const users_list = user_ids.map((user_id) => ({name: people.get_full_name(user_id),value: user_id.toString(),}));diff --git a/static/js/settings_config.js b/static/js/settings_config.jsindex 92dbb1a575b..daee61a0eb3 100644--- a/static/js/settings_config.js+++ b/static/js/settings_config.js@@ -192,7 +192,7 @@ exports.user_role_values = {};const user_role_array = Object.values(exports.user_role_values);-exports.user_role_map = new Map(user_role_array.map(role => [role.code, role.description]));+exports.user_role_map = new Map(user_role_array.map((role) => [role.code, role.description]));// NOTIFICATIONSdiff --git a/static/js/settings_org.js b/static/js/settings_org.jsindex 92d42bbb77b..122aac19173 100644--- a/static/js/settings_org.js+++ b/static/js/settings_org.js@@ -43,7 +43,7 @@ exports.maybe_disable_widgets = function () {};exports.get_sorted_options_list = function (option_values_object) {- const options_list = Object.keys(option_values_object).map(key => ({+ const options_list = Object.keys(option_values_object).map((key) => ({...option_values_object[key],key: key,}));@@ -264,7 +264,7 @@ exports.populate_realm_domains = function (realm_domains) {}const domains_list = realm_domains.map(- realm_domain => realm_domain.allow_subdomains ? "*." + realm_domain.domain : realm_domain.domain+ (realm_domain) => realm_domain.allow_subdomains ? "*." + realm_domain.domain : realm_domain.domain);let domains = domains_list.join(', ');if (domains.length === 0) {@@ -547,7 +547,7 @@ exports.signup_notifications_stream_widget = null;exports.init_dropdown_widgets = () => {const streams = stream_data.get_streams_for_settings_page();const notification_stream_options = {- data: streams.map(x => {+ data: streams.map((x) => {const item = {name: x.name,value: x.stream_id.toString(),@@ -575,7 +575,7 @@ exports.init_dropdown_widgets = () => {notification_stream_options));exports.default_code_language_widget = dropdown_list_widget({widget_name: 'realm_default_code_block_language',- data: Object.keys(pygments_data.langs).map(x => {+ data: Object.keys(pygments_data.langs).map((x) => {return {name: x,value: x,diff --git a/static/js/settings_user_groups.js b/static/js/settings_user_groups.jsindex 0d1e7207bc7..d5575e1a50d 100644--- a/static/js/settings_user_groups.js+++ b/static/js/settings_user_groups.js@@ -198,7 +198,7 @@ exports.populate_user_groups = function () {except_class);if ($(event.relatedTarget).closest('#user-groups #' + data.id).length) {return blur_exceptions.some(- class_name => $(event.relatedTarget).closest(class_name).length+ (class_name) => $(event.relatedTarget).closest(class_name).length);}return false;diff --git a/static/js/settings_users.js b/static/js/settings_users.jsindex 0ce894ec445..51e3bf8dc94 100644--- a/static/js/settings_users.js+++ b/static/js/settings_users.js@@ -458,7 +458,7 @@ function open_bot_form(person) {const owner_id = bot_data.get(person.user_id).owner_id;const user_ids = people.get_active_human_ids();- const users_list = user_ids.map(user_id => ({+ const users_list = user_ids.map((user_id) => ({name: people.get_full_name(user_id),value: user_id.toString(),}));diff --git a/static/js/stream_create.js b/static/js/stream_create.jsindex 2fe05ecca73..e75ad7db803 100644--- a/static/js/stream_create.js+++ b/static/js/stream_create.js@@ -126,7 +126,7 @@ function update_announce_stream_state() {}function get_principals() {- return Array.from($("#stream_creation_form input:checkbox[name=user]:checked"), elem => {+ return Array.from($("#stream_creation_form input:checkbox[name=user]:checked"), (elem) => {const label = $(elem).closest(".add-user-label");return parseInt(label.attr("data-user-id"), 10);});diff --git a/static/js/stream_data.js b/static/js/stream_data.jsindex 7e6629aa866..7563bbf180e 100644--- a/static/js/stream_data.js+++ b/static/js/stream_data.js@@ -167,7 +167,7 @@ exports.is_subscriber_subset = function (sub1, sub2) {if (sub1.subscribers && sub2.subscribers) {const sub2_set = sub2.subscribers;- return Array.from(sub1.subscribers.keys()).every(key => sub2_set.has(key));+ return Array.from(sub1.subscribers.keys()).every((key) => sub2_set.has(key));}return false;@@ -319,9 +319,10 @@ exports.delete_sub = function (stream_id) {exports.get_non_default_stream_names = function () {let subs = Array.from(stream_info.values());subs = subs.filter(- sub => !exports.is_default_stream_id(sub.stream_id) && (sub.subscribed || !sub.invite_only)+ (sub) =>+ !exports.is_default_stream_id(sub.stream_id) && (sub.subscribed || !sub.invite_only));- const names = subs.map(sub => sub.name);+ const names = subs.map((sub) => sub.name);return names;};@@ -342,7 +343,7 @@ exports.get_updated_unsorted_subs = function () {// We don't display unsubscribed streams to guest users.if (page_params.is_guest) {- all_subs = all_subs.filter(sub => sub.subscribed);+ all_subs = all_subs.filter((sub) => sub.subscribed);}return all_subs;@@ -361,7 +362,7 @@ exports.unsubscribed_subs = function () {};exports.subscribed_streams = function () {- return exports.subscribed_subs().map(sub => sub.name);+ return exports.subscribed_subs().map((sub) => sub.name);};exports.get_invite_stream_data = function () {@@ -393,7 +394,7 @@ exports.get_invite_stream_data = function () {};exports.get_colors = function () {- return exports.subscribed_subs().map(sub => sub.color);+ return exports.subscribed_subs().map((sub) => sub.color);};exports.update_subscribers_count = function (sub) {@@ -510,12 +511,12 @@ exports.update_calculated_fields = function (sub) {};exports.all_subscribed_streams_are_in_home_view = function () {- return exports.subscribed_subs().every(sub => !sub.is_muted);+ return exports.subscribed_subs().every((sub) => !sub.is_muted);};exports.home_view_stream_names = function () {- const home_view_subs = exports.subscribed_subs().filter(sub => !sub.is_muted);- return home_view_subs.map(sub => sub.name);+ const home_view_subs = exports.subscribed_subs().filter((sub) => !sub.is_muted);+ return home_view_subs.map((sub) => sub.name);};exports.canonicalized_name = function (stream_name) {diff --git a/static/js/stream_popover.js b/static/js/stream_popover.jsindex ef8746a70e3..c96a531623b 100644--- a/static/js/stream_popover.js+++ b/static/js/stream_popover.js@@ -273,7 +273,7 @@ function build_move_topic_to_stream_popover(e, current_stream_id, topic_name) {// likely will make it possible to move messages to/from private// streams in the future.const available_streams = stream_data.subscribed_subs()- .filter(s => s.stream_id !== current_stream_id);+ .filter((s) => s.stream_id !== current_stream_id);const current_stream_name = stream_data.maybe_get_stream_name(current_stream_id);const args = {available_streams, topic_name, current_stream_id, current_stream_name,diff --git a/static/js/stream_sort.js b/static/js/stream_sort.jsindex d25e6fdf418..95983c9d2ce 100644--- a/static/js/stream_sort.js+++ b/static/js/stream_sort.js@@ -16,13 +16,13 @@ function filter_streams_by_search(streams, search_term) {}let search_terms = search_term.toLowerCase().split(",");- search_terms = search_terms.map(s => s.trim());+ search_terms = search_terms.map((s) => s.trim());- const filtered_streams = streams.filter(stream => search_terms.some(search_term => {+ const filtered_streams = streams.filter((stream) => search_terms.some((search_term) => {const lower_stream_name = stream.toLowerCase();const cands = lower_stream_name.split(" ");cands.push(lower_stream_name);- return cands.some(name => name.startsWith(search_term));+ return cands.some((name) => name.startsWith(search_term));}));return filtered_streams;diff --git a/static/js/stream_topic_history.js b/static/js/stream_topic_history.jsindex 31223b725e2..9432924a43c 100644--- a/static/js/stream_topic_history.js+++ b/static/js/stream_topic_history.js@@ -184,7 +184,7 @@ exports.per_stream_history = function (stream_id) {return b.message_id - a.message_id;});- const names = recents.map(obj => obj.pretty_name);+ const names = recents.map((obj) => obj.pretty_name);return names;};diff --git a/static/js/submessage.js b/static/js/submessage.jsindex df6eed6f3c9..a6be77336bd 100644--- a/static/js/submessage.js+++ b/static/js/submessage.js@@ -15,7 +15,7 @@ exports.get_message_events = function (message) {return parseInt(m1.id, 10) - parseInt(m2.id, 10);});- const events = message.submessages.map(obj => ({+ const events = message.submessages.map((obj) => ({sender_id: obj.sender_id,data: JSON.parse(obj.content),}));@@ -90,7 +90,7 @@ exports.update_message = function (submsg) {message.submessages = [];}- const existing = message.submessages.find(sm => sm.id === submsg.id);+ const existing = message.submessages.find((sm) => sm.id === submsg.id);if (existing !== undefined) {blueslip.warn("Got submessage multiple times: " + submsg.id);diff --git a/static/js/templates.js b/static/js/templates.jsindex 060c975fe2b..8622030bbdd 100644--- a/static/js/templates.js+++ b/static/js/templates.js@@ -85,13 +85,13 @@ Handlebars.registerHelper('tr', function (context, options) {// 1. `context` is very important. It can be `this` or an// object or key of the current context.// 2. Use `__` instead of `{{` and `}}` to declare expressions- const result = i18n.t(options.fn(context).trim().split("\n").map(s => s.trim()).join(" "), context);+ const result = i18n.t(options.fn(context).trim().split("\n").map((s) => s.trim()).join(" "), context);return new Handlebars.SafeString(result);});Handlebars.registerHelper("rendered_markdown",- content => new Handlebars.SafeString(util.clean_user_content_links(content))+ (content) => new Handlebars.SafeString(util.clean_user_content_links(content)));window.templates = exports;diff --git a/static/js/topic_generator.js b/static/js/topic_generator.jsindex ddd506b5638..f6102166e40 100644--- a/static/js/topic_generator.js+++ b/static/js/topic_generator.js@@ -193,7 +193,7 @@ exports.next_topic = function (streams, get_topics, has_unread_messages, curr_stexports.get_next_topic = function (curr_stream, curr_topic) {let my_streams = stream_sort.get_streams();- my_streams = my_streams.filter(stream_name => {+ my_streams = my_streams.filter((stream_name) => {if (!stream_data.is_stream_muted_by_name(stream_name)) {return true;}@@ -208,7 +208,7 @@ exports.get_next_topic = function (curr_stream, curr_topic) {function get_unmuted_topics(stream_name) {const stream_id = stream_data.get_stream_id(stream_name);let topics = stream_topic_history.get_recent_topic_names(stream_id);- topics = topics.filter(topic => !muting.is_topic_muted(stream_id, topic));+ topics = topics.filter((topic) => !muting.is_topic_muted(stream_id, topic));return topics;}diff --git a/static/js/typeahead_helper.js b/static/js/typeahead_helper.jsindex 74cb7a0c8e0..1ce2089d492 100644--- a/static/js/typeahead_helper.js+++ b/static/js/typeahead_helper.js@@ -8,7 +8,7 @@ const settings_data = require("./settings_data");// For example, "a,,b, " => ["a", "b"]exports.get_cleaned_pm_recipients = function (query_string) {let recipients = util.extract_pm_recipients(query_string);- recipients = recipients.filter(elem => elem.match(/\S/));+ recipients = recipients.filter((elem) => elem.match(/\S/));return recipients;};diff --git a/static/js/typing_data.js b/static/js/typing_data.jsindex 679b710a361..6834c77e0f8 100644--- a/static/js/typing_data.js+++ b/static/js/typing_data.js@@ -32,7 +32,7 @@ exports.remove_typist = function (group, typist) {return false;}- current = current.filter(user_id => to_int(user_id) !== to_int(typist));+ current = current.filter((user_id) => to_int(user_id) !== to_int(typist));typist_dct.set(key, current);return true;diff --git a/static/js/ui_init.js b/static/js/ui_init.jsindex ac978144115..6b6ddf66819 100644--- a/static/js/ui_init.js+++ b/static/js/ui_init.js@@ -223,7 +223,7 @@ exports.initialize_kitchen_sink_stuff = function () {render_end: event.msg_list.view._render_win_end,selected_id_from_idx: messages[event.msg_list.selected_idx()].id,msg_list_sorted: _.isEqual(- messages.map(message => message.id),+ messages.map((message) => message.id),_.chain(current_msg_list.all_messages()).pluck('id').clone().value().sort()),found_in_dom: row_from_dom.length,diff --git a/static/js/unread.js b/static/js/unread.jsindex 94095185f0a..dfeb9df0bf7 100644--- a/static/js/unread.js+++ b/static/js/unread.js@@ -273,9 +273,9 @@ exports.unread_topic_counter = (function () {let topic_names = Array.from(per_stream_bucketer.keys());- topic_names = topic_names.filter(topic_name => !topic_dict.has(topic_name));+ topic_names = topic_names.filter((topic_name) => !topic_dict.has(topic_name));- const result = topic_names.map(topic_name => {+ const result = topic_names.map((topic_name) => {const msgs = per_stream_bucketer.get_bucket(topic_name);return {@@ -384,11 +384,11 @@ exports.message_unread = function (message) {};exports.get_unread_message_ids = function (message_ids) {- return message_ids.filter(message_id => unread_messages.has(message_id));+ return message_ids.filter((message_id) => unread_messages.has(message_id));};exports.get_unread_messages = function (messages) {- return messages.filter(message => unread_messages.has(message.id));+ return messages.filter((message) => unread_messages.has(message.id));};exports.update_unread_topics = function (msg, event) {diff --git a/static/js/upload.js b/static/js/upload.jsindex 8e9830e0206..8ac948acf1e 100644--- a/static/js/upload.js+++ b/static/js/upload.js@@ -221,7 +221,7 @@ exports.setup_upload = function (config) {uppy.on('complete', () => {let uploads_in_progress = false;- uppy.getFiles().forEach(file => {+ uppy.getFiles().forEach((file) => {if (file.progress.uploadComplete) {// The uploaded files should be removed since uppy don't allow files in the store// to be re-uploaded again.diff --git a/static/js/user_pill.js b/static/js/user_pill.jsindex 34357914a0d..26943d1725e 100644--- a/static/js/user_pill.js+++ b/static/js/user_pill.js@@ -8,7 +8,7 @@ exports.create_item_from_email = function (email, current_items) {if (!user) {if (page_params.realm_is_zephyr_mirror_realm) {- const existing_emails = current_items.map(item => item.email);+ const existing_emails = current_items.map((item) => item.email);if (existing_emails.includes(email)) {return;@@ -27,7 +27,7 @@ exports.create_item_from_email = function (email, current_items) {return;}- const existing_ids = current_items.map(item => item.user_id);+ const existing_ids = current_items.map((item) => item.user_id);if (existing_ids.includes(user.user_id)) {return;@@ -67,7 +67,7 @@ exports.append_person = function (opts) {exports.get_user_ids = function (pill_widget) {const items = pill_widget.items();- let user_ids = items.map(item => item.user_id);+ let user_ids = items.map((item) => item.user_id);user_ids = user_ids.filter(Boolean); // be defensive about undefined usersreturn user_ids;@@ -81,7 +81,7 @@ exports.has_unconverted_data = function (pill_widget) {}const items = pill_widget.items();- const has_unknown_items = items.some(item => item.user_id === undefined);+ const has_unknown_items = items.some((item) => item.user_id === undefined);return has_unknown_items;};@@ -93,7 +93,7 @@ exports.typeahead_source = function (pill_widget) {exports.filter_taken_users = function (items, pill_widget) {const taken_user_ids = exports.get_user_ids(pill_widget);- items = items.filter(item => !taken_user_ids.includes(item.user_id));+ items = items.filter((item) => !taken_user_ids.includes(item.user_id));return items;};diff --git a/static/js/util.js b/static/js/util.jsindex 1cb1978d569..21ea6305227 100644--- a/static/js/util.js+++ b/static/js/util.js@@ -68,7 +68,7 @@ exports.is_pm_recipient = function (user_id, message) {};exports.extract_pm_recipients = function (recipients) {- return recipients.split(/\s*[,;]\s*/).filter(recipient => recipient.trim() !== "");+ return recipients.split(/\s*[,;]\s*/).filter((recipient) => recipient.trim() !== "");};exports.same_recipient = function util_same_recipient(a, b) {@@ -102,9 +102,9 @@ exports.normalize_recipients = function (recipients) {// Converts a string listing emails of message recipients// into a canonical formatting: emails sorted ASCIIbetically// with exactly one comma and no spaces between each.- recipients = recipients.split(',').map(s => s.trim());- recipients = recipients.map(s => s.toLowerCase());- recipients = recipients.filter(s => s.length > 0);+ recipients = recipients.split(',').map((s) => s.trim());+ recipients = recipients.map((s) => s.toLowerCase());+ recipients = recipients.filter((s) => s.length > 0);recipients.sort();return recipients.join(',');};diff --git a/static/js/vdom.js b/static/js/vdom.jsindex 6350f45b0ed..0e79a8aea08 100644--- a/static/js/vdom.js+++ b/static/js/vdom.js@@ -37,7 +37,7 @@ exports.render_tag = (tag) => {*/const opts = tag.opts;const tag_name = tag.tag_name;- const attr_str = opts.attrs.map(attr => ' ' + attr[0] + '="' + _.escape(attr[1]) + '"').join('');+ const attr_str = opts.attrs.map((attr) => ' ' + attr[0] + '="' + _.escape(attr[1]) + '"').join('');const start_tag = '<' + tag_name + attr_str + '>';const end_tag = '</' + tag_name + '>';@@ -47,7 +47,7 @@ exports.render_tag = (tag) => {return;}- const innards = opts.keyed_nodes.map(node => node.render()).join('\n');+ const innards = opts.keyed_nodes.map((node) => node.render()).join('\n');return start_tag + '\n' + innards + '\n' + end_tag;};diff --git a/static/shared/js/typeahead.js b/static/shared/js/typeahead.jsindex 1e2d95b59d2..3667a79bc96 100644--- a/static/shared/js/typeahead.js+++ b/static/shared/js/typeahead.js@@ -75,7 +75,7 @@ function query_matches_string(query, source_str, split_char) {// account, there might be 2 attrs: their full name and their email.// * split_char is the separator for this syntax (e.g. ' ').export function query_matches_source_attrs(query, source, match_attrs, split_char) {- return match_attrs.some(attr => {+ return match_attrs.some((attr) => {const source_str = source[attr].toLowerCase();return query_matches_string(query, source_str, split_char);});@@ -151,7 +151,7 @@ export function sort_emojis(objs, query) {function decent_match(name) {const pieces = name.toLowerCase().split('_');- return pieces.some(piece => piece.startsWith(lowerQuery));+ return pieces.some((piece) => piece.startsWith(lowerQuery));}const popular_set = new Set(popular_emojis);@@ -162,7 +162,7 @@ export function sort_emojis(objs, query) {}const popular_emoji_matches = objs.filter(is_popular);- const others = objs.filter(obj => !is_popular(obj));+ const others = objs.filter((obj) => !is_popular(obj));const triage_results = triage(query,