1
0
Fork 0
mirror of https://github.com/twbs/bootstrap.git synced 2022-11-09 12:25:43 -05:00

Disable ESlint on no-return-assign and temporary for arrow-body-style

This commit is contained in:
Johann-S 2017-08-23 16:28:01 +02:00 committed by XhmikosR
parent 2970d14dd9
commit 4aef395e49
3 changed files with 9 additions and 6 deletions

View file

@ -69,7 +69,6 @@
"no-param-reassign": "off",
"no-proto": "error",
"no-restricted-properties": "error",
"no-return-assign": "error",
"no-return-await": "error",
"no-script-url": "error",
"no-self-compare": "error",

View file

@ -66,7 +66,7 @@ class Alert {
const customEvent = this._triggerCloseEvent(rootElement)
if (customEvent.defaultPrevented) {
if (customEvent === null || customEvent.defaultPrevented) {
return
}

View file

@ -16,8 +16,9 @@ if (!Element.prototype.matches) {
}
// closest polyfill (see: https://mzl.la/2vXggaI)
let fnClosest = null
if (!Element.prototype.closest) {
Element.prototype.closest = (element, selector) => {
fnClosest = (element, selector) => {
let ancestor = element
if (!document.documentElement.contains(element)) {
return null
@ -33,9 +34,12 @@ if (!Element.prototype.closest) {
return null
}
} else {
// eslint-disable-next-line arrow-body-style
fnClosest = (element, selector) => {
return element.closest(selector)
}
}
const fnClosest = Element.prototype.closest
const SelectorEngine = {
matches(element, selector) {
@ -56,7 +60,7 @@ const SelectorEngine = {
},
closest(element, selector) {
return fnClosest.call(element, selector)
return fnClosest(element, selector)
}
}