Skip to content

Conversation

@TonyRL
Copy link
Collaborator

@TonyRL TonyRL commented Jan 2, 2026

Involved Issue / 该 PR 相关 Issue

Close #

Example for the Proposed Route(s) / 路由地址示例

NOROUTE

Note / 说明

unicorn/no-for-loop uses Array.prototype.entries to fix is slow.

Copilot AI review requested due to automatic review settings January 2, 2026 01:30
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request replaces the ESLint rule unicorn/no-for-loop with typescript/prefer-for-of to improve performance. The unicorn/no-for-loop rule's auto-fix uses Array.prototype.entries() which is slower than simple indexed loops.

Key changes include:

  • ESLint configuration updates to disable unicorn/no-for-loop and enable @typescript-eslint/prefer-for-of
  • Converting .entries() loops back to indexed for loops where appropriate
  • Standardizing type assertions from <Type> to as Type syntax
  • Adjusting array type syntax based on the array-simple rule

Reviewed changes

Copilot reviewed 214 out of 214 changed files in this pull request and generated no comments.

Show a summary per file
File Description
eslint.config.mjs Disables unicorn/no-for-loop, enables @typescript-eslint/prefer-for-of and other TypeScript stylistic rules
Multiple .ts/.tsx files Converts .entries() loops to indexed for-loops for better performance
Multiple .ts files Changes type assertions from angle-bracket to as syntax
Multiple .ts files Adjusts array type syntax (Type[]Array<Type>) per array-simple rule
Multiple .ts files Removes redundant type annotations on variables with obvious types

The changes are consistent throughout the codebase and correctly implement the performance improvements described in the PR.

Comments suppressed due to low confidence (1)

lib/routes/dytt/index.ts:245

  • This string is not a template literal, but appears to reference the variable domain.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@TonyRL TonyRL merged commit b84bb92 into DIYgod:master Jan 2, 2026
31 checks passed
@TonyRL TonyRL deleted the style/unicorn-no-for-loop branch January 2, 2026 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant