mirror of
https://github.com/twbs/bootstrap.git
synced 2022-11-09 12:25:43 -05:00
Merge pull request #18392 from twbs/exempt-getUID
Exempt getUID() from ESLint's no-bitwise rule
This commit is contained in:
commit
99dfd88219
2 changed files with 3 additions and 1 deletions
|
@ -10,7 +10,7 @@
|
||||||
// Possible Errors
|
// Possible Errors
|
||||||
"comma-dangle": [2, "never"],
|
"comma-dangle": [2, "never"],
|
||||||
"handle-callback-err": 2,
|
"handle-callback-err": 2,
|
||||||
"no-bitwise": 0,
|
"no-bitwise": 2,
|
||||||
"no-cond-assign": 2,
|
"no-cond-assign": 2,
|
||||||
"no-console": 2,
|
"no-console": 2,
|
||||||
"no-constant-condition": 2,
|
"no-constant-condition": 2,
|
||||||
|
|
|
@ -99,7 +99,9 @@ const Util = (($) => {
|
||||||
|
|
||||||
getUID(prefix) {
|
getUID(prefix) {
|
||||||
do {
|
do {
|
||||||
|
/* eslint-disable no-bitwise */
|
||||||
prefix += ~~(Math.random() * 1000000) // "~~" acts like a faster Math.floor() here
|
prefix += ~~(Math.random() * 1000000) // "~~" acts like a faster Math.floor() here
|
||||||
|
/* eslint-enable no-bitwise */
|
||||||
} while (document.getElementById(prefix))
|
} while (document.getElementById(prefix))
|
||||||
return prefix
|
return prefix
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue