From 9f1579aa048eb6a7dee30f60e5c2357b049eff3a Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Thu, 18 Mar 2021 12:58:26 +0200 Subject: [PATCH] Enable `unicorn/prefer-prototype-methods` rule --- .eslintrc.json | 1 - js/src/util/index.js | 2 +- js/tests/visual/modal.html | 4 ++-- js/tests/visual/popover.html | 2 +- js/tests/visual/tooltip.html | 2 +- site/.eslintrc.json | 1 - site/content/docs/5.1/components/alerts.md | 2 +- site/content/docs/5.1/components/collapse.md | 2 +- site/content/docs/5.1/components/dropdowns.md | 2 +- site/content/docs/5.1/components/list-group.md | 2 +- site/content/docs/5.1/components/navs-tabs.md | 2 +- site/content/docs/5.1/components/offcanvas.md | 2 +- site/content/docs/5.1/components/popovers.md | 2 +- site/content/docs/5.1/components/scrollspy.md | 2 +- site/content/docs/5.1/components/toasts.md | 2 +- site/content/docs/5.1/components/tooltips.md | 2 +- site/content/docs/5.1/examples/sidebars/sidebars.js | 2 +- 17 files changed, 16 insertions(+), 18 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 9bd404dfa3..72b267691c 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -60,7 +60,6 @@ "unicorn/prefer-array-flat": "off", "unicorn/prefer-dom-node-dataset": "off", "unicorn/prefer-module": "off", - "unicorn/prefer-prototype-methods": "off", "unicorn/prefer-query-selector": "off", "unicorn/prefer-spread": "off", "unicorn/prevent-abbreviations": "off" diff --git a/js/src/util/index.js b/js/src/util/index.js index 7e9e9b0464..b994963018 100644 --- a/js/src/util/index.js +++ b/js/src/util/index.js @@ -15,7 +15,7 @@ const toType = obj => { return `${obj}` } - return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase() + return Object.prototype.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase() } /** diff --git a/js/tests/visual/modal.html b/js/tests/visual/modal.html index ac0a931af5..eeb0aa567a 100644 --- a/js/tests/visual/modal.html +++ b/js/tests/visual/modal.html @@ -220,12 +220,12 @@ } } - [].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]')) + Array.prototype.slice.call(document.querySelectorAll('[data-bs-toggle="popover"]')) .forEach(function (popover) { new Popover(popover) }) - var tooltipList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')) + var tooltipList = Array.prototype.slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')) tooltipList.forEach(function (tooltip) { new Tooltip(tooltip) }) diff --git a/js/tests/visual/popover.html b/js/tests/visual/popover.html index 986ac571e3..f914f2b3be 100644 --- a/js/tests/visual/popover.html +++ b/js/tests/visual/popover.html @@ -40,7 +40,7 @@