Merge branch 'for-of-loop'
https://codeberg.org/kytta/shareon/pulls/7 message to explain why this merge is necessary,pull/45/head
commit
d3081f3446
|
@ -4,9 +4,6 @@
|
||||||
"browser": true
|
"browser": true
|
||||||
},
|
},
|
||||||
"extends": ["eslint:recommended", "plugin:unicorn/recommended", "prettier"],
|
"extends": ["eslint:recommended", "plugin:unicorn/recommended", "prettier"],
|
||||||
"rules": {
|
|
||||||
"unicorn/no-for-loop": 0
|
|
||||||
},
|
|
||||||
"parserOptions": {
|
"parserOptions": {
|
||||||
"ecmaVersion": "latest",
|
"ecmaVersion": "latest",
|
||||||
"sourceType": "module"
|
"sourceType": "module"
|
||||||
|
|
|
@ -38,23 +38,9 @@ const initializeShareon = () => {
|
||||||
const shareonContainers = document.querySelectorAll(".shareon");
|
const shareonContainers = document.querySelectorAll(".shareon");
|
||||||
|
|
||||||
// iterate over <div class="shareon">
|
// iterate over <div class="shareon">
|
||||||
for (
|
for (const container of shareonContainers) {
|
||||||
let containerIndex = 0;
|
|
||||||
containerIndex < shareonContainers.length;
|
|
||||||
containerIndex += 1
|
|
||||||
) {
|
|
||||||
/** @type Element */
|
|
||||||
const container = shareonContainers[containerIndex];
|
|
||||||
|
|
||||||
// iterate over children of <div class="shareon">
|
// iterate over children of <div class="shareon">
|
||||||
for (
|
for (const child of container.children) {
|
||||||
let childIndex = 0;
|
|
||||||
childIndex < container.children.length;
|
|
||||||
childIndex += 1
|
|
||||||
) {
|
|
||||||
/** @type Element */
|
|
||||||
const child = container.children[childIndex];
|
|
||||||
|
|
||||||
if (child) {
|
if (child) {
|
||||||
const classListLength = child.classList.length;
|
const classListLength = child.classList.length;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue