mirror of
https://github.com/plausible/analytics.git
synced 2024-12-22 17:11:36 +03:00
9c2fd9aca5
and so was just annoying 2. Get rid of all existing ESLint errors. 2a. Turned off `react/display-name` because I couldn't figure out how to make that wrapped component have a display name. If anyone can figure it out, that'd be great, because that makes things nicer when using the React debugger. 2b. The part where it says `plausible()` is undefined in `app.js` is bothering me. I disabled the check because I can't figure out where that actually comes from to put in the proper import. 2c. Told ESLint we're using Babel. 3. Added `npm run format` and `npm run lint` commands.
15 lines
456 B
JavaScript
15 lines
456 B
JavaScript
if (window.Element && !Element.prototype.closest) {
|
|
Element.prototype.closest =
|
|
function(s) {
|
|
var matches = (this.document || this.ownerDocument).querySelectorAll(s),
|
|
i,
|
|
el = this;
|
|
do {
|
|
i = matches.length;
|
|
// eslint-disable-next-line no-empty
|
|
while (--i >= 0 && matches.item(i) !== el) {};
|
|
} while ((i < 0) && (el = el.parentElement));
|
|
return el;
|
|
};
|
|
}
|