Skip to content

Conversation

@brrichards
Copy link
Contributor

Removes the unicorn/no-new-array: off override from the @fluidframework/tree package and fixes the resulting errors. This is part of an ongoing effort to incrementally remove global ESLint rule overrides from eslint.config.mts and .eslintrc.cjs.

Renamed local schema classes from Array to ArrayNode to avoid shadowing the built-in Array constructor. These were false positives.

All violations were fixed without requiring eslint-disable comments.

Copilot AI review requested due to automatic review settings January 12, 2026 16:56
@brrichards brrichards requested a review from a team as a code owner January 12, 2026 16:56
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 PR enables the unicorn/no-new-array ESLint rule for the @fluidframework/tree package by removing the rule override and fixing all violations. This is part of an ongoing effort to incrementally remove global ESLint rule overrides.

Changes:

  • Removed unicorn/no-new-array: off from both eslint.config.mts and .eslintrc.cjs
  • Renamed local test schema classes from Array to ArrayNode to avoid shadowing the built-in Array constructor
  • Refactored new Array(length).fill(value).map() patterns to use Array.from() with a mapper function

Reviewed changes

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

Show a summary per file
File Description
packages/dds/tree/eslint.config.mts Removed the unicorn/no-new-array: off override
packages/dds/tree/.eslintrc.cjs Removed the unicorn/no-new-array: off override
packages/dds/tree/src/test/snapshots/snapshotTestScenarios.ts Renamed Array class to ArrayNode to avoid shadowing built-in Array
packages/dds/tree/src/test/shared-tree/tree.spec.ts Renamed Array class to ArrayNode to avoid shadowing built-in Array
packages/dds/tree/src/test/shared-tree/opSize.bench.ts Refactored new Array(length).fill() to Array.from({ length }, mapper)
packages/dds/tree/src/test/domains/json/canada.ts Refactored new Array(length).fill().map() to Array.from({ length }, mapper)

@brrichards brrichards merged commit 27f08ef into microsoft:main Jan 12, 2026
34 checks passed
anthony-murphy-agent pushed a commit to anthony-murphy-agent/FluidFramework that referenced this pull request Jan 14, 2026
Removes the unicorn/no-new-array: off override from the
@fluidframework/tree package and fixes the resulting errors. This is
part of an ongoing effort to incrementally remove global ESLint rule
overrides from eslint.config.mts and .eslintrc.cjs.

Renamed local schema classes from Array to ArrayNode to avoid shadowing
the built-in Array constructor. These were false positives.

All violations were fixed without requiring eslint-disable comments.
@brrichards brrichards deleted the enable-no-new-array branch January 16, 2026 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants