[PR #2632] [MERGED] refactor(frontend): replace for...in usages and forbid via lint rule #8416

Closed
opened 2026-04-20 18:12:17 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-vikunja/vikunja/pull/2632
Author: @tink-bot
Created: 4/15/2026
Status: ✅ Merged
Merged: 4/15/2026
Merged by: @kolaente

Base: main ← Head: chore-reduce-for-in


📝 Commits (3)

  • 3b87324 refactor(frontend): replace for...in usages and forbid via lint rule
  • 41f068d refactor(frontend): replace reverse-index splice loops with findIndex/filter
  • 4e2fab4 fix(frontend): guard Object.keys against null in refactored helpers

📊 Changes

18 files changed (+69 additions, -67 deletions)

View changed files

📝 frontend/eslint.config.js (+5 -0)
📝 frontend/src/components/input/Multiselect.vue (+1 -1)
📝 frontend/src/components/project/views/ProjectList.vue (+1 -1)
📝 frontend/src/components/sharing/UserTeam.vue (+10 -11)
📝 frontend/src/components/tasks/partials/Comments.vue (+1 -1)
📝 frontend/src/components/tasks/partials/EditAssignees.vue (+3 -4)
📝 frontend/src/components/tasks/partials/EditLabels.vue (+3 -4)
📝 frontend/src/helpers/case.ts (+4 -4)
📝 frontend/src/helpers/filters.test.ts (+4 -4)
📝 frontend/src/helpers/saveCollapsedBucketState.ts (+1 -1)
📝 frontend/src/helpers/time/calculateDayInterval.test.ts (+7 -7)
📝 frontend/src/modules/quickAddMagic/quickAddMagic.test.ts (+7 -7)
📝 frontend/src/services/abstractService.ts (+7 -6)
📝 frontend/src/services/task.ts (+1 -5)
📝 frontend/src/stores/kanban.ts (+4 -4)
📝 frontend/src/views/tasks/ShowTasks.vue (+1 -1)
📝 frontend/src/views/tasks/TaskDetailView.vue (+6 -3)
📝 frontend/src/views/teams/EditTeam.vue (+3 -3)

📄 Description

Replaces all 33 `for...in` occurrences with `for...of`/`Object.entries`/`.forEach` or reverse-index `for` loops, and adds a `no-restricted-syntax` ESLint rule to prevent regression. Several converted sites were iterating arrays with `for...in` (which yields string indices and enumerable prototype props) — four of those also spliced during iteration and have been rewritten with reverse-index loops to fix latent element-skipping bugs.

Fixes #513


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-vikunja/vikunja/pull/2632 **Author:** [@tink-bot](https://github.com/tink-bot) **Created:** 4/15/2026 **Status:** ✅ Merged **Merged:** 4/15/2026 **Merged by:** [@kolaente](https://github.com/kolaente) **Base:** `main` ← **Head:** `chore-reduce-for-in` --- ### 📝 Commits (3) - [`3b87324`](https://github.com/go-vikunja/vikunja/commit/3b873248c45f40a78906f28ada2cf285d2fa171f) refactor(frontend): replace for...in usages and forbid via lint rule - [`41f068d`](https://github.com/go-vikunja/vikunja/commit/41f068deac6ab3014474b2113c8040851e426eb3) refactor(frontend): replace reverse-index splice loops with findIndex/filter - [`4e2fab4`](https://github.com/go-vikunja/vikunja/commit/4e2fab4c2f9ec9d11a829207941ec51de55582a4) fix(frontend): guard Object.keys against null in refactored helpers ### 📊 Changes **18 files changed** (+69 additions, -67 deletions) <details> <summary>View changed files</summary> 📝 `frontend/eslint.config.js` (+5 -0) 📝 `frontend/src/components/input/Multiselect.vue` (+1 -1) 📝 `frontend/src/components/project/views/ProjectList.vue` (+1 -1) 📝 `frontend/src/components/sharing/UserTeam.vue` (+10 -11) 📝 `frontend/src/components/tasks/partials/Comments.vue` (+1 -1) 📝 `frontend/src/components/tasks/partials/EditAssignees.vue` (+3 -4) 📝 `frontend/src/components/tasks/partials/EditLabels.vue` (+3 -4) 📝 `frontend/src/helpers/case.ts` (+4 -4) 📝 `frontend/src/helpers/filters.test.ts` (+4 -4) 📝 `frontend/src/helpers/saveCollapsedBucketState.ts` (+1 -1) 📝 `frontend/src/helpers/time/calculateDayInterval.test.ts` (+7 -7) 📝 `frontend/src/modules/quickAddMagic/quickAddMagic.test.ts` (+7 -7) 📝 `frontend/src/services/abstractService.ts` (+7 -6) 📝 `frontend/src/services/task.ts` (+1 -5) 📝 `frontend/src/stores/kanban.ts` (+4 -4) 📝 `frontend/src/views/tasks/ShowTasks.vue` (+1 -1) 📝 `frontend/src/views/tasks/TaskDetailView.vue` (+6 -3) 📝 `frontend/src/views/teams/EditTeam.vue` (+3 -3) </details> ### 📄 Description Replaces all 33 \`for...in\` occurrences with \`for...of\`/\`Object.entries\`/\`.forEach\` or reverse-index \`for\` loops, and adds a \`no-restricted-syntax\` ESLint rule to prevent regression. Several converted sites were iterating arrays with \`for...in\` (which yields string indices and enumerable prototype props) — four of those also spliced during iteration and have been rewritten with reverse-index loops to fix latent element-skipping bugs. Fixes #513 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-20 18:12:17 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vikunja#8416