aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorChris Rebert <[email protected]>2015-12-24 18:58:19 -0700
committerChris Rebert <[email protected]>2015-12-24 18:58:19 -0700
commit99dfd882194deb9ed0e84a3463ef048771624779 (patch)
treed1fd8138dc5115ffd02ad1dd65f5cd27214f9bf3 /js
parent56a6d964e0b2339f11893cd5eb17e84f2b60e5b2 (diff)
parent5deb734b530e62e8b0b9a4b6f251045e2c610a27 (diff)
downloadbootstrap-99dfd882194deb9ed0e84a3463ef048771624779.tar.xz
bootstrap-99dfd882194deb9ed0e84a3463ef048771624779.zip
Merge pull request #18392 from twbs/exempt-getUID
Exempt getUID() from ESLint's no-bitwise rule
Diffstat (limited to 'js')
-rw-r--r--js/.eslintrc2
-rw-r--r--js/src/util.js2
2 files changed, 3 insertions, 1 deletions
diff --git a/js/.eslintrc b/js/.eslintrc
index 427098c13..e712f3247 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,
diff --git a/js/src/util.js b/js/src/util.js
index 5cb8f810b..dba6e9bd6 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
},