2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-06-08 17:22:31 +03:00

Enable unicorn/no-array-for-each rule

This commit is contained in:
XhmikosR
2021-07-30 09:28:51 +03:00
parent 2b4d0d166b
commit 666fe596bf
23 changed files with 132 additions and 117 deletions
+5 -3
View File
@@ -125,7 +125,7 @@ const getElement = obj => {
}
const typeCheckConfig = (componentName, config, configTypes) => {
Object.keys(configTypes).forEach(property => {
for (const property of Object.keys(configTypes)) {
const expectedTypes = configTypes[property]
const value = config[property]
const valueType = value && isElement(value) ? 'element' : toType(value)
@@ -135,7 +135,7 @@ const typeCheckConfig = (componentName, config, configTypes) => {
`${componentName.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`
)
}
})
}
}
const isVisible = element => {
@@ -217,7 +217,9 @@ const onDOMContentLoaded = callback => {
// add listener on the first call when the document is in loading state
if (!DOMContentLoadedCallbacks.length) {
document.addEventListener('DOMContentLoaded', () => {
DOMContentLoadedCallbacks.forEach(callback => callback())
for (const callback of DOMContentLoadedCallbacks) {
callback()
}
})
}