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: Enable comma-dangle for functions.

Anders Kaseorge014ea966a7c
diff --git a/.eslintrc.json b/.eslintrc.json
index de9959bffa4..ab22195abff 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -22,15 +22,7 @@
"arrow-spacing": [ "error", { "before": true, "after": true } ],
"block-scoped-var": "error",
"brace-style": [ "error", "1tbs", { "allowSingleLine": true } ],
- "comma-dangle": [ "error",
- {
- "arrays": "always-multiline",
- "objects": "always-multiline",
- "imports": "always-multiline",
- "exports": "always-multiline",
- "functions": "never"
- }
- ],
+ "comma-dangle": [ "error", "always-multiline" ],
"comma-spacing": [ "error",
{
"before": false,
@@ -368,6 +360,16 @@
],
"rules": {
// Don’t require ES features that PhantomJS doesn’t support
+ "comma-dangle": [
+ "error",
+ {
+ "arrays": "always-multiline",
+ "objects": "always-multiline",
+ "imports": "always-multiline",
+ "exports": "always-multiline",
+ "functions": "never"
+ }
+ ],
"no-var": "off",
"prefer-arrow-callback": "off"
}
diff --git a/frontend_tests/node_tests/blueslip_stacktrace.js b/frontend_tests/node_tests/blueslip_stacktrace.js
index b8f6632af7e..79d1d0ed032 100644
--- a/frontend_tests/node_tests/blueslip_stacktrace.js
+++ b/frontend_tests/node_tests/blueslip_stacktrace.js
@@ -4,23 +4,23 @@ run_test("clean_path", () => {
// Local file
assert.strictEqual(
blueslip_stacktrace.clean_path("webpack:///static/js/upload.js"),
- "/static/js/upload.js"
+ "/static/js/upload.js",
);
// Third party library (jQuery)
assert.strictEqual(
blueslip_stacktrace.clean_path(
- "webpack:///.-npm-cache/de76fb6f582a29b053274f9048b6158091351048/node_modules/jquery/dist/jquery.js"
+ "webpack:///.-npm-cache/de76fb6f582a29b053274f9048b6158091351048/node_modules/jquery/dist/jquery.js",
),
- "jquery/dist/jquery.js"
+ "jquery/dist/jquery.js",
);
// Third party library (underscore)
assert.strictEqual(
blueslip_stacktrace.clean_path(
- "webpack:///.-npm-cache/de76fb6f582a29b053274f9048b…58091351048/node_modules/underscore/underscore.js"
+ "webpack:///.-npm-cache/de76fb6f582a29b053274f9048b…58091351048/node_modules/underscore/underscore.js",
),
- "underscore/underscore.js"
+ "underscore/underscore.js",
);
});
@@ -33,7 +33,7 @@ run_test("clean_function_name", () => {
{
scope: "Object../static/js/upload.js.exports.",
name: "options",
- }
+ },
);
// Third party library (jQuery)
@@ -45,12 +45,12 @@ run_test("clean_function_name", () => {
// Third party library (underscore)
assert.deepEqual(
blueslip_stacktrace.clean_function_name(
- "Function.../zulip-npm-cache/de76fb6f582a29b053274f…es/underscore/underscore.js?3817._.each._.forEach"
+ "Function.../zulip-npm-cache/de76fb6f582a29b053274f…es/underscore/underscore.js?3817._.each._.forEach",
),
{
scope:
"Function.../zulip-npm-cache/de76fb6f582a29b053274f…es/underscore/underscore.js?3817._.each._.",
name: "forEach",
- }
+ },
);
});
diff --git a/frontend_tests/node_tests/compose.js b/frontend_tests/node_tests/compose.js
index 4001a4cbaf7..13ee004bd7b 100644
--- a/frontend_tests/node_tests/compose.js
+++ b/frontend_tests/node_tests/compose.js
@@ -1233,7 +1233,7 @@ run_test('on_events', () => {
const helper = setup_parents_and_mock_remove(
'compose-all-everyone',
'compose-all-everyone',
- '.compose-all-everyone'
+ '.compose-all-everyone',
);
$("#compose-all-everyone").show();
@@ -1277,7 +1277,7 @@ run_test('on_events', () => {
const helper = setup_parents_and_mock_remove(
'compose_invite_users',
'compose_invite_link',
- '.compose_invite_user'
+ '.compose_invite_user',
);
// !sub will result false here and we check the failure code path.
@@ -1322,7 +1322,7 @@ run_test('on_events', () => {
const helper = setup_parents_and_mock_remove(
'compose_invite_users_close',
'compose_invite_close',
- '.compose_invite_user'
+ '.compose_invite_user',
);
let all_invite_children_called = false;
@@ -1355,7 +1355,7 @@ run_test('on_events', () => {
const helper = setup_parents_and_mock_remove(
'compose-send-status',
'sub_unsub_button',
- '.compose_not_subscribed'
+ '.compose_not_subscribed',
);
handler(helper.event);
@@ -1378,7 +1378,7 @@ run_test('on_events', () => {
const helper = setup_parents_and_mock_remove(
'compose_user_not_subscribed_close',
'compose_not_subscribed_close',
- '.compose_not_subscribed'
+ '.compose_not_subscribed',
);
$("#compose-send-status").show();
diff --git a/frontend_tests/node_tests/composebox_typeahead.js b/frontend_tests/node_tests/composebox_typeahead.js
index 09bef0f010f..ef5ca1da51f 100644
--- a/frontend_tests/node_tests/composebox_typeahead.js
+++ b/frontend_tests/node_tests/composebox_typeahead.js
@@ -287,7 +287,7 @@ run_test('topics_seen_for', () => {
assert.deepEqual(
ct.topics_seen_for('Denmark'),
- ['With Twisted Metal', 'acceptance', 'civil fears']
+ ['With Twisted Metal', 'acceptance', 'civil fears'],
);
// Test when the stream doesn't exist (there are no topics)
@@ -711,7 +711,7 @@ run_test('initialize', () => {
people,
query,
compose_state.stream_name(),
- compose_state.topic()
+ compose_state.topic(),
);
}
@@ -819,7 +819,7 @@ run_test('initialize', () => {
let actual_value = options.source.call(fake_this, 'test #s');
assert.deepEqual(
sorted_names_from(actual_value),
- ['Denmark', 'Sweden', 'The Netherlands']
+ ['Denmark', 'Sweden', 'The Netherlands'],
);
assert(caret_called);
@@ -1133,7 +1133,7 @@ run_test('begins_typeahead', () => {
return [input, rest];
};
const values = ct.get_candidates.call(
- begin_typehead_this, input
+ begin_typehead_this, input,
);
return values;
}
@@ -1158,7 +1158,7 @@ run_test('begins_typeahead', () => {
const values = get_values(input, rest);
assert.deepEqual(
sorted_names_from(values),
- ['Denmark', 'Sweden', 'The Netherlands']
+ ['Denmark', 'Sweden', 'The Netherlands'],
);
}
diff --git a/frontend_tests/node_tests/dispatch.js b/frontend_tests/node_tests/dispatch.js
index 83d2fa03fde..570083daaa2 100644
--- a/frontend_tests/node_tests/dispatch.js
+++ b/frontend_tests/node_tests/dispatch.js
@@ -140,7 +140,7 @@ with_overrides((override) => {
assert.deepEqual(
alert_words.get_word_list(),
- ['fire', 'lunch']
+ ['fire', 'lunch'],
);
assert(alert_words.has_alert_word('fire'));
assert(alert_words.has_alert_word('lunch'));
diff --git a/frontend_tests/node_tests/drafts.js b/frontend_tests/node_tests/drafts.js
index 221a1da95dc..f403d8d3ee7 100644
--- a/frontend_tests/node_tests/drafts.js
+++ b/frontend_tests/node_tests/drafts.js
@@ -93,7 +93,7 @@ const short_msg = {
run_test('legacy', () => {
assert.deepEqual(
drafts.restore_message(legacy_draft),
- compose_args_for_legacy_draft
+ compose_args_for_legacy_draft,
);
});
diff --git a/frontend_tests/node_tests/emoji.js b/frontend_tests/node_tests/emoji.js
index ebd47d61c16..525b2afcb30 100644
--- a/frontend_tests/node_tests/emoji.js
+++ b/frontend_tests/node_tests/emoji.js
@@ -15,7 +15,7 @@ run_test('build_emoji_upload_widget', () => {
file_name_field,
input_error,
clear_button,
- upload_button
+ upload_button,
) {
assert.deepEqual(get_file_input(), $('#emoji_file_input'));
assert.deepEqual(file_name_field, $('#emoji-file-name'));
diff --git a/frontend_tests/node_tests/filter.js b/frontend_tests/node_tests/filter.js
index 29d92e7523f..639cfa3f861 100644
--- a/frontend_tests/node_tests/filter.js
+++ b/frontend_tests/node_tests/filter.js
@@ -1276,26 +1276,26 @@ run_test('term_type', () => {
assert_term_sort(
['topic', 'stream', 'sender'],
- ['stream', 'topic', 'sender']
+ ['stream', 'topic', 'sender'],
);
assert_term_sort(
['has-link', 'near', 'is-unread', 'pm-with'],
- ['pm-with', 'near', 'is-unread', 'has-link']
+ ['pm-with', 'near', 'is-unread', 'has-link'],
);
assert_term_sort(
['bogus', 'stream', 'topic'],
- ['stream', 'topic', 'bogus']
+ ['stream', 'topic', 'bogus'],
);
assert_term_sort(
['stream', 'topic', 'stream'],
- ['stream', 'stream', 'topic']
+ ['stream', 'stream', 'topic'],
);
assert_term_sort(
['search', 'streams-public'],
- ['streams-public', 'search']
+ ['streams-public', 'search'],
);
const terms = [
@@ -1398,7 +1398,7 @@ run_test('navbar_helpers', () => {
const filter = new Filter(test_case.operator);
assert.equal(
filter.generate_redirect_url(),
- test_case.redirect_url_with_search
+ test_case.redirect_url_with_search,
);
}
@@ -1600,7 +1600,7 @@ run_test('navbar_helpers', () => {
let filter = new Filter(complex_operators_test_case.operator);
assert.equal(
filter.generate_redirect_url(),
- complex_operators_test_case.redirect_url
+ complex_operators_test_case.redirect_url,
);
assert.equal(filter.is_common_narrow(), false);
@@ -1627,7 +1627,7 @@ run_test('navbar_helpers', () => {
filter = new Filter(default_redirect.operator);
assert.equal(
filter.generate_redirect_url(),
- default_redirect.redirect_url
+ default_redirect.redirect_url,
);
});
diff --git a/frontend_tests/node_tests/hash_util.js b/frontend_tests/node_tests/hash_util.js
index 5456cd35afb..eb6a2ce458f 100644
--- a/frontend_tests/node_tests/hash_util.js
+++ b/frontend_tests/node_tests/hash_util.js
@@ -65,68 +65,68 @@ run_test('hash_util', () => {
run_test('test_get_hash_category', () => {
assert.deepEqual(
hash_util.get_hash_category('streams/subscribed'),
- 'streams'
+ 'streams',
);
assert.deepEqual(
hash_util.get_hash_category('#settings/display-settings'),
- 'settings'
+ 'settings',
);
assert.deepEqual(
hash_util.get_hash_category('#drafts'),
- 'drafts'
+ 'drafts',
);
assert.deepEqual(
hash_util.get_hash_category('invites'),
- 'invites'
+ 'invites',
);
});
run_test('test_get_hash_section', () => {
assert.equal(
hash_util.get_hash_section('streams/subscribed'),
- 'subscribed'
+ 'subscribed',
);
assert.equal(
hash_util.get_hash_section('#settings/your-account'),
- 'your-account'
+ 'your-account',
);
assert.equal(
hash_util.get_hash_section('settings/10/general/'),
- '10'
+ '10',
);
assert.equal(
hash_util.get_hash_section('#drafts'),
- ''
+ '',
);
assert.equal(
hash_util.get_hash_section(''),
- ''
+ '',
);
});
run_test('test_parse_narrow', () => {
assert.deepEqual(
hash_util.parse_narrow(['narrow', 'stream', '99-frontend']),
- [{negated: false, operator: 'stream', operand: 'frontend'}]
+ [{negated: false, operator: 'stream', operand: 'frontend'}],
);
assert.deepEqual(
hash_util.parse_narrow(['narrow', '-stream', '99-frontend']),
- [{negated: true, operator: 'stream', operand: 'frontend'}]
+ [{negated: true, operator: 'stream', operand: 'frontend'}],
);
assert.equal(
hash_util.parse_narrow(['narrow', 'BOGUS']),
- undefined
+ undefined,
);
// For nonexistent streams, we get the full slug.
// We possibly should remove the prefix and fix this test.
assert.deepEqual(
hash_util.parse_narrow(['narrow', 'stream', '42-bogus']),
- [{negated: false, operator: 'stream', operand: '42-bogus'}]
+ [{negated: false, operator: 'stream', operand: '42-bogus'}],
);
});
diff --git a/frontend_tests/node_tests/list_render.js b/frontend_tests/node_tests/list_render.js
index a183ed24df7..145e86ea586 100644
--- a/frontend_tests/node_tests/list_render.js
+++ b/frontend_tests/node_tests/list_render.js
@@ -164,7 +164,7 @@ run_test('scrolling', () => {
assert.deepEqual(
container.appended_data.html(),
- items.slice(0, 80).join('')
+ items.slice(0, 80).join(''),
);
// Set up our fake geometry so it forces a scroll action.
@@ -177,7 +177,7 @@ run_test('scrolling', () => {
scroll_container.call_scroll();
assert.deepEqual(
container.appended_data.html(),
- items.slice(80, 100).join('')
+ items.slice(80, 100).join(''),
);
});
@@ -339,7 +339,7 @@ run_test('wire up filter element', () => {
filter_element.f.apply({value: 'se'});
assert.equal(
container.appended_data.html(),
- '(JESSE)(moses)(Sean)'
+ '(JESSE)(moses)(Sean)',
);
});
@@ -505,7 +505,7 @@ run_test('custom sort', () => {
assert.deepEqual(
container.appended_data.html(),
- '(6, 7)(1, 43)(4, 11)'
+ '(6, 7)(1, 43)(4, 11)',
);
const widget = list_render.get('custom-sort-list');
@@ -513,7 +513,7 @@ run_test('custom sort', () => {
widget.sort('x_value');
assert.deepEqual(
container.appended_data.html(),
- '(1, 43)(4, 11)(6, 7)'
+ '(1, 43)(4, 11)(6, 7)',
);
// We can sort without registering the function, too.
@@ -524,7 +524,7 @@ run_test('custom sort', () => {
widget.sort(sort_by_y);
assert.deepEqual(
container.appended_data.html(),
- '(6, 7)(4, 11)(1, 43)'
+ '(6, 7)(4, 11)(1, 43)',
);
});
@@ -654,7 +654,7 @@ run_test('replace_list_data w/filter update', () => {
assert.deepEqual(
container.appended_data.html(),
- '(2)(4)'
+ '(2)(4)',
);
const widget = list_render.get('replace-list');
@@ -664,7 +664,7 @@ run_test('replace_list_data w/filter update', () => {
assert.deepEqual(
container.appended_data.html(),
- '(6)(8)'
+ '(6)(8)',
);
});
@@ -684,9 +684,9 @@ run_test('opts.get_item', () => {
assert.deepEqual(
list_render.get_filtered_items(
- 'whatever', list, boring_opts
+ 'whatever', list, boring_opts,
),
- ['one', 'two', 'three', 'four']
+ ['one', 'two', 'three', 'four'],
);
const predicate = (item, value) => item.startsWith(value);
@@ -700,9 +700,9 @@ run_test('opts.get_item', () => {
assert.deepEqual(
list_render.get_filtered_items(
- 't', list, predicate_opts
+ 't', list, predicate_opts,
),
- ['two', 'three']
+ ['two', 'three'],
);
const filterer_opts = {
@@ -714,9 +714,9 @@ run_test('opts.get_item', () => {
assert.deepEqual(
list_render.get_filtered_items(
- 't', list, filterer_opts
+ 't', list, filterer_opts,
),
- ['two', 'three']
+ ['two', 'three'],
);
});
diff --git a/frontend_tests/node_tests/markdown.js b/frontend_tests/node_tests/markdown.js
index 0766fbf8bea..486b3d11e70 100644
--- a/frontend_tests/node_tests/markdown.js
+++ b/frontend_tests/node_tests/markdown.js
@@ -189,7 +189,7 @@ run_test('fenced_block_defaults', () => {
markdown.initialize(
page_params.realm_filters,
- markdown_config.get_helpers()
+ markdown_config.get_helpers(),
);
const markdown_data = global.read_fixture_data('markdown_test_cases.json');
diff --git a/frontend_tests/node_tests/message_events.js b/frontend_tests/node_tests/message_events.js
index 219d9ee3004..b9661041373 100644
--- a/frontend_tests/node_tests/message_events.js
+++ b/frontend_tests/node_tests/message_events.js
@@ -77,7 +77,7 @@ run_test('update_messages', () => {
assert.deepEqual(
stream_topic_history.get_recent_topic_names(denmark.stream_id),
- ['lunch']
+ ['lunch'],
);
unread.update_message_for_mention(original_message);
diff --git a/frontend_tests/node_tests/message_fetch.js b/frontend_tests/node_tests/message_fetch.js
index 20ad12d0999..f76cfb80948 100644
--- a/frontend_tests/node_tests/message_fetch.js
+++ b/frontend_tests/node_tests/message_fetch.js
@@ -327,7 +327,7 @@ run_test('loading_newer', () => {
{
name: "Error",
message: "There are no message available to frontfill.",
- }
+ },
);
} else {
message_fetch.maybe_load_newer_messages({
diff --git a/frontend_tests/node_tests/message_list_data.js b/frontend_tests/node_tests/message_list_data.js
index a5aa70fa7d0..201f9525bf6 100644
--- a/frontend_tests/node_tests/message_list_data.js
+++ b/frontend_tests/node_tests/message_list_data.js
@@ -156,12 +156,12 @@ run_test('more muting', () => {
assert.deepEqual(
mld._all_items.map((message) => message.id),
- [3, 4, 7, 8]
+ [3, 4, 7, 8],
);
assert.deepEqual(
mld.all_messages().map((message) => message.id),
- [4, 8]
+ [4, 8],
);
const more_messages = [
@@ -178,12 +178,12 @@ run_test('more muting', () => {
assert.deepEqual(
mld._all_items.map((message) => message.id),
- [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+ [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
);
assert.deepEqual(
mld.all_messages().map((message) => message.id),
- [2, 4, 6, 8, 10]
+ [2, 4, 6, 8, 10],
);
assert.deepEqual(more_info, {
diff --git a/frontend_tests/node_tests/narrow.js b/frontend_tests/node_tests/narrow.js
index fdf48039023..805c470810f 100644
--- a/frontend_tests/node_tests/narrow.js
+++ b/frontend_tests/node_tests/narrow.js
@@ -74,7 +74,7 @@ run_test('show_empty_narrow_message', () => {
assert($('#empty_narrow_message').visible());
assert.equal(
$('#left_bar_compose_reply_button_big').attr('title'),
- 'translated: There are no messages to reply to.'
+ 'translated: There are no messages to reply to.',
);
// for non-existent or private stream
diff --git a/frontend_tests/node_tests/people.js b/frontend_tests/node_tests/people.js
index b2b98898fda..dd9f0ab3a0f 100644
--- a/frontend_tests/node_tests/people.js
+++ b/frontend_tests/node_tests/people.js
@@ -234,7 +234,7 @@ run_test('basics', () => {
assert.equal(
people.get_actual_name_from_user_id(32),
- full_name
+ full_name,
);
assert(people.is_valid_full_name_and_user_id(full_name, 32));
@@ -266,7 +266,7 @@ run_test('basics', () => {
assert.equal(
people.get_bot_owner_user(bot_botson).full_name,
- 'Isaac Newton'
+ 'Isaac Newton',
);
// Add our cross-realm bot. It won't add to our human
@@ -276,7 +276,7 @@ run_test('basics', () => {
assert.equal(people.get_active_human_count(), 1);
assert.equal(
people.get_by_email(welcome_bot.email).full_name,
- 'Welcome Bot'
+ 'Welcome Bot',
);
// get_realm_users() will include our active bot,
@@ -286,7 +286,7 @@ run_test('basics', () => {
[
me.user_id,
bot_botson.user_id,
- ]
+ ],
);
// The bot doesn't add to our human count.
@@ -593,14 +593,14 @@ run_test('concat_huddle', () => {
assert.equal(
people.concat_huddle(user_ids, 304),
- '301,302,303,304'
+ '301,302,303,304',
);
// IMPORTANT: we always want to sort
// ids numerically to create huddle strings.
assert.equal(
people.concat_huddle(user_ids, 99),
- '99,301,302,303'
+ '99,301,302,303',
);
});
@@ -673,7 +673,7 @@ run_test('message_methods', () => {
sender_id: maria.user_id,
};
assert.equal(people.small_avatar_url(message),
- 'https://secure.gravatar.com/avatar/[email protected]?d=identicon&s=50'
+ 'https://secure.gravatar.com/avatar/[email protected]?d=identicon&s=50',
);
blueslip.expect('error', 'Unknown user_id in get_by_user_id: 9999999');
@@ -683,14 +683,14 @@ run_test('message_methods', () => {
sender_id: 9999999,
};
assert.equal(people.small_avatar_url(message),
- 'https://secure.gravatar.com/avatar/[email protected]?d=identicon&s=50'
+ 'https://secure.gravatar.com/avatar/[email protected]?d=identicon&s=50',
);
message = {
sender_id: ashton.user_id,
};
assert.equal(people.small_avatar_url(message),
- `/avatar/${ashton.user_id}&s=50`
+ `/avatar/${ashton.user_id}&s=50`,
);
message = {
@@ -914,17 +914,17 @@ run_test('update_email_in_reply_to', () => {
assert.equal(
people.update_email_in_reply_to(reply_to, 9999, 'whatever'),
- reply_to
+ reply_to,
);
assert.equal(
people.update_email_in_reply_to(reply_to, maria.user_id, '[email protected]'),
);
assert.equal(
people.update_email_in_reply_to(reply_to, 9999, 'whatever'),
- reply_to
+ reply_to,
);
});
@@ -937,7 +937,7 @@ run_test('track_duplicate_full_names', () => {
assert(!people.is_duplicate_full_name('Stephen King'));
assert.equal(
people.get_user_id_from_name('Stephen King'),
- stephen1.user_id
+ stephen1.user_id,
);
// Now duplicate the Stephen King name.
@@ -948,7 +948,7 @@ run_test('track_duplicate_full_names', () => {
// other codepaths for disambiguation.
assert.equal(
people.get_user_id_from_name('Stephen King'),
- undefined
+ undefined,
);
assert(people.is_duplicate_full_name('Stephen King'));
diff --git a/frontend_tests/node_tests/presence.js b/frontend_tests/node_tests/presence.js
index c1d508b22b5..256e738e594 100644
--- a/frontend_tests/node_tests/presence.js
+++ b/frontend_tests/node_tests/presence.js
@@ -114,7 +114,7 @@ run_test('status_from_raw', () => {
{
status: 'active',
last_active: raw.active_timestamp,
- }
+ },
);
raw = {
@@ -127,7 +127,7 @@ run_test('status_from_raw', () => {
{
status: 'offline',
last_active: raw.active_timestamp,
- }
+ },
);
raw = {
@@ -140,7 +140,7 @@ run_test('status_from_raw', () => {
{
status: 'idle',
last_active: raw.idle_timestamp,
- }
+ },
);
});
@@ -181,31 +181,31 @@ run_test('set_presence_info', () => {
presence.initialize(params);
assert.deepEqual(presence.presence_info.get(alice.user_id),
- { status: 'active', last_active: recent}
+ { status: 'active', last_active: recent},
);
assert.equal(presence.get_status(alice.user_id), 'active');
assert.deepEqual(
presence.last_active_date(alice.user_id),
- {seconds: recent * 1000}
+ {seconds: recent * 1000},
);
assert.deepEqual(presence.presence_info.get(fred.user_id),
- { status: 'idle', last_active: now}
+ { status: 'idle', last_active: now},
);
assert.equal(presence.get_status(fred.user_id), 'idle');
assert.deepEqual(presence.presence_info.get(me.user_id),
- { status: 'active', last_active: now}
+ { status: 'active', last_active: now},
);
assert.equal(presence.get_status(me.user_id), 'active');
assert.deepEqual(presence.presence_info.get(sally.user_id),
- { status: 'offline', last_active: a_while_ago}
+ { status: 'offline', last_active: a_while_ago},
);
assert.equal(presence.get_status(sally.user_id), 'offline');
assert.deepEqual(presence.presence_info.get(zoe.user_id),
- { status: 'offline', last_active: undefined}
+ { status: 'offline', last_active: undefined},
);
assert.equal(presence.get_status(zoe.user_id), 'offline');
assert.equal(presence.last_active_date(zoe.user_id), undefined);
@@ -214,12 +214,12 @@ run_test('set_presence_info', () => {
assert.equal(presence.get_status(bot.user_id), 'offline');
assert.deepEqual(presence.presence_info.get(john.user_id),
- { status: 'offline', last_active: a_while_ago}
+ { status: 'offline', last_active: a_while_ago},
);
assert.equal(presence.get_status(john.user_id), 'offline');
assert.deepEqual(presence.presence_info.get(jane.user_id),
- { status: 'idle', last_active: now}
+ { status: 'idle', last_active: now},
);
assert.equal(presence.get_status(jane.user_id), 'idle');
@@ -250,7 +250,7 @@ run_test('falsy values', () => {
assert.deepEqual(
presence.presence_info.get(zoe.user_id),
- { status: 'idle', last_active: a_bit_ago }
+ { status: 'idle', last_active: a_bit_ago },
);
presences[zoe.user_id.toString()] = {
@@ -262,7 +262,7 @@ run_test('falsy values', () => {
assert.deepEqual(
presence.presence_info.get(zoe.user_id),
- { status: 'offline', last_active: undefined }
+ { status: 'offline', last_active: undefined },
);
}
});
@@ -312,7 +312,7 @@ run_test('update_info_from_event', () => {
assert.deepEqual(
presence.presence_info.get(alice.user_id),
- { status: 'active', last_active: 500 }
+ { status: 'active', last_active: 500 },
);
info = {
@@ -325,7 +325,7 @@ run_test('update_info_from_event', () => {
assert.deepEqual(
presence.presence_info.get(alice.user_id),
- { status: 'active', last_active: 510 }
+ { status: 'active', last_active: 510 },
);
info = {
@@ -338,6 +338,6 @@ run_test('update_info_from_event', () => {
assert.deepEqual(
presence.presence_info.get(alice.user_id),
- { status: 'idle', last_active: 1000 }
+ { status: 'idle', last_active: 1000 },
);
});
diff --git a/frontend_tests/node_tests/reactions.js b/frontend_tests/node_tests/reactions.js
index 0f36bd83a5c..fc9148b9cfb 100644
--- a/frontend_tests/node_tests/reactions.js
+++ b/frontend_tests/node_tests/reactions.js
@@ -631,7 +631,7 @@ run_test('remove last user', () => {
function assert_names(names) {
assert.deepEqual(
reactions.get_message_reactions(message).map((r) => r.emoji_name),
- names
+ names,
);
}
diff --git a/frontend_tests/node_tests/recent_senders.js b/frontend_tests/node_tests/recent_senders.js
index d3fa875c239..a03ce5951d7 100644
--- a/frontend_tests/node_tests/recent_senders.js
+++ b/frontend_tests/node_tests/recent_senders.js
@@ -145,10 +145,10 @@ run_test('process_message_for_senders', () => {
// Test topic change
assert.equal(
- rs.get_topic_recent_senders(stream3, topic3).toString(), '3'
+ rs.get_topic_recent_senders(stream3, topic3).toString(), '3',
);
assert.equal(
- rs.get_topic_recent_senders(stream3, topic2).toString(), '2,3'
+ rs.get_topic_recent_senders(stream3, topic2).toString(), '2,3',
);
// message7's topic was changed by user
@@ -156,36 +156,36 @@ run_test('process_message_for_senders', () => {
rs.process_topic_edit(stream3, topic2, topic3);
assert.equal(
- rs.get_topic_recent_senders(stream3, topic3).toString(), '2,3'
+ rs.get_topic_recent_senders(stream3, topic3).toString(), '2,3',
);
assert.equal(
- rs.get_topic_recent_senders(stream3, topic2).toString(), '3'
+ rs.get_topic_recent_senders(stream3, topic2).toString(), '3',
);
// Test stream change
assert.equal(
- rs.get_topic_recent_senders(stream3, topic3).toString(), '2,3'
+ rs.get_topic_recent_senders(stream3, topic3).toString(), '2,3',
);
assert.equal(
- rs.get_topic_recent_senders(stream4, topic3).toString(), ''
+ rs.get_topic_recent_senders(stream4, topic3).toString(), '',
);
// stream of topic3 was changed to stream4.
messages[6].stream_id = stream4; // message7's topic is topic3
messages[7].stream_id = stream4;
rs.process_topic_edit(stream3, topic3, topic3, stream4);
assert.equal(
- rs.get_topic_recent_senders(stream3, topic3).toString(), ''
+ rs.get_topic_recent_senders(stream3, topic3).toString(), '',
);
assert.equal(
- rs.get_topic_recent_senders(stream4, topic3).toString(), '2,3'
+ rs.get_topic_recent_senders(stream4, topic3).toString(), '2,3',
);
// Test stream & topic change
assert.equal(
- rs.get_topic_recent_senders(stream4, topic3).toString(), '2,3'
+ rs.get_topic_recent_senders(stream4, topic3).toString(), '2,3',
);
assert.equal(
- rs.get_topic_recent_senders(stream5, topic4).toString(), ''
+ rs.get_topic_recent_senders(stream5, topic4).toString(), '',
);
// stream of topic3 was changed to stream5 and topic was changed to topic4.
messages[6].stream_id = stream5;
@@ -194,9 +194,9 @@ run_test('process_message_for_senders', () => {
messages[7].topic = topic4;
rs.process_topic_edit(stream4, topic3, topic4, stream5);
assert.equal(
- rs.get_topic_recent_senders(stream4, topic3).toString(), ''
+ rs.get_topic_recent_senders(stream4, topic3).toString(), '',
);
assert.equal(
- rs.get_topic_recent_senders(stream5, topic4).toString(), '2,3'
+ rs.get_topic_recent_senders(stream5, topic4).toString(), '2,3',
);
});
diff --git a/frontend_tests/node_tests/schema.js b/frontend_tests/node_tests/schema.js
index 20abc64c85e..f8f48028ee4 100644
--- a/frontend_tests/node_tests/schema.js
+++ b/frontend_tests/node_tests/schema.js
@@ -13,43 +13,43 @@ run_test('basics', () => {
assert.equal(
check_rec({foo: 'apple', bar: 'banana'}),
- undefined
+ undefined,
);
assert.equal(
check_rec('bogus'),
- 'my_rec is not a record'
+ 'my_rec is not a record',
);
assert.equal(
check_rec({foo: 'apple'}),
- 'in my_rec bar is missing'
+ 'in my_rec bar is missing',
);
assert.equal(
check_rec({}),
- 'in my_rec bar is missing, foo is missing'
+ 'in my_rec bar is missing, foo is missing',
);
assert.equal(
check_rec({foo: 'apple', bar: 42}),
- 'in my_rec bar is not a string'
+ 'in my_rec bar is not a string',
);
const check_array = (val) => schema.check_array('lst', val, schema.check_string);
assert.equal(
check_array(['foo', 'bar']),
- undefined
+ undefined,
);
assert.equal(
check_array('foo'),
- 'lst is not an array'
+ 'lst is not an array',
);
assert.equal(
check_array(['foo', 3]),
- 'in lst we found an item where item is not a string'
+ 'in lst we found an item where item is not a string',
);
});
diff --git a/frontend_tests/node_tests/scroll_util.js b/frontend_tests/node_tests/scroll_util.js
index 4e3f97d4b99..782025203a6 100644
--- a/frontend_tests/node_tests/scroll_util.js
+++ b/frontend_tests/node_tests/scroll_util.js
@@ -102,7 +102,7 @@ run_test('get_list_scrolling_container error', () => {
blueslip.expect(
'error',
"Please wrap lists in an element with " +
- "'max-height' attribute."
+ "'max-height' attribute.",
);
scroll_util.get_list_scrolling_container(body);
diff --git a/frontend_tests/node_tests/settings_bots.js b/frontend_tests/node_tests/settings_bots.js
index 1d8b83b3fbf..9b914897b06 100644
--- a/frontend_tests/node_tests/settings_bots.js
+++ b/frontend_tests/node_tests/settings_bots.js
@@ -36,7 +36,7 @@ run_test('generate_zuliprc_uri', () => {
const expected = "data:application/octet-stream;charset=utf-8," + encodeURIComponent(
"[api]\[email protected]\n" +
"key=QadL788EkiottHmukyhHgePUFHREiu8b\n" +
- "site=https://chat.example.com\n"
+ "site=https://chat.example.com\n",
);
assert.equal(uri, expected);
diff --git a/frontend_tests/node_tests/settings_org.js b/frontend_tests/node_tests/settings_org.js
index b0c8fbc5da1..c6b5f93f1fd 100644
--- a/frontend_tests/node_tests/settings_org.js
+++ b/frontend_tests/node_tests/settings_org.js
@@ -92,7 +92,7 @@ run_test('unloaded', () => {
function simulate_realm_domains_table() {
$('#realm_domains_table tbody').set_find_results(
'tr',
- $.create('realm-tr-stub')
+ $.create('realm-tr-stub'),
);
let appended;
@@ -111,12 +111,12 @@ function test_realms_domain_modal(add_realm_domain) {
$('#add-realm-domain-widget').set_find_results(
'.new-realm-domain',
- $.create('new-realm-domain-stub')
+ $.create('new-realm-domain-stub'),
);
$('#add-realm-domain-widget').set_find_results(
'.new-realm-domain-allow-subdomains',
- $.create('new-realm-domain-allow-subdomains-stub')
+ $.create('new-realm-domain-allow-subdomains-stub'),
);
let posted;
@@ -147,23 +147,23 @@ function createSaveButtons(subsection) {
const stub_discard_button = $(`#org-discard-${subsection}`);
const stub_save_button_text = $('.icon-button-text');
stub_save_button_header.set_find_results(
- '.subsection-failed-status p', $('<failed status element>')
+ '.subsection-failed-status p', $('<failed status element>'),
);
stub_save_button.closest = () => stub_save_button_header;
save_button_controls.set_find_results(
- '.save-button', stub_save_button
+ '.save-button', stub_save_button,
);
stub_save_button.set_find_results(
- '.icon-button-text', stub_save_button_text
+ '.icon-button-text', stub_save_button_text,
);
stub_save_button_header.set_find_results(
- '.save-button-controls', save_button_controls
+ '.save-button-controls', save_button_controls,
);
stub_save_button_header.set_find_results(
- '.subsection-changes-discard .button', $(`#org-discard-${subsection}`)
+ '.subsection-changes-discard .button', $(`#org-discard-${subsection}`),
);
save_button_controls.set_find_results(
- '.discard-button', stub_discard_button
+ '.discard-button', stub_discard_button,
);
const props = {};
props.hidden = false;
@@ -429,21 +429,21 @@ function test_extract_property_name() {
$('#id_realm_allow_message_editing').attr('id', 'id_realm_allow_message_editing');
assert.equal(
settings_org.extract_property_name($('#id_realm_allow_message_editing')),
- 'realm_allow_message_editing'
+ 'realm_allow_message_editing',
);
$('#id_realm_message_content_edit_limit_minutes_label').attr(
'id', 'id_realm_message_content_edit_limit_minutes_label');
assert.equal(
settings_org.extract_property_name($('#id_realm_message_content_edit_limit_minutes_label')),
- 'realm_message_content_edit_limit_minutes_label'
+ 'realm_message_content_edit_limit_minutes_label',
);
$('#id-realm-allow-message-deleting').attr(
'id', 'id-realm-allow-message-deleting');
assert.equal(
settings_org.extract_property_name($('#id-realm-allow-message-deleting')),
- 'realm_allow_message_deleting'
+ 'realm_allow_message_deleting',
);
}
diff --git a/frontend_tests/node_tests/stream_data.js b/frontend_tests/node_tests/stream_data.js
index 850be84297e..c376e107b56 100644
--- a/frontend_tests/node_tests/stream_data.js
+++ b/frontend_tests/node_tests/stream_data.js
@@ -203,7 +203,7 @@ run_test('subscribers', () => {
fred.user_id,
not_fred.user_id,
george.user_id,
- ]
+ ],
);
stream_data.set_subscribers(sub, [me.user_id, fred.user_id, george.user_id]);
@@ -217,7 +217,7 @@ run_test('subscribers', () => {
potential_subscriber_ids(),
[
not_fred.user_id,
- ]
+ ],
);
stream_data.set_subscribers(sub, []);
@@ -572,7 +572,7 @@ run_test('default_stream_names', () => {
[
announce.stream_id,
general.stream_id,
- ]
+ ],
);
});
@@ -842,7 +842,7 @@ run_test('remove_default_stream', () => {
run_test('canonicalized_name', () => {
assert.deepStrictEqual(
stream_data.canonicalized_name('Stream_Bar'),
- "stream_bar"
+ "stream_bar",
);
});
@@ -1004,7 +1004,7 @@ run_test('is_subscriber_subset', () => {
for (const row of matrix) {
assert.equal(
stream_data.is_subscriber_subset(row[0], row[1]),
- row[2]
+ row[2],
);
}
});
diff --git a/frontend_tests/node_tests/stream_list.js b/frontend_tests/node_tests/stream_list.js
index 3ae0d48c60a..d6648506e17 100644
--- a/frontend_tests/node_tests/stream_list.js
+++ b/frontend_tests/node_tests/stream_list.js
@@ -625,7 +625,7 @@ run_test('update_count_in_dom', () => {
const stream_li = make_elem(
$('<stream li>'),
'<stream-count>',
- '<stream-value>'
+ '<stream-value>',
);
$('<stream li>').length = 0;
diff --git a/frontend_tests/node_tests/top_left_corner.js b/frontend_tests/node_tests/top_left_corner.js
index 4d1c21c67bc..6c5b6db5513 100644
--- a/frontend_tests/node_tests/top_left_corner.js
+++ b/frontend_tests/node_tests/top_left_corner.js
@@ -108,19 +108,19 @@ run_test('update_count_in_dom', () => {
make_elem(
$(".top_left_mentions"),
'<mentioned-count>',
- '<mentioned-value>'
+ '<mentioned-value>',
);
make_elem(
$(".top_left_all_messages"),
'<home-count>',
- '<home-value>'
+ '<home-value>',
);
make_elem(
$(".top_left_starred_messages"),
'<starred-count>',
- '<starred-value>'
+ '<starred-value>',
);
top_left_corner.update_dom_with_unread_counts(counts);
diff --git a/frontend_tests/node_tests/typeahead.js b/frontend_tests/node_tests/typeahead.js
index afd0fc21a3b..60a16f4a29d 100644
--- a/frontend_tests/node_tests/typeahead.js
+++ b/frontend_tests/node_tests/typeahead.js
@@ -35,7 +35,7 @@ run_test('get_emoji_matcher', () => {
const matcher = typeahead.get_emoji_matcher(query);
assert.deepEqual(
emojis.filter(matcher),
- expected
+ expected,
);
}
@@ -67,7 +67,7 @@ run_test('triage', () => {
{
matches: [alice, Alicia],
rest: [steve, Stephanie],
- }
+ },
);
assert.deepEqual(
@@ -75,7 +75,7 @@ run_test('triage', () => {
{
matches: [Alicia, alice],
rest: [steve, Stephanie],
- }
+ },
);
assert.deepEqual(
@@ -83,7 +83,7 @@ run_test('triage', () => {
{
matches: [Stephanie, steve],
rest: [alice, Alicia],
- }
+ },
);
assert.deepEqual(
@@ -91,7 +91,7 @@ run_test('triage', () => {
{
matches: [],
rest: [alice, Alicia, steve, Stephanie],
- }
+ },
);
});
@@ -119,7 +119,7 @@ run_test('sort_emojis th', () => {
thermometer,
thumbs_down,
mother_nature,
- ]
+ ],
);
});
@@ -143,7 +143,7 @@ run_test('sort_emojis sm', () => {
slight_smile,
small_airplane,
big_smile,
- ]
+ ],
);
});
diff --git a/frontend_tests/node_tests/typeahead_helper.js b/frontend_tests/node_tests/typeahead_helper.js
index f8efdd8f460..6fd08af90f3 100644
--- a/frontend_tests/node_tests/typeahead_helper.js
+++ b/frontend_tests/node_tests/typeahead_helper.js
@@ -25,7 +25,7 @@ let next_id = 0;
function assertSameEmails(lst1, lst2) {
assert.deepEqual(
lst1.map((r) => r.email),
- lst2.map((r) => r.email)
+ lst2.map((r) => r.email),
);
}
@@ -207,7 +207,7 @@ function get_typeahead_result(query, current_stream, current_topic) {
people.get_realm_users(),
query,
current_stream,
- current_topic
+ current_topic,
);
return result.map((person) => person.email);
}
@@ -322,7 +322,7 @@ run_test('sort_recipients all mention', () => {
test_objs,
'a',
'Linux',
- 'Linux Topic'
+ 'Linux Topic',
);
assertSameEmails(results, [
@@ -431,7 +431,7 @@ run_test('sort broadcast mentions', () => {
assert.deepEqual(
results.map((r) => r.email),
- ['all', 'everyone', 'stream']
+ ['all', 'everyone', 'stream'],
);
// Reverse the list to test actual sorting
@@ -452,7 +452,7 @@ run_test('sort broadcast mentions', () => {
'everyone',
'stream',
a_user.email,
- zman.email]
+ zman.email],
);
});
diff --git a/frontend_tests/node_tests/ui_init.js b/frontend_tests/node_tests/ui_init.js
index 5f714fb7150..af8e2021607 100644
--- a/frontend_tests/node_tests/ui_init.js
+++ b/frontend_tests/node_tests/ui_init.js
@@ -128,7 +128,7 @@ const ui_init = rewiremock.proxy(
"../../static/js/emojisets": {
initialize: () => {},
},
- }
+ },
);
set_global('$', global.make_zjquery());
diff --git a/frontend_tests/node_tests/unread.js b/frontend_tests/node_tests/unread.js
index f56023f57ab..894a0e09e8d 100644
--- a/frontend_tests/node_tests/unread.js
+++ b/frontend_tests/node_tests/unread.js
@@ -109,7 +109,7 @@ run_test('changing_topics', () => {
assert.deepEqual(unread.get_unread_message_ids([15, 16]), [15, 16]);
assert.deepEqual(
unread.get_unread_messages([message, other_message]),
- [message, other_message]
+ [message, other_message],
);
count = unread.num_unread_for_topic(stream_id, 'Lunch');
@@ -563,7 +563,7 @@ run_test('mention updates', () => {
unread.update_message_for_mention(message);
assert.equal(
unread.unread_mentions_counter.has(message.id),
- counted
+ counted,
);
}
diff --git a/frontend_tests/node_tests/upload.js b/frontend_tests/node_tests/upload.js
index c230e6be6a4..815afa6bfc5 100644
--- a/frontend_tests/node_tests/upload.js
+++ b/frontend_tests/node_tests/upload.js
@@ -75,7 +75,7 @@ run_test('get_item', () => {
{
name: "Error",
message: "Missing config",
- }
+ },
);
assert.throws(
() => {
@@ -84,7 +84,7 @@ run_test('get_item', () => {
{
name: "Error",
message: "Missing row in config",
- }
+ },
);
assert.throws(
() => {
@@ -93,7 +93,7 @@ run_test('get_item', () => {
{
name: "Error",
message: "Invalid upload mode!",
- }
+ },
);
assert.throws(
() => {
@@ -102,7 +102,7 @@ run_test('get_item', () => {
{
name: "Error",
message: 'Invalid key name for mode "compose"',
- }
+ },
);
assert.throws(
() => {
@@ -111,7 +111,7 @@ run_test('get_item', () => {
{
name: "Error",
message: 'Invalid key name for mode "edit"',
- }
+ },
);
});
diff --git a/frontend_tests/node_tests/util.js b/frontend_tests/node_tests/util.js
index 56d7d78767e..3a144d763a7 100644
--- a/frontend_tests/node_tests/util.js
+++ b/frontend_tests/node_tests/util.js
@@ -299,12 +299,12 @@ run_test("clean_user_content_links", () => {
'<a href="http://zulip.zulipdev.com/user_uploads/w/ha/tever/file.png">upload</a> ' +
'<a href="http://localhost:NNNN">invalid</a> ' +
'<a href="javascript:alert(1)">unsafe</a> ' +
- '<a href="/#fragment" target="_blank">fragment</a>'
+ '<a href="/#fragment" target="_blank">fragment</a>',
),
'<a href="http://example.com" target="_blank" rel="noopener noreferrer" title="http://example.com/">good</a> ' +
'<a href="http://zulip.zulipdev.com/user_uploads/w/ha/tever/file.png" target="_blank" rel="noopener noreferrer" title="file.png">upload</a> ' +
'<a>invalid</a> ' +
'<a>unsafe</a> ' +
- '<a href="/#fragment" title="http://zulip.zulipdev.com/#fragment">fragment</a>'
+ '<a href="/#fragment" title="http://zulip.zulipdev.com/#fragment">fragment</a>',
);
});
diff --git a/frontend_tests/node_tests/vdom.js b/frontend_tests/node_tests/vdom.js
index f02e46324fa..d28be64db41 100644
--- a/frontend_tests/node_tests/vdom.js
+++ b/frontend_tests/node_tests/vdom.js
@@ -16,7 +16,7 @@ run_test('basics', () => {
assert.equal(
html,
'<ul class="foo" title="cats &amp; &lt;&quot;dogs&quot;&gt;">\n\n' +
- '</ul>'
+ '</ul>',
);
});
@@ -40,7 +40,7 @@ run_test('attribute escaping', () => {
assert.equal(
html,
'<ul class="&quot;&gt;something evil&lt;div class=&quot;" ' +
- 'title="apples &amp; oranges">\n\n</ul>'
+ 'title="apples &amp; oranges">\n\n</ul>',
);
});
@@ -61,7 +61,7 @@ run_test('attribute updates', () => {
assert.equal(
html,
'<ul class="same" color="blue" id="101">\n\n' +
- '</ul>'
+ '</ul>',
);
let updated;
@@ -144,7 +144,7 @@ run_test('children', () => {
'<li>foo1</li>\n' +
'<li>foo2</li>\n' +
'<li>foo3</li>\n' +
- '</ul>'
+ '</ul>',
);
// Force a complete redraw.
@@ -164,7 +164,7 @@ run_test('children', () => {
'<ul class="main">\n' +
'<li>foo4</li>\n' +
'<li>foo5</li>\n' +
- '</ul>'
+ '</ul>',
);
});
@@ -194,7 +194,7 @@ run_test('partial updates', () => {
'<li>foo1</li>\n' +
'<li>foo2</li>\n' +
'<li>foo3</li>\n' +
- '</ul>'
+ '</ul>',
);
replace_content = () => {
diff --git a/frontend_tests/puppeteer_lib/common.js b/frontend_tests/puppeteer_lib/common.js
index 782f557d767..bdeab143689 100644
--- a/frontend_tests/puppeteer_lib/common.js
+++ b/frontend_tests/puppeteer_lib/common.js
@@ -244,7 +244,7 @@ class CommonUtils {
await this.send_message(
page,
msg.stream !== undefined ? 'stream' : 'private',
- msg
+ msg,
);
}
}
diff --git a/frontend_tests/zjsunit/handlebars.js b/frontend_tests/zjsunit/handlebars.js
index 1b0167d8f8e..76e4723a09a 100644
--- a/frontend_tests/zjsunit/handlebars.js
+++ b/frontend_tests/zjsunit/handlebars.js
@@ -53,6 +53,6 @@ require.extensions[".hbs"] = (module, filename) => {
out.code +
"\n//# sourceMappingURL=data:application/json;charset=utf-8;base64," +
Buffer.from(out.map.toString()).toString("base64"),
- filename
+ filename,
);
};
diff --git a/frontend_tests/zjsunit/markdown_assert.js b/frontend_tests/zjsunit/markdown_assert.js
index 5a9e2c6ff26..e61ef9efe05 100644
--- a/frontend_tests/zjsunit/markdown_assert.js
+++ b/frontend_tests/zjsunit/markdown_assert.js
@@ -59,7 +59,7 @@ class MarkdownComparer {
return false;
}
return _.zip(node1.content.childNodes, node2.content.childNodes).every(([child1, child2]) =>
- child1.isEqualNode(child2)
+ child1.isEqualNode(child2),
);
}
@@ -138,7 +138,7 @@ class MarkdownComparer {
throw new assert.AssertionError({
message: message + this._output_formatter(
comparison_results.html.actual,
- comparison_results.html.expected
+ comparison_results.html.expected,
),
});
}
diff --git a/frontend_tests/zjsunit/mdiff.js b/frontend_tests/zjsunit/mdiff.js
index 9d05d704c2f..e2cdf1217b0 100644
--- a/frontend_tests/zjsunit/mdiff.js
+++ b/frontend_tests/zjsunit/mdiff.js
@@ -27,7 +27,7 @@ function apply_color(input_string, changes) {
if (formatter.has(change.tag)) {
processed_string += input_string.slice(previous_index, change.beginning_index);
processed_string += formatter.get(change.tag)(
- input_string.slice(change.beginning_index, change.ending_index)
+ input_string.slice(change.beginning_index, change.ending_index),
);
previous_index = change.ending_index;
}
@@ -134,7 +134,7 @@ if (require.main === module) {
" string_0" +
" string_1" +
"\n" +
- "Where string_0 and string_1 are the strings to be diffed"
+ "Where string_0 and string_1 are the strings to be diffed",
);
}
diff --git a/static/js/avatar.js b/static/js/avatar.js
index 327425fab46..082211c9442 100644
--- a/static/js/avatar.js
+++ b/static/js/avatar.js
@@ -17,7 +17,7 @@ exports.build_bot_create_widget = function () {
file_name_field,
input_error,
clear_button,
- upload_button
+ upload_button,
);
};
@@ -36,7 +36,7 @@ exports.build_bot_edit_widget = function (target) {
file_name_field,
input_error,
clear_button,
- upload_button
+ upload_button,
);
};
@@ -74,7 +74,7 @@ exports.build_user_avatar_widget = function (upload_function) {
$("#user-avatar-upload-widget .image_file_input_error").expectOne(),
$("#user-avatar-upload-widget .image_upload_button").expectOne(),
upload_function,
- page_params.max_avatar_file_size_mib
+ page_params.max_avatar_file_size_mib,
);
}
};
diff --git a/static/js/billing/helpers.js b/static/js/billing/helpers.js
index b5484415b2f..e45ecff063c 100644
--- a/static/js/billing/helpers.js
+++ b/static/js/billing/helpers.js
@@ -71,7 +71,7 @@ exports.format_money = function (cents) {
exports.update_charged_amount = function (prices, schedule) {
$("#charged_amount").text(
- exports.format_money(page_params.seat_count * prices[schedule])
+ exports.format_money(page_params.seat_count * prices[schedule]),
);
};
diff --git a/static/js/blueslip_stacktrace.ts b/static/js/blueslip_stacktrace.ts
index 4d3cd09af23..566add53270 100644
--- a/static/js/blueslip_stacktrace.ts
+++ b/static/js/blueslip_stacktrace.ts
@@ -37,7 +37,7 @@ export function clean_path(full_path: string): string {
}
export function clean_function_name(
- function_name: string | undefined
+ function_name: string | undefined,
): { scope: string; name: string } | undefined {
if (function_name === undefined) {
return undefined;
@@ -78,7 +78,7 @@ export async function display_stacktrace(error: string, stack: string): Promise<
const location = await stack_trace_gps.getMappedLocation(
// Work around mistake in ErrorStackParser.StackFrame definition
// https://github.com/stacktracejs/error-stack-parser/pull/49
- (stack_frame as unknown) as StackFrame
+ (stack_frame as unknown) as StackFrame,
);
return {
full_path: location.getFileName(),
@@ -87,11 +87,11 @@ export async function display_stacktrace(error: string, stack: string): Promise<
function_name: clean_function_name(location.getFunctionName()),
context: await get_context(location),
};
- })
+ }),
);
const $alert = $("<div class='stacktrace'>").html(
- render_blueslip_stacktrace({ error, stackframes })
+ render_blueslip_stacktrace({ error, stackframes }),
);
$(".alert-box").append($alert);
$alert.addClass("show");
diff --git a/static/js/buddy_data.js b/static/js/buddy_data.js
index 2f44980d604..8d1a6d1d3fe 100644
--- a/static/js/buddy_data.js
+++ b/static/js/buddy_data.js
@@ -220,7 +220,7 @@ exports.get_title_data = function (user_ids_string, is_group) {
if (bot_owner) {
const bot_owner_name = i18n.t(
'Owner: __name__',
- {name: bot_owner.full_name}
+ {name: bot_owner.full_name},
);
return {
diff --git a/static/js/click_handlers.js b/static/js/click_handlers.js
index dad439964dd..4595fc85660 100644
--- a/static/js/click_handlers.js
+++ b/static/js/click_handlers.js
@@ -607,10 +607,10 @@ exports.initialize = function () {
// NB: This just binds to current elements, and won't bind to elements
// created after ready() is called.
$('#compose-send-status .compose-send-status-close').click(
- () => { $('#compose-send-status').stop(true).fadeOut(500); }
+ () => { $('#compose-send-status').stop(true).fadeOut(500); },
);
$('#nonexistent_stream_reply_error .compose-send-status-close').click(
- () => { $('#nonexistent_stream_reply_error').stop(true).fadeOut(500); }
+ () => { $('#nonexistent_stream_reply_error').stop(true).fadeOut(500); },
);
diff --git a/static/js/components.js b/static/js/components.js
index 20cab11f3c8..55da7285d8d 100644
--- a/static/js/components.js
+++ b/static/js/components.js
@@ -55,7 +55,7 @@ exports.toggle = function (opts) {
if (opts.callback) {
opts.callback(
opts.values[idx].label,
- opts.values[idx].key
+ opts.values[idx].key,
);
}
diff --git a/static/js/compose.js b/static/js/compose.js
index f7e6ec0fe9b..487fef9b75f 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;
@@ -1118,7 +1118,7 @@ exports.initialize = function () {
window.location.host +
"/calls/zoom/register",
"_blank",
- "width=800,height=500,noopener,noreferrer"
+ "width=800,height=500,noopener,noreferrer",
);
}
} else if (
diff --git a/static/js/compose_ui.js b/static/js/compose_ui.js
index 429aa33416b..ac6338f208a 100644
--- a/static/js/compose_ui.js
+++ b/static/js/compose_ui.js
@@ -68,7 +68,7 @@ exports.replace_syntax = function (old_syntax, new_syntax, textarea) {
// replace() function treating `$`s in new_syntax as special syntax. See
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#Description
// for details.
- new_syntax
+ new_syntax,
));
};
diff --git a/static/js/composebox_typeahead.js b/static/js/composebox_typeahead.js
index 3497a41aefc..4cb500757de 100644
--- a/static/js/composebox_typeahead.js
+++ b/static/js/composebox_typeahead.js
@@ -496,7 +496,7 @@ exports.get_person_suggestions = function (query, opts) {
const cutoff_length = exports.max_num_items;
const filtered_message_persons = filter_persons(
- people.get_active_message_people()
+ people.get_active_message_people(),
);
let filtered_persons;
@@ -505,7 +505,7 @@ exports.get_person_suggestions = function (query, opts) {
filtered_persons = filtered_message_persons;
} else {
filtered_persons = filter_persons(
- people.get_realm_users()
+ people.get_realm_users(),
);
}
@@ -515,7 +515,7 @@ exports.get_person_suggestions = function (query, opts) {
opts.stream,
opts.topic,
filtered_groups,
- exports.max_num_items
+ exports.max_num_items,
);
};
diff --git a/static/js/debug.js b/static/js/debug.js
index 167b4856f12..161bd52a8cc 100644
--- a/static/js/debug.js
+++ b/static/js/debug.js
@@ -105,7 +105,7 @@ IterationProfiler.prototype = {
if (diff > 1) {
this.sections.set(
"_rest_of_iteration",
- (this.sections.get("_rest_of_iteration") || 0) + diff
+ (this.sections.get("_rest_of_iteration") || 0) + diff,
);
}
this.last_time = now;
diff --git a/static/js/drafts.js b/static/js/drafts.js
index 6e510fcb994..d7944c0b812 100644
--- a/static/js/drafts.js
+++ b/static/js/drafts.js
@@ -175,7 +175,7 @@ exports.restore_draft = function (draft_id) {
{operator: "stream", operand: compose_args.stream},
{operator: "topic", operand: compose_args.topic},
],
- {trigger: "restore draft"}
+ {trigger: "restore draft"},
);
}
} else {
@@ -184,7 +184,7 @@ exports.restore_draft = function (draft_id) {
[
{operator: "pm-with", operand: compose_args.private_message_recipient},
],
- {trigger: "restore draft"}
+ {trigger: "restore draft"},
);
}
}
@@ -319,7 +319,7 @@ exports.launch = function () {
const unsorted_raw_drafts = Object.values(data);
const sorted_raw_drafts = unsorted_raw_drafts.sort(
- (draft_a, draft_b) => draft_b.updatedAt - draft_a.updatedAt
+ (draft_a, draft_b) => draft_b.updatedAt - draft_a.updatedAt,
);
const sorted_formatted_drafts = sorted_raw_drafts.map(exports.format_draft).filter(Boolean);
diff --git a/static/js/emoji_picker.js b/static/js/emoji_picker.js
index 20988b2d670..a54d53a34e7 100644
--- a/static/js/emoji_picker.js
+++ b/static/js/emoji_picker.js
@@ -104,7 +104,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) =>
- emoji.emojis_by_name.get(realm_emoji_name)
+ emoji.emojis_by_name.get(realm_emoji_name),
));
for (const [category, codepoints] of Object.entries(emoji_codes.emoji_catalog)) {
@@ -730,7 +730,7 @@ exports.register_click_handlers = function () {
$emoji_map,
emoji_coordinates.section,
emoji_coordinates.index,
- true
+ true,
);
});
};
diff --git a/static/js/filter.js b/static/js/filter.js
index 4d68156a330..e2f4df9395d 100644
--- a/static/js/filter.js
+++ b/static/js/filter.js
@@ -362,7 +362,7 @@ Filter.prototype = {
page_params.narrow_stream !== undefined &&
value.operator === "stream" &&
value.operand.toLowerCase() === page_params.narrow_stream.toLowerCase()
- )
+ ),
);
return safe_to_return;
},
@@ -376,13 +376,13 @@ 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),
);
},
@@ -750,7 +750,7 @@ Filter.prototype = {
term.operand = people.update_email_in_reply_to(
term.operand,
user_id,
- new_email
+ new_email,
);
}
}
diff --git a/static/js/hotspots.js b/static/js/hotspots.js
index 67bd8d44f51..05d2f21d12d 100644
--- a/static/js/hotspots.js
+++ b/static/js/hotspots.js
@@ -96,7 +96,7 @@ function place_popover(hotspot) {
$(hotspot.location.element),
popover_height,
popover_width,
- false
+ false,
);
switch (orientation) {
@@ -151,7 +151,7 @@ function place_popover(hotspot) {
default:
blueslip.error(
'Invalid popover placement value for hotspot \'' +
- hotspot.name + '\''
+ hotspot.name + '\'',
);
break;
}
@@ -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/lightbox.js b/static/js/lightbox.js
index 95a821991fa..b27b1a15e41 100644
--- a/static/js/lightbox.js
+++ b/static/js/lightbox.js
@@ -70,7 +70,7 @@ function display_video(payload) {
// Use data: to load the player in a unique origin for security.
source = "data:text/html," + window.encodeURIComponent(
"<!DOCTYPE html><style>iframe{position:absolute;left:0;top:0;width:100%;height:100%;box-sizing:border-box}</style>" +
- payload.source
+ payload.source,
);
}
diff --git a/static/js/list_render.js b/static/js/list_render.js
index 38785168e25..1246ea74774 100644
--- a/static/js/list_render.js
+++ b/static/js/list_render.js
@@ -39,7 +39,7 @@ exports.get_filtered_items = (value, list, opts) => {
if (get_item) {
return opts.filter.filterer(
list.map(get_item),
- value
+ value,
);
}
return opts.filter.filterer(list, value);
@@ -159,12 +159,12 @@ exports.create = function ($container, list, opts) {
meta.filtered_list = exports.get_filtered_items(
meta.filter_value,
meta.list,
- opts
+ opts,
);
if (meta.sorting_function) {
meta.filtered_list.sort(
- meta.sorting_function
+ meta.sorting_function,
);
}
diff --git a/static/js/message_edit.js b/static/js/message_edit.js
index ba95ee1975d..9c5a47239ee 100644
--- a/static/js/message_edit.js
+++ b/static/js/message_edit.js
@@ -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_list_data.js b/static/js/message_list_data.js
index 6fc14551e8c..5dc868e5d8f 100644
--- a/static/js/message_list_data.js
+++ b/static/js/message_list_data.js
@@ -170,7 +170,7 @@ MessageListData.prototype = {
return messages.filter(
(message) =>
!muting.is_topic_muted(message.stream_id, message.topic) ||
- message.mentioned
+ message.mentioned,
);
},
@@ -345,7 +345,7 @@ MessageListData.prototype = {
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.js
index bd5d0e74142..17b46348acd 100644
--- a/static/js/message_list_view.js
+++ b/static/js/message_list_view.js
@@ -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,
);
},
@@ -1100,7 +1100,7 @@ MessageListView.prototype = {
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 muted
message_containers = message_containers.filter(
- (message_container) => message_container !== undefined
+ (message_container) => message_container !== undefined,
);
const message_groups = [];
diff --git a/static/js/narrow.js b/static/js/narrow.js
index dd6e2ee6c03..96ff43e7a67 100644
--- a/static/js/narrow.js
+++ b/static/js/narrow.js
@@ -435,7 +435,7 @@ exports.maybe_add_local_messages = function (opts) {
// need to look at unread here.
id_info.final_select_id = min_defined(
id_info.target_id,
- unread_info.msg_id
+ unread_info.msg_id,
);
if (!load_local_messages(msg_data)) {
@@ -601,7 +601,7 @@ exports.narrow_to_next_topic = function () {
const next_narrow = topic_generator.get_next_topic(
curr_info.stream,
- curr_info.topic
+ curr_info.topic,
);
if (!next_narrow) {
diff --git a/static/js/notifications.js b/static/js/notifications.js
index a6f31b1638a..1c587c73c51 100644
--- a/static/js/notifications.js
+++ b/static/js/notifications.js
@@ -28,8 +28,8 @@ if (window.electron_bridge && window.electron_bridge.new_notification) {
Object.assign(
this,
window.electron_bridge.new_notification(title, options, (type, eventInit) =>
- this.dispatchEvent(new Event(type, eventInit))
- )
+ this.dispatchEvent(new Event(type, eventInit)),
+ ),
);
}
diff --git a/static/js/people.js b/static/js/people.js
index 198f459c1fc..50319742ae6 100644
--- a/static/js/people.js
+++ b/static/js/people.js
@@ -63,7 +63,7 @@ exports.get_by_email = function (email) {
if (person.email.toLowerCase() !== email.toLowerCase()) {
blueslip.warn(
'Obsolete email passed to get_by_email: ' + email +
- ' new email = ' + person.email
+ ' new email = ' + person.email,
);
}
@@ -849,7 +849,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;
@@ -858,7 +858,7 @@ exports.get_message_people = function () {
exports.get_active_message_people = function () {
const message_people = exports.get_message_people();
const active_message_people = message_people.filter((item) =>
- active_user_dict.has(item.user_id)
+ active_user_dict.has(item.user_id),
);
return active_message_people;
};
diff --git a/static/js/portico/desktop-login.js b/static/js/portico/desktop-login.js
index 2fdc60a7894..cb1a777cde3 100644
--- a/static/js/portico/desktop-login.js
+++ b/static/js/portico/desktop-login.js
@@ -16,14 +16,14 @@ async function decrypt_manual() {
document.querySelector("#submit").disabled = tokenElement.value === "";
try {
const data = new Uint8Array(
- tokenElement.value.match(/../g).map((b) => parseInt(b, 16))
+ tokenElement.value.match(/../g).map((b) => parseInt(b, 16)),
);
const iv = data.slice(0, 12);
const ciphertext = data.slice(12);
const plaintext = await crypto.subtle.decrypt(
{ name: "AES-GCM", iv },
key,
- ciphertext
+ ciphertext,
);
resolve(new TextDecoder().decode(plaintext));
} catch {
@@ -50,7 +50,7 @@ async function decrypt_manual() {
(window.location.search ? window.location.search + "&" : "?") +
"desktop_flow_otp=" +
encodeURIComponent(keyHex),
- "_blank"
+ "_blank",
);
const token = await pasted;
diff --git a/static/js/portico/integrations.js b/static/js/portico/integrations.js
index 14753ef6fb5..182df3fecb9 100644
--- a/static/js/portico/integrations.js
+++ b/static/js/portico/integrations.js
@@ -91,7 +91,7 @@ function update_categories() {
$('.integration-lozenges').animate(
{ opacity: 1 },
- { duration: 400 }
+ { duration: 400 },
);
adjust_font_sizing();
@@ -174,11 +174,11 @@ function hide_catalog_show_integration() {
$("html, body").animate(
{ scrollTop: 0 },
- { duration: 200 }
+ { duration: 200 },
);
$('#integration-instructions-group').animate(
{ opacity: 1 },
- { duration: 300 }
+ { duration: 300 },
);
adjust_font_sizing();
@@ -207,7 +207,7 @@ function hide_integration_show_catalog() {
function show_catalog() {
$("html, body").animate(
{ scrollTop: 0 },
- { duration: 200 }
+ { duration: 200 },
);
$(".integration-categories-dropdown").css('display', '');
diff --git a/static/js/reactions.js b/static/js/reactions.js
index 312dc142f63..b072e0ebf03 100644
--- a/static/js/reactions.js
+++ b/static/js/reactions.js
@@ -53,7 +53,7 @@ function update_ui_and_send_reaction_ajax(message_id, reaction_info) {
const local_id = exports.get_local_reaction_id(reaction_info);
const has_reacted = exports.current_user_has_reacted_to_emoji(
message,
- local_id
+ local_id,
);
const operation = has_reacted ? 'remove' : 'add';
const reaction = create_reaction(message_id, reaction_info);
diff --git a/static/js/realm_icon.js b/static/js/realm_icon.js
index 53be4eb8691..68d3858b00f 100644
--- a/static/js/realm_icon.js
+++ b/static/js/realm_icon.js
@@ -24,7 +24,7 @@ exports.build_realm_icon_widget = function (upload_function) {
$("#realm-icon-upload-widget .image_file_input_error").expectOne(),
$("#realm-icon-upload-widget .image_upload_button").expectOne(),
upload_function,
- page_params.max_icon_file_size
+ page_params.max_icon_file_size,
);
};
diff --git a/static/js/realm_logo.js b/static/js/realm_logo.js
index efefcce9cca..26210e1f364 100644
--- a/static/js/realm_logo.js
+++ b/static/js/realm_logo.js
@@ -43,7 +43,7 @@ exports.build_realm_logo_widget = function (upload_function, is_night) {
file_input_error_elem.expectOne(),
upload_button_elem.expectOne(),
upload_function,
- page_params.max_logo_file_size
+ page_params.max_logo_file_size,
);
};
diff --git a/static/js/recent_senders.js b/static/js/recent_senders.js
index a93f776e6c9..02419a1e03e 100644
--- a/static/js/recent_senders.js
+++ b/static/js/recent_senders.js
@@ -114,7 +114,7 @@ exports.get_topic_recent_senders = function (stream_id, topic) {
}
const sorted_senders = Array.from(sender_message_ids.entries()).sort(
- (s1, s2) => s1[1] - s2[1]
+ (s1, s2) => s1[1] - s2[1],
);
const recent_senders = [];
for (const item of sorted_senders) {
diff --git a/static/js/recent_topics.js b/static/js/recent_topics.js
index c5153bca91d..39c0cf732b5 100644
--- a/static/js/recent_topics.js
+++ b/static/js/recent_topics.js
@@ -140,7 +140,7 @@ exports.reify_message_id_if_available = function (opts) {
function get_sorted_topics() {
// Sort all recent topics by last message time.
return new Map(
- Array.from(topics.entries()).sort((a, b) => b[1].last_msg_id - a[1].last_msg_id)
+ Array.from(topics.entries()).sort((a, b) => b[1].last_msg_id - a[1].last_msg_id),
);
}
diff --git a/static/js/reminder.js b/static/js/reminder.js
index a5ba1040acc..a401b9fe46f 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];
@@ -67,7 +67,7 @@ exports.schedule_message = function (request) {
}
request = patch_request_for_scheduling(
- request, message, deliver_at, deferred_message_type.delivery_type
+ request, message, deliver_at, deferred_message_type.delivery_type,
);
const success = function (data) {
@@ -143,7 +143,7 @@ exports.do_set_reminder_for_message = function (message_id, timestamp) {
reminder_message = patch_request_for_scheduling(
reminder_message, reminder_msg_content, timestamp,
- deferred_message_types.reminders.delivery_type
+ deferred_message_types.reminders.delivery_type,
);
transmit.send_message(reminder_message, success, error);
};
diff --git a/static/js/scroll_util.js b/static/js/scroll_util.js
index 88c6cf53321..341c57c9b81 100644
--- a/static/js/scroll_util.js
+++ b/static/js/scroll_util.js
@@ -35,14 +35,14 @@ exports.scroll_delta = function (opts) {
if (elem_top < 0) {
delta = Math.max(
elem_top,
- elem_bottom - container_height
+ elem_bottom - container_height,
);
delta = Math.min(0, delta);
} else {
if (elem_bottom > container_height) {
delta = Math.min(
elem_top,
- elem_bottom - container_height
+ elem_bottom - container_height,
);
delta = Math.max(0, delta);
}
diff --git a/static/js/server_events.js b/static/js/server_events.js
index cd7983c4488..74ff9b61aeb 100644
--- a/static/js/server_events.js
+++ b/static/js/server_events.js
@@ -100,7 +100,7 @@ function get_events_success(events) {
messages.forEach(message_store.set_message_booleans);
const sent_by_this_client = messages.some((msg) =>
- sent_messages.messages.has(msg.local_id)
+ sent_messages.messages.has(msg.local_id),
);
// If some message in this batch of events was sent by this
// client, almost every time, this message will be the only one
diff --git a/static/js/server_events_dispatch.js b/static/js/server_events_dispatch.js
index 3385c5e7436..d607ca5cad8 100644
--- a/static/js/server_events_dispatch.js
+++ b/static/js/server_events_dispatch.js
@@ -376,7 +376,7 @@ exports.dispatch_normal_event = function dispatch_normal_event(event) {
stream_events.update_property(
event.stream_id,
event.property,
- event.value
+ event.value,
);
}
break;
diff --git a/static/js/settings_config.js b/static/js/settings_config.js
index daee61a0eb3..0f7bc107612 100644
--- a/static/js/settings_config.js
+++ b/static/js/settings_config.js
@@ -262,12 +262,12 @@ const other_notification_settings = desktop_notification_settings.concat(
mobile_notification_settings,
email_notification_settings,
presence_notification_settings,
- ["notification_sound"]
+ ["notification_sound"],
);
exports.all_notification_settings = other_notification_settings.concat(
pm_mention_notification_settings,
- exports.stream_notification_settings
+ exports.stream_notification_settings,
);
exports.all_notifications = () => ({
diff --git a/static/js/settings_emoji.js b/static/js/settings_emoji.js
index f8ca8de9248..cbdeb28a0ac 100644
--- a/static/js/settings_emoji.js
+++ b/static/js/settings_emoji.js
@@ -130,7 +130,7 @@ exports.build_emoji_upload_widget = function () {
clear_button,
upload_button,
preview_text,
- preview_image
+ preview_image,
);
};
diff --git a/static/js/settings_exports.js b/static/js/settings_exports.js
index 9a6e06a3ece..1113771f855 100644
--- a/static/js/settings_exports.js
+++ b/static/js/settings_exports.js
@@ -33,13 +33,13 @@ exports.populate_exports_table = function (exports) {
if (failed_timestamp !== null) {
failed_timestamp = timerender.last_seen_status_from_date(
- new XDate(failed_timestamp * 1000)
+ new XDate(failed_timestamp * 1000),
);
}
if (deleted_timestamp !== null) {
deleted_timestamp = timerender.last_seen_status_from_date(
- new XDate(deleted_timestamp * 1000)
+ new XDate(deleted_timestamp * 1000),
);
}
@@ -49,7 +49,7 @@ exports.populate_exports_table = function (exports) {
acting_user: people.get_full_name(data.acting_user_id),
// Convert seconds -> milliseconds
event_time: timerender.last_seen_status_from_date(
- new XDate(data.export_time * 1000)
+ new XDate(data.export_time * 1000),
),
url: data.export_url,
time_failed: failed_timestamp,
diff --git a/static/js/settings_notifications.js b/static/js/settings_notifications.js
index 5391f8da996..dc17398105f 100644
--- a/static/js/settings_notifications.js
+++ b/static/js/settings_notifications.js
@@ -105,7 +105,7 @@ exports.set_up = function () {
$("#send_test_notification").click(() => {
notifications.send_test_notification(
- i18n.t("This is what a Zulip notification looks like.")
+ i18n.t("This is what a Zulip notification looks like."),
);
});
diff --git a/static/js/settings_org.js b/static/js/settings_org.js
index d8a604f6977..1e5ab811f43 100644
--- a/static/js/settings_org.js
+++ b/static/js/settings_org.js
@@ -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) {
@@ -279,7 +279,7 @@ exports.populate_realm_domains = function (realm_domains) {
realm_domains_table_body.append(
render_settings_admin_realm_domains_list({
realm_domain: realm_domain,
- })
+ }),
);
}
};
@@ -680,7 +680,7 @@ exports.build_page = function () {
data.allow_message_editing = true;
data.message_content_edit_limit_seconds =
settings_config.msg_edit_limit_dropdown_values.get(
- edit_limit_setting_value
+ edit_limit_setting_value,
).seconds;
}
const delete_limit_setting_value = $("#id_realm_msg_delete_limit_setting").val();
@@ -694,7 +694,7 @@ exports.build_page = function () {
data.allow_message_deleting = true;
data.message_content_delete_limit_seconds =
settings_config.msg_delete_limit_dropdown_values.get(
- delete_limit_setting_value
+ delete_limit_setting_value,
).seconds;
}
} else if (subsection === 'notifications') {
@@ -1011,7 +1011,7 @@ exports.build_page = function () {
url: '/json/realm/deactivate',
error: function (xhr) {
ui_report.error(
- i18n.t("Failed"), xhr, $('#admin-realm-deactivation-status').expectOne()
+ i18n.t("Failed"), xhr, $('#admin-realm-deactivation-status').expectOne(),
);
},
});
diff --git a/static/js/settings_profile_fields.js b/static/js/settings_profile_fields.js
index 5dc624270b1..0306f359325 100644
--- a/static/js/settings_profile_fields.js
+++ b/static/js/settings_profile_fields.js
@@ -244,7 +244,7 @@ function set_up_choices_field_edit_form(profile_field, field_data) {
choice_list.append(
render_settings_profile_field_choice({
text: choice.text,
- })
+ }),
);
}
@@ -369,7 +369,7 @@ exports.do_populate_profile_fields = function (profile_fields_data) {
},
can_modify: page_params.is_admin,
realm_default_external_accounts: page_params.realm_default_external_accounts,
- })
+ }),
);
}
diff --git a/static/js/settings_user_groups.js b/static/js/settings_user_groups.js
index f1115177890..7e0293e3662 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.js
index afe110a441a..cfbb9315e50 100644
--- a/static/js/settings_users.js
+++ b/static/js/settings_users.js
@@ -24,7 +24,7 @@ function sort_email(a, b) {
const email_b = settings_data.email_for_user_settings(b) || '';
return compare_a_b(
email_a.toLowerCase(),
- email_b.toLowerCase()
+ email_b.toLowerCase(),
);
}
@@ -52,14 +52,14 @@ function sort_bot_owner(a, b) {
return compare_a_b(
owner_name(a),
- owner_name(b)
+ owner_name(b),
);
}
function sort_last_active(a, b) {
return compare_a_b(
presence.last_active_date(a.user_id) || 0,
- presence.last_active_date(b.user_id) || 0
+ presence.last_active_date(b.user_id) || 0,
);
}
@@ -401,7 +401,7 @@ function open_human_form(person) {
element,
user_id,
true,
- false
+ false,
);
return {
diff --git a/static/js/stats/stats.js b/static/js/stats/stats.js
index c656b075061..ad26331bd57 100644
--- a/static/js/stats/stats.js
+++ b/static/js/stats/stats.js
@@ -170,7 +170,7 @@ function populate_messages_sent_over_time(data) {
const start_dates = data.end_times.map((timestamp) =>
// data.end_times are the ends of hour long intervals.
- new Date(timestamp * 1000 - 60 * 60 * 1000)
+ new Date(timestamp * 1000 - 60 * 60 * 1000),
);
function aggregate_data(aggregation) {
@@ -322,8 +322,8 @@ function round_to_percentages(values, total) {
6, // this is the max precision (two #, 4 decimal points; 99.9999%).
Math.max(
2, // the minimum amount of precision (40% or 6.0%).
- Math.floor(-Math.log10(100 - unrounded)) + 3
- )
+ Math.floor(-Math.log10(100 - unrounded)) + 3,
+ ),
);
return unrounded.toPrecision(precision) + '%';
@@ -528,7 +528,7 @@ function populate_messages_sent_by_message_type(data) {
const plot_data = compute_summary_chart_data(
time_series_data,
num_steps,
- data.display_order
+ data.display_order,
);
const labels = [];
for (let i = 0; i < plot_data.labels.length; i += 1) {
@@ -800,7 +800,7 @@ function populate_messages_read_over_time(data) {
const start_dates = data.end_times.map((timestamp) =>
// data.end_times are the ends of hour long intervals.
- new Date(timestamp * 1000 - 60 * 60 * 1000)
+ new Date(timestamp * 1000 - 60 * 60 * 1000),
);
function aggregate_data(aggregation) {
@@ -949,25 +949,25 @@ function get_chart_data(data, callback) {
get_chart_data(
{chart_name: 'messages_sent_over_time', min_length: '10'},
- populate_messages_sent_over_time
+ populate_messages_sent_over_time,
);
get_chart_data(
{chart_name: 'messages_sent_by_client', min_length: '10'},
- populate_messages_sent_by_client
+ populate_messages_sent_by_client,
);
get_chart_data(
{chart_name: 'messages_sent_by_message_type', min_length: '10'},
- populate_messages_sent_by_message_type
+ populate_messages_sent_by_message_type,
);
get_chart_data(
{chart_name: 'number_of_humans', min_length: '10'},
- populate_number_of_users
+ populate_number_of_users,
);
get_chart_data(
{chart_name: 'messages_read_over_time', min_length: '10'},
- populate_messages_read_over_time
+ populate_messages_read_over_time,
);
diff --git a/static/js/stream_data.js b/static/js/stream_data.js
index 25080554203..fe9111ef0c6 100644
--- a/static/js/stream_data.js
+++ b/static/js/stream_data.js
@@ -318,7 +318,7 @@ 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)
+ !exports.is_default_stream_id(sub.stream_id) && (sub.subscribed || !sub.invite_only),
);
const names = subs.map((sub) => sub.name);
return names;
diff --git a/static/js/stream_edit.js b/static/js/stream_edit.js
index 8dbb8fc78a0..e2227d8b983 100644
--- a/static/js/stream_edit.js
+++ b/static/js/stream_edit.js
@@ -175,7 +175,7 @@ exports.update_stream_description = function (sub) {
const stream_settings = exports.settings_for_sub(sub);
stream_settings.find('input.description').val(sub.description);
stream_settings.find('.stream-description-editable').html(
- util.clean_user_content_links(sub.rendered_description)
+ util.clean_user_content_links(sub.rendered_description),
);
};
@@ -569,7 +569,7 @@ exports.change_stream_description = function (e) {
},
error: function (xhr) {
sub_settings.find('.stream-description-editable').html(
- util.clean_user_content_links(sub.rendered_description)
+ util.clean_user_content_links(sub.rendered_description),
);
ui_report.error(i18n.t("Error"), xhr, $(".stream_change_property_info"));
},
diff --git a/static/js/stream_popover.js b/static/js/stream_popover.js
index 347ebddd943..a1ffdf84d0f 100644
--- a/static/js/stream_popover.js
+++ b/static/js/stream_popover.js
@@ -594,7 +594,7 @@ exports.register_topic_handlers = function () {
num_after: 0,
narrow: JSON.stringify(
[{operator: "stream", operand: current_stream_id},
- {operator: "topic", operand: old_topic_name}]
+ {operator: "topic", operand: old_topic_name}],
),
};
diff --git a/static/js/templates.js b/static/js/templates.js
index ca0679fb1f0..2e596283f0e 100644
--- a/static/js/templates.js
+++ b/static/js/templates.js
@@ -89,7 +89,7 @@ Handlebars.registerHelper('tr', (context, options) => {
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.js
index f6102166e40..375f7878507 100644
--- a/static/js/topic_generator.js
+++ b/static/js/topic_generator.js
@@ -222,7 +222,7 @@ exports.get_next_topic = function (curr_stream, curr_topic) {
get_unmuted_topics,
has_unread_messages,
curr_stream,
- curr_topic
+ curr_topic,
);
};
diff --git a/static/js/typeahead_helper.js b/static/js/typeahead_helper.js
index cf37535916e..4015b01d330 100644
--- a/static/js/typeahead_helper.js
+++ b/static/js/typeahead_helper.js
@@ -243,7 +243,7 @@ exports.sort_people_for_relevance = function (objs, current_stream_name, current
objs.sort((person_a, person_b) => exports.compare_people_for_relevance(
person_a,
person_b,
- exports.compare_by_pms
+ exports.compare_by_pms,
));
} else {
const stream_id = current_stream.stream_id;
@@ -255,9 +255,9 @@ exports.sort_people_for_relevance = function (objs, current_stream_name, current
user_a,
user_b,
stream_id,
- current_topic
+ current_topic,
),
- current_stream.name
+ current_stream.name,
));
}
@@ -296,7 +296,7 @@ exports.sort_recipients = function (
current_stream,
current_topic,
groups,
- max_num_items
+ max_num_items,
) {
if (!groups) {
groups = [];
diff --git a/static/js/typing_events.js b/static/js/typing_events.js
index 36ad04b0791..617dbb0fa97 100644
--- a/static/js/typing_events.js
+++ b/static/js/typing_events.js
@@ -78,7 +78,7 @@ exports.display_notification = function (event) {
TYPING_STARTED_EXPIRY_PERIOD,
() => {
exports.hide_notification(event);
- }
+ },
);
};
window.typing_events = exports;
diff --git a/static/js/ui.js b/static/js/ui.js
index bb19e6e9450..9755af9d6c1 100644
--- a/static/js/ui.js
+++ b/static/js/ui.js
@@ -141,7 +141,7 @@ exports.get_hotkey_deprecation_notice = function (originalHotkey, replacementHot
return i18n.t(
'We\'ve replaced the "__originalHotkey__" hotkey with "__replacementHotkey__" '
+ 'to make this common shortcut easier to trigger.',
- { originalHotkey: originalHotkey, replacementHotkey: replacementHotkey }
+ { originalHotkey: originalHotkey, replacementHotkey: replacementHotkey },
);
};
diff --git a/static/js/ui_init.js b/static/js/ui_init.js
index b8d6ab83c53..f26e6ab58a1 100644
--- a/static/js/ui_init.js
+++ b/static/js/ui_init.js
@@ -224,7 +224,7 @@ exports.initialize_kitchen_sink_stuff = function () {
selected_id_from_idx: messages[event.msg_list.selected_idx()].id,
msg_list_sorted: _.isEqual(
messages.map((message) => message.id),
- _.chain(current_msg_list.all_messages()).pluck('id').clone().value().sort()
+ _.chain(current_msg_list.all_messages()).pluck('id').clone().value().sort(),
),
found_in_dom: row_from_dom.length,
});
@@ -386,41 +386,41 @@ exports.initialize_everything = function () {
}
const alert_words_params = pop_fields(
- 'alert_words'
+ 'alert_words',
);
const bot_params = pop_fields(
- 'realm_bots'
+ 'realm_bots',
);
const people_params = pop_fields(
'realm_users',
'realm_non_active_users',
- 'cross_realm_bots'
+ 'cross_realm_bots',
);
const pm_conversations_params = pop_fields(
- 'recent_private_conversations'
+ 'recent_private_conversations',
);
const presence_params = pop_fields(
'presences',
- 'initial_servertime'
+ 'initial_servertime',
);
const stream_data_params = pop_fields(
'subscriptions',
'unsubscribed',
'never_subscribed',
- 'realm_default_streams'
+ 'realm_default_streams',
);
const user_groups_params = pop_fields(
- 'realm_user_groups'
+ 'realm_user_groups',
);
const user_status_params = pop_fields(
- 'user_status'
+ 'user_status',
);
alert_words.initialize(alert_words_params);
@@ -459,7 +459,7 @@ exports.initialize_everything = function () {
emoji.initialize();
markdown.initialize(
page_params.realm_filters,
- markdown_config.get_helpers()
+ markdown_config.get_helpers(),
);
compose.initialize();
composebox_typeahead.initialize(); // Must happen after compose.initialize()
diff --git a/static/js/ui_report.js b/static/js/ui_report.js
index 4ba85cba9a3..62b9bb89202 100644
--- a/static/js/ui_report.js
+++ b/static/js/ui_report.js
@@ -50,7 +50,7 @@ exports.generic_embed_error = function (error) {
exports.generic_row_button_error = function (xhr, btn) {
if (xhr.status.toString().charAt(0) === "4") {
btn.closest("td").html(
- $("<p>").addClass("text-error").text(JSON.parse(xhr.responseText).msg)
+ $("<p>").addClass("text-error").text(JSON.parse(xhr.responseText).msg),
);
} else {
btn.text(i18n.t("Failed!"));
diff --git a/static/js/unread.js b/static/js/unread.js
index dfeb9df0bf7..dd8e970bf53 100644
--- a/static/js/unread.js
+++ b/static/js/unread.js
@@ -404,13 +404,13 @@ exports.update_unread_topics = function (msg, event) {
}
exports.unread_topic_counter.delete(
- msg.id
+ msg.id,
);
exports.unread_topic_counter.add(
new_stream_id || msg.stream_id,
new_topic || msg.topic,
- msg.id
+ msg.id,
);
};
@@ -430,7 +430,7 @@ exports.process_loaded_messages = function (messages) {
exports.unread_topic_counter.add(
message.stream_id,
message.topic,
- message.id
+ message.id,
);
}
diff --git a/static/js/upload.js b/static/js/upload.js
index 105c894074b..70589938273 100644
--- a/static/js/upload.js
+++ b/static/js/upload.js
@@ -162,7 +162,7 @@ exports.setup_upload = function (config) {
timedOut: i18n.t('Upload stalled for %{seconds} seconds, aborting.'),
},
},
- }
+ },
);
uppy.use(ProgressBar, {
diff --git a/static/js/upload_widget.js b/static/js/upload_widget.js
index dcb585e8879..192223b3105 100644
--- a/static/js/upload_widget.js
+++ b/static/js/upload_widget.js
@@ -23,7 +23,7 @@ exports.build_widget = function (
upload_button, // jQuery button to open file dialog
preview_text = null,
preview_image = null,
- max_file_upload_size
+ max_file_upload_size,
) {
// default value of max uploaded file size
max_file_upload_size = max_file_upload_size || default_max_file_size;
@@ -119,7 +119,7 @@ exports.build_direct_upload_widget = function (
input_error, // jQuery object for error text
upload_button, // jQuery button to open file dialog
upload_function,
- max_file_upload_size
+ max_file_upload_size,
) {
// default value of max uploaded file size
max_file_upload_size = max_file_upload_size || default_max_file_size;
diff --git a/static/js/vdom.js b/static/js/vdom.js
index 93fc3a4c4bc..18e856edb70 100644
--- a/static/js/vdom.js
+++ b/static/js/vdom.js
@@ -126,7 +126,7 @@ exports.update = (replace_content, find, new_dom, old_dom) => {
const same_structure = exports.eq_array(
new_opts.keyed_nodes,
old_opts.keyed_nodes,
- (a, b) => a.key === b.key
+ (a, b) => a.key === b.key,
);
if (!same_structure) {
@@ -161,7 +161,7 @@ exports.update = (replace_content, find, new_dom, old_dom) => {
exports.update_attrs(
find(),
new_opts.attrs,
- old_opts.attrs
+ old_opts.attrs,
);
};
diff --git a/static/js/zform.js b/static/js/zform.js
index c26560ec96d..9e78e128ed0 100644
--- a/static/js/zform.js
+++ b/static/js/zform.js
@@ -15,7 +15,7 @@ exports.validate_extra_data = function (data) {
return schema.check_array(
field_name,
val,
- check_choice_item
+ check_choice_item,
);
}
diff --git a/static/shared/js/typeahead.js b/static/shared/js/typeahead.js
index 3667a79bc96..dac446245c5 100644
--- a/static/shared/js/typeahead.js
+++ b/static/shared/js/typeahead.js
@@ -167,7 +167,7 @@ export function sort_emojis(objs, query) {
const triage_results = triage(
query,
others,
- (x) => x.emoji_name
+ (x) => x.emoji_name,
);
return [
diff --git a/static/shared/js/typing_status.js b/static/shared/js/typing_status.js
index c0e11b19709..c308969ce98 100644
--- a/static/shared/js/typing_status.js
+++ b/static/shared/js/typing_status.js
@@ -48,7 +48,7 @@ export function start_or_extend_idle_timer(worker) {
}
state.idle_timer = setTimeout(
on_idle_timeout,
- TYPING_STOPPED_WAIT_PERIOD
+ TYPING_STOPPED_WAIT_PERIOD,
);
}
diff --git a/tools/debug-require-webpack-plugin.ts b/tools/debug-require-webpack-plugin.ts
index 36f23e340c9..a665d62c8ed 100644
--- a/tools/debug-require-webpack-plugin.ts
+++ b/tools/debug-require-webpack-plugin.ts
@@ -47,10 +47,10 @@ export default class DebugRequirePlugin {
__dirname,
"./debug-require.js",
{},
- (err?: Error, result?: string) => err ? reject(err) : resolve(result)
- )
+ (err?: Error, result?: string) => err ? reject(err) : resolve(result),
+ ),
);
- }
+ },
);
compiler.hooks.compilation.tap("DebugRequirePlugin", (compilation: any) => {
@@ -72,7 +72,7 @@ export default class DebugRequirePlugin {
}
return false;
},
- () => true
+ () => true,
);
if (debugRequireId === undefined) {
@@ -84,10 +84,10 @@ export default class DebugRequirePlugin {
return Template.asString([
source,
`${requireFn}(${JSON.stringify(
- debugRequireId
+ debugRequireId,
)}).initialize(${JSON.stringify(Object.fromEntries(ids), null, "\t")});`,
]);
- }
+ },
);
});
}