diff --git a/frontend_tests/casper_lib/common.js b/frontend_tests/casper_lib/common.js index b5465c01b1..825335640c 100644 --- a/frontend_tests/casper_lib/common.js +++ b/frontend_tests/casper_lib/common.js @@ -120,7 +120,7 @@ exports.check_form = function (form_selector, expected, test_name) { exports.then_send_message = function (type, params) { casper.waitForSelector('#compose-send-button:enabled'); casper.waitForSelector('#new_message_content', function () { - if(type === "stream") { + if (type === "stream") { casper.page.sendEvent('keypress', "c"); } else if (type === "private") { diff --git a/static/js/admin.js b/static/js/admin.js index f638bb888e..830e7d1fe7 100644 --- a/static/js/admin.js +++ b/static/js/admin.js @@ -232,7 +232,7 @@ exports.setup_page = function () { }); $("#id_realm_invite_required").change(function () { - if(this.checked) { + if (this.checked) { $("#id_realm_invite_by_admins_only").removeAttr("disabled"); $("#id_realm_invite_by_admins_only_label").removeClass("control-label-disabled"); } else { diff --git a/static/js/message_list_view.js b/static/js/message_list_view.js index 3a9df1f7b6..d58fe22127 100644 --- a/static/js/message_list_view.js +++ b/static/js/message_list_view.js @@ -551,7 +551,7 @@ MessageListView.prototype = { if (elem.is("div")) { new_messages_height += elem.height(); // starting from the last message, ignore message heights that weren't sent by me. - if(id_of_last_message_sent_by_us > -1) { + if (id_of_last_message_sent_by_us > -1) { distance_to_last_message_sent_by_me += elem.height(); return; } diff --git a/static/js/notifications.js b/static/js/notifications.js index 8dafa84dc9..b202a55dfa 100644 --- a/static/js/notifications.js +++ b/static/js/notifications.js @@ -104,7 +104,7 @@ exports.initialize = function () { return; } if (notifications_api.checkPermission() !== 0) { // 0 is PERMISSION_ALLOWED - if(tutorial.is_running()) { + if (tutorial.is_running()) { tutorial.defer(function () { notifications_api.requestPermission(function () { asked_permission_already = true; diff --git a/tools/lint-all b/tools/lint-all index 910afc6233..75eb2b52c6 100755 --- a/tools/lint-all +++ b/tools/lint-all @@ -147,6 +147,8 @@ js_rules = [ 'description': 'Missing whitespace after "="'}, {'pattern': '^[ ]*//[A-Za-z0-9]', 'description': 'Missing space after // in comment'}, + {'pattern': 'if[(]', + 'description': 'Missing space between if and ('}, {'pattern': 'else{$', 'description': 'Missing space between else and {'}, ] + whitespace_rules