From ad4c0ee52f6b6f01d3d55bed4f54e6f788f44cd5 Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Mon, 30 Nov 2015 23:53:25 -0800 Subject: [PATCH 1/2] Exempt getUID() from ESLint's no-bitwise rule [skip sauce] [skip validator] --- js/src/util.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/js/src/util.js b/js/src/util.js index 5cb8f810be..dba6e9bd6f 100644 --- a/js/src/util.js +++ b/js/src/util.js @@ -99,7 +99,9 @@ const Util = (($) => { getUID(prefix) { do { + /* eslint-disable no-bitwise */ prefix += ~~(Math.random() * 1000000) // "~~" acts like a faster Math.floor() here + /* eslint-enable no-bitwise */ } while (document.getElementById(prefix)) return prefix }, From 5deb734b530e62e8b0b9a4b6f251045e2c610a27 Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Thu, 24 Dec 2015 18:53:39 -0700 Subject: [PATCH 2/2] ESLint: enable no-bitwise rule [skip sauce] --- js/.eslintrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/.eslintrc b/js/.eslintrc index 427098c13d..e712f32474 100644 --- a/js/.eslintrc +++ b/js/.eslintrc @@ -10,7 +10,7 @@ // Possible Errors "comma-dangle": [2, "never"], "handle-callback-err": 2, - "no-bitwise": 0, + "no-bitwise": 2, "no-cond-assign": 2, "no-console": 2, "no-constant-condition": 2,