diff --git a/static/js/composebox_typeahead.js b/static/js/composebox_typeahead.js index 7b337fc26e..a9fe7c866c 100644 --- a/static/js/composebox_typeahead.js +++ b/static/js/composebox_typeahead.js @@ -263,7 +263,7 @@ exports.content_typeahead_selected = function (item) { var rest = pieces[1]; if (this.completing === 'emoji') { - //leading and trailing spaces are required for emoji, except if it begins a message. + // leading and trailing spaces are required for emoji, except if it begins a message. if (beginning.lastIndexOf(":") === 0 || beginning.charAt(beginning.lastIndexOf(":") - 1) === " ") { beginning = beginning.replace(/:\S+$/, "") + ":" + item.emoji_name + ": "; } else { diff --git a/static/js/message_edit.js b/static/js/message_edit.js index 1c00bda6e4..4131a4726a 100644 --- a/static/js/message_edit.js +++ b/static/js/message_edit.js @@ -3,7 +3,7 @@ var exports = {}; var currently_editing_messages = {}; -//returns true if the edit task should end. +// Returns true if the edit task should end. exports.save = function (row, from_topic_edited_only) { var msg_list = current_msg_list; var message_id; @@ -79,7 +79,7 @@ function handle_edit_keydown(from_topic_edited_only, e) { message_edit.end(row); } } else if (e.target.id === "message_edit_topic" && code === 13) { - //hitting enter in topic field isn't so great. + // Hitting enter in topic field isn't so great. e.stopPropagation(); e.preventDefault(); } diff --git a/static/js/typeahead_helper.js b/static/js/typeahead_helper.js index 101100d9f1..fdc9782711 100644 --- a/static/js/typeahead_helper.js +++ b/static/js/typeahead_helper.js @@ -143,7 +143,7 @@ exports.sort_recipients = function (matches, query) { }; exports.sort_emojis = function (matches, query) { - //TODO: sort by category in v2 + // TODO: sort by category in v2 var results = prefix_sort(query, matches, function (x) { return x.emoji_name; }); return results.matches.concat(results.rest); }; diff --git a/tools/lint-all b/tools/lint-all index cd45b3c6fe..910afc6233 100755 --- a/tools/lint-all +++ b/tools/lint-all @@ -145,6 +145,8 @@ js_rules = [ # This rule is constructed with + to avoid triggering on itself {'pattern': " =" + '[^ =>~"]', 'description': 'Missing whitespace after "="'}, + {'pattern': '^[ ]*//[A-Za-z0-9]', + 'description': 'Missing space after // in comment'}, {'pattern': 'else{$', 'description': 'Missing space between else and {'}, ] + whitespace_rules