From 80016006c4865291f35fc2e79db30fe86915158a Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 9 Aug 2016 09:55:14 +0200 Subject: [PATCH] Use and enforce "use strict"; for JS --- .eslintrc | 2 +- qutebrowser/javascript/scroll.js | 2 ++ qutebrowser/javascript/webelem.js | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.eslintrc b/.eslintrc index 70947143a..231bfe69f 100644 --- a/.eslintrc +++ b/.eslintrc @@ -45,5 +45,5 @@ rules: max-statements: [2, 30] no-bitwise: 2 quote-props: [2, "always"] - global-strict: 0 + strict: ["error", "global"] quotes: 0 diff --git a/qutebrowser/javascript/scroll.js b/qutebrowser/javascript/scroll.js index b948e3d8b..60bae2a89 100644 --- a/qutebrowser/javascript/scroll.js +++ b/qutebrowser/javascript/scroll.js @@ -17,6 +17,8 @@ * along with qutebrowser. If not, see . */ +"use strict"; + function _qutebrowser_scroll_to_perc(x, y) { var elem = document.documentElement; var x_px = window.scrollX; diff --git a/qutebrowser/javascript/webelem.js b/qutebrowser/javascript/webelem.js index 9163d6727..152f4baec 100644 --- a/qutebrowser/javascript/webelem.js +++ b/qutebrowser/javascript/webelem.js @@ -17,6 +17,7 @@ * along with qutebrowser. If not, see . */ +"use strict"; document._qutebrowser_elements = [];