From 0c6175f27e034978d25762494688e277209084ec Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Sat, 5 Jan 2019 15:29:31 -0800 Subject: [PATCH] lint: Enforce semicolon spacing in eslint. We only had a few exceptions to this rule; the zjquery one was actually a bug. --- .eslintrc.json | 1 + frontend_tests/zjsunit/zjquery.js | 2 +- static/js/message_edit.js | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 5f3ccc170a..a5b4d41c7e 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -384,6 +384,7 @@ "quotes": [ 0, "single" ], "radix": 2, "semi": 2, + "semi-spacing": [2, {"before": false, "after": true}], "space-before-blocks": 2, "space-before-function-paren": [ "error", { diff --git a/frontend_tests/zjsunit/zjquery.js b/frontend_tests/zjsunit/zjquery.js index 48c636750f..ab3663ee02 100644 --- a/frontend_tests/zjsunit/zjquery.js +++ b/frontend_tests/zjsunit/zjquery.js @@ -210,7 +210,7 @@ exports.make_new_elem = function (selector, opts) { }, focusout: function () { focused = false; - return ; + return self; }, get: function (idx) { // We have some legacy code that does $('foo').get(0). diff --git a/static/js/message_edit.js b/static/js/message_edit.js index 33121208a4..4a0ce99568 100644 --- a/static/js/message_edit.js +++ b/static/js/message_edit.js @@ -392,7 +392,8 @@ function edit_message(row, raw_content) { // Scroll to keep the message content in the same place var edit_top = message_edit_content[0].getBoundingClientRect().top; - var scroll_by = edit_top - content_top + 5 /* border and padding */; + /* adjust for border and padding */ + var scroll_by = edit_top - content_top + 5; edit_obj.scrolled_by = scroll_by; message_viewport.scrollTop(message_viewport.scrollTop() + scroll_by);