diff --git a/.eslintrc.json b/.eslintrc.json index 3fd5a09..17c625a 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -4,9 +4,6 @@ "browser": true }, "extends": ["eslint:recommended", "plugin:unicorn/recommended", "prettier"], - "rules": { - "unicorn/no-for-loop": 0 - }, "parserOptions": { "ecmaVersion": "latest", "sourceType": "module" diff --git a/src/shareon.js b/src/shareon.js index 4164053..a1f818e 100644 --- a/src/shareon.js +++ b/src/shareon.js @@ -38,23 +38,9 @@ const initializeShareon = () => { const shareonContainers = document.querySelectorAll(".shareon"); // iterate over
- for ( - let containerIndex = 0; - containerIndex < shareonContainers.length; - containerIndex += 1 - ) { - /** @type Element */ - const container = shareonContainers[containerIndex]; - + for (const container of shareonContainers) { // iterate over children of
- for ( - let childIndex = 0; - childIndex < container.children.length; - childIndex += 1 - ) { - /** @type Element */ - const child = container.children[childIndex]; - + for (const child of container.children) { if (child) { const classListLength = child.classList.length;